[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Move files that have appeared in the wrong place due to incorrect patch -p setting.
# HG changeset patch # User emellor@xxxxxxxxxxxxxxxxxxxxxx # Node ID 8e3865296e31130d64f93be37789d65c11014c50 # Parent d741fa2723094a51274466e91b71c13291732e94 Move files that have appeared in the wrong place due to incorrect patch -p setting. Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx> diff -r d741fa272309 -r 8e3865296e31 tools/examples/locking.sh --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/examples/locking.sh Mon Feb 27 15:28:57 2006 @@ -0,0 +1,98 @@ +# +# Copyright (c) 2005 XenSource Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of version 2.1 of the GNU Lesser General Public +# License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# +# Serialisation +# + +LOCK_SLEEPTIME=1 +LOCK_SPINNING_RETRIES=5 +LOCK_RETRIES=10 +LOCK_BASEDIR=/var/run/xen-hotplug + + +claim_lock() +{ + local lockdir="$LOCK_BASEDIR/$1" + mkdir -p "$LOCK_BASEDIR" + _claim_lock "$lockdir" +} + + +release_lock() +{ + _release_lock "$LOCK_BASEDIR/$1" +} + + +_claim_lock() +{ + local lockdir="$1" + local owner=$(_lock_owner "$lockdir") + local retries=0 + + while [ $retries -lt $LOCK_RETRIES ] + do + mkdir "$lockdir" 2>/dev/null && trap "release_lock $1; sigerr" ERR && + _update_lock_info "$lockdir" && return + + local new_owner=$(_lock_owner "$lockdir") + if [ "$new_owner" != "$owner" ] + then + owner="$new_owner" + retries=0 + fi + + if [ $retries -gt $LOCK_SPINNING_RETRIES ] + then + sleep $LOCK_SLEEPTIME + else + sleep 0 + fi + retries=$(($retries + 1)) + done + _steal_lock "$lockdir" +} + + +_release_lock() +{ + trap sigerr ERR + rm -rf "$1" 2>/dev/null || true +} + + +_steal_lock() +{ + local lockdir="$1" + local owner=$(cat "$lockdir/owner" 2>/dev/null || echo "unknown") + log err "Forced to steal lock on $lockdir from $owner!" + _release_lock "$lockdir" + _claim_lock "$lockdir" +} + + +_lock_owner() +{ + cat "$1/owner" 2>/dev/null || echo "unknown" +} + + +_update_lock_info() +{ + echo "$$: $0" >"$1/owner" +} diff -r d741fa272309 -r 8e3865296e31 tools/examples/logging.sh --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/examples/logging.sh Mon Feb 27 15:28:57 2006 @@ -0,0 +1,22 @@ +# +# Copyright (c) 2005 XenSource Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of version 2.1 of the GNU Lesser General Public +# License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +log() { + local level="$1" + shift + logger -p "daemon.$level" -- "$0:" "$@" || echo "$0 $@" >&2 +} diff -r d741fa272309 -r 8e3865296e31 tools/examples/vtpm-delete --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/examples/vtpm-delete Mon Feb 27 15:28:57 2006 @@ -0,0 +1,9 @@ +#!/bin/sh + +# This scripts must be called the following way: +# vtpm-delete <domain name> + +dir=$(dirname "$0") +. "$dir/vtpm-common.sh" + +vtpm_delete_instance $1 diff -r d741fa272309 -r 8e3865296e31 tools/examples/vtpm-hotplug-common.sh --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/examples/vtpm-hotplug-common.sh Mon Feb 27 15:28:57 2006 @@ -0,0 +1,35 @@ +# +# Copyright (c) 2005 IBM Corporation +# Copyright (c) 2005 XenSource Ltd. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of version 2.1 of the GNU Lesser General Public +# License as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +dir=$(dirname "$0") +. "$dir/xen-hotplug-common.sh" + +findCommand "$@" +if [ "$command" != "online" ] && + [ "$command" != "offline" ] && + [ "$command" != "add" ] && + [ "$command" != "remove" ] +then + log err "Invalid command: $command" + exit 1 +fi + + +XENBUS_PATH="${XENBUS_PATH:?}" + +. "$dir/vtpm-common.sh" diff -r d741fa272309 -r 8e3865296e31 tools/xm-test/tests/vtpm/01_vtpm-list_pos.py --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Mon Feb 27 15:28:57 2006 @@ -0,0 +1,45 @@ +#!/usr/bin/python + +# Copyright (C) International Business Machines Corp., 2006 +# Author: Stefan Berger <stefanb@xxxxxxxxxx) + +# Positive Test: create domain with virtual TPM attached at build time, +# verify list + + +from XmTestLib import * + +def vtpm_cleanup(domName): + # Since this is only a temporary domain I clean up the domain from the + # virtual TPM directory + traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName) + +if ENABLE_HVM_SUPPORT: + SKIP("vtpm-list not supported for HVM domains") + +config = {"vtpm":"instance=1,backend=0"} +domain = XmTestDomain(extraConfig=config) + +try: + domain.start() +except DomainError, e: + if verbose: + print e.extra + vtpm_cleanup(domain.getName()) + FAIL("Unable to create domain") + +domName = domain.getName() + +status, output = traceCommand("xm vtpm-list %s" % domain.getId()) +eyecatcher = "/local/domain/0/backend/vtpm" +where = output.find(eyecatcher) +if status != 0: + vtpm_cleanup(domName) + FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status) +elif where < 0: + vtpm_cleanup(domName) + FAIL("Fail to list virtual TPM device") + +domain.stop() + +vtpm_cleanup(domName) diff -r d741fa272309 -r 8e3865296e31 tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Mon Feb 27 15:28:57 2006 @@ -0,0 +1,81 @@ +#!/usr/bin/python + +# Copyright (C) International Business Machines Corp., 2006 +# Author: Stefan Berger <stefanb@xxxxxxxxxx) + +# Positive Test: create domain with virtual TPM attached at build time, +# check list of pcrs + +from XmTestLib import * + +def vtpm_cleanup(domName): + # Since this is only a temporary domain I clean up the domain from the + # virtual TPM directory + traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName) + +if ENABLE_HVM_SUPPORT: + SKIP("vtpm-list not supported for HVM domains") + +status, output = traceCommand("ls /dev/tpm0") +if re.search("No such file or directory",output): + SKIP("This machine has no hardware TPM; cannot run this test") + +status, output = traceCommand("ps aux | grep vtpm_manager | grep -v grep") +if output == "": + FAIL("virtual TPM manager must be started to run this test") + +# vtpm manager has been detected +config = {"vtpm":"instance=1,backend=0"} +domain = XmTestDomain(extraConfig=config) + +try: + domain.start() +except DomainError, e: + if verbose: + print e.extra + vtpm_cleanup(domain.getName()) + FAIL("Unable to create domain") + +domName = domain.getName() + +try: + console = XmConsole(domain.getName()) +except ConsoleError, e: + vtpm_cleanup(domName) + FAIL(str(e)) + +try: + console.sendInput("input") + run = console.runCmd("ls /sys") +except ConsoleError, e: + saveLog(console.getHistory()) + vtpm_cleanup(domName) + FAIL(str(e)) + +if re.search("No such file",run["output"]): + try: + run = console.runCmd("mkdir /sys") + run = console.runCmd("mount -t sysfs /sys /sys") + except ConsoleError, e: + saveLog(console.getHistory()) + vtpm_cleanup(domName) + FAIL(str(e)) + +try: + run = console.runCmd("cat /sys/devices/platform/tpm_vtpm/pcrs") +except ConsoleError, e: + saveLog(console.getHistory()) + vtpm_cleanup(domName) + FAIL(str(e)) + +if re.search("No such file",run["output"]): + FAIL("TPM frontend support not compiled into (domU?) kernel") + +console.closeConsole() + +domain.stop() + +vtpm_cleanup(domName) + +if not re.search("PCR-00:",run["output"]): + FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side") diff -r d741fa272309 -r 8e3865296e31 tools/xm-test/tests/vtpm/Makefile.am --- /dev/null Mon Feb 27 15:14:11 2006 +++ b/tools/xm-test/tests/vtpm/Makefile.am Mon Feb 27 15:28:57 2006 @@ -0,0 +1,22 @@ + +SUBDIRS = + +TESTS = 01_vtpm-list_pos.test \ + 02_vtpm-cat_pcrs.test + +XFAIL_TESTS = + +EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) + +TESTS_ENVIRONMENT=@TENV@ + +%.test: %.py + cp $< $@ + chmod +x $@ + +clean-local: am_config_clean-local + +am_config_clean-local: + rm -f *test + rm -f *log + rm -f *~ diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/examples/locking.sh --- a/xen-unstable.hg/tools/examples/locking.sh Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,98 +0,0 @@ -# -# Copyright (c) 2005 XenSource Ltd. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of version 2.1 of the GNU Lesser General Public -# License as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# -# Serialisation -# - -LOCK_SLEEPTIME=1 -LOCK_SPINNING_RETRIES=5 -LOCK_RETRIES=10 -LOCK_BASEDIR=/var/run/xen-hotplug - - -claim_lock() -{ - local lockdir="$LOCK_BASEDIR/$1" - mkdir -p "$LOCK_BASEDIR" - _claim_lock "$lockdir" -} - - -release_lock() -{ - _release_lock "$LOCK_BASEDIR/$1" -} - - -_claim_lock() -{ - local lockdir="$1" - local owner=$(_lock_owner "$lockdir") - local retries=0 - - while [ $retries -lt $LOCK_RETRIES ] - do - mkdir "$lockdir" 2>/dev/null && trap "release_lock $1; sigerr" ERR && - _update_lock_info "$lockdir" && return - - local new_owner=$(_lock_owner "$lockdir") - if [ "$new_owner" != "$owner" ] - then - owner="$new_owner" - retries=0 - fi - - if [ $retries -gt $LOCK_SPINNING_RETRIES ] - then - sleep $LOCK_SLEEPTIME - else - sleep 0 - fi - retries=$(($retries + 1)) - done - _steal_lock "$lockdir" -} - - -_release_lock() -{ - trap sigerr ERR - rm -rf "$1" 2>/dev/null || true -} - - -_steal_lock() -{ - local lockdir="$1" - local owner=$(cat "$lockdir/owner" 2>/dev/null || echo "unknown") - log err "Forced to steal lock on $lockdir from $owner!" - _release_lock "$lockdir" - _claim_lock "$lockdir" -} - - -_lock_owner() -{ - cat "$1/owner" 2>/dev/null || echo "unknown" -} - - -_update_lock_info() -{ - echo "$$: $0" >"$1/owner" -} diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/examples/logging.sh --- a/xen-unstable.hg/tools/examples/logging.sh Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,22 +0,0 @@ -# -# Copyright (c) 2005 XenSource Ltd. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of version 2.1 of the GNU Lesser General Public -# License as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -log() { - local level="$1" - shift - logger -p "daemon.$level" -- "$0:" "$@" || echo "$0 $@" >&2 -} diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/examples/vtpm-delete --- a/xen-unstable.hg/tools/examples/vtpm-delete Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,9 +0,0 @@ -#!/bin/sh - -# This scripts must be called the following way: -# vtpm-delete <domain name> - -dir=$(dirname "$0") -. "$dir/vtpm-common.sh" - -vtpm_delete_instance $1 diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/examples/vtpm-hotplug-common.sh --- a/xen-unstable.hg/tools/examples/vtpm-hotplug-common.sh Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,35 +0,0 @@ -# -# Copyright (c) 2005 IBM Corporation -# Copyright (c) 2005 XenSource Ltd. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of version 2.1 of the GNU Lesser General Public -# License as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -dir=$(dirname "$0") -. "$dir/xen-hotplug-common.sh" - -findCommand "$@" -if [ "$command" != "online" ] && - [ "$command" != "offline" ] && - [ "$command" != "add" ] && - [ "$command" != "remove" ] -then - log err "Invalid command: $command" - exit 1 -fi - - -XENBUS_PATH="${XENBUS_PATH:?}" - -. "$dir/vtpm-common.sh" diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py --- a/xen-unstable.hg/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,45 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) International Business Machines Corp., 2006 -# Author: Stefan Berger <stefanb@xxxxxxxxxx) - -# Positive Test: create domain with virtual TPM attached at build time, -# verify list - - -from XmTestLib import * - -def vtpm_cleanup(domName): - # Since this is only a temporary domain I clean up the domain from the - # virtual TPM directory - traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName) - -if ENABLE_HVM_SUPPORT: - SKIP("vtpm-list not supported for HVM domains") - -config = {"vtpm":"instance=1,backend=0"} -domain = XmTestDomain(extraConfig=config) - -try: - domain.start() -except DomainError, e: - if verbose: - print e.extra - vtpm_cleanup(domain.getName()) - FAIL("Unable to create domain") - -domName = domain.getName() - -status, output = traceCommand("xm vtpm-list %s" % domain.getId()) -eyecatcher = "/local/domain/0/backend/vtpm" -where = output.find(eyecatcher) -if status != 0: - vtpm_cleanup(domName) - FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status) -elif where < 0: - vtpm_cleanup(domName) - FAIL("Fail to list virtual TPM device") - -domain.stop() - -vtpm_cleanup(domName) diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py --- a/xen-unstable.hg/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,81 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) International Business Machines Corp., 2006 -# Author: Stefan Berger <stefanb@xxxxxxxxxx) - -# Positive Test: create domain with virtual TPM attached at build time, -# check list of pcrs - -from XmTestLib import * - -def vtpm_cleanup(domName): - # Since this is only a temporary domain I clean up the domain from the - # virtual TPM directory - traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName) - -if ENABLE_HVM_SUPPORT: - SKIP("vtpm-list not supported for HVM domains") - -status, output = traceCommand("ls /dev/tpm0") -if re.search("No such file or directory",output): - SKIP("This machine has no hardware TPM; cannot run this test") - -status, output = traceCommand("ps aux | grep vtpm_manager | grep -v grep") -if output == "": - FAIL("virtual TPM manager must be started to run this test") - -# vtpm manager has been detected -config = {"vtpm":"instance=1,backend=0"} -domain = XmTestDomain(extraConfig=config) - -try: - domain.start() -except DomainError, e: - if verbose: - print e.extra - vtpm_cleanup(domain.getName()) - FAIL("Unable to create domain") - -domName = domain.getName() - -try: - console = XmConsole(domain.getName()) -except ConsoleError, e: - vtpm_cleanup(domName) - FAIL(str(e)) - -try: - console.sendInput("input") - run = console.runCmd("ls /sys") -except ConsoleError, e: - saveLog(console.getHistory()) - vtpm_cleanup(domName) - FAIL(str(e)) - -if re.search("No such file",run["output"]): - try: - run = console.runCmd("mkdir /sys") - run = console.runCmd("mount -t sysfs /sys /sys") - except ConsoleError, e: - saveLog(console.getHistory()) - vtpm_cleanup(domName) - FAIL(str(e)) - -try: - run = console.runCmd("cat /sys/devices/platform/tpm_vtpm/pcrs") -except ConsoleError, e: - saveLog(console.getHistory()) - vtpm_cleanup(domName) - FAIL(str(e)) - -if re.search("No such file",run["output"]): - FAIL("TPM frontend support not compiled into (domU?) kernel") - -console.closeConsole() - -domain.stop() - -vtpm_cleanup(domName) - -if not re.search("PCR-00:",run["output"]): - FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side") diff -r d741fa272309 -r 8e3865296e31 xen-unstable.hg/tools/xm-test/tests/vtpm/Makefile.am --- a/xen-unstable.hg/tools/xm-test/tests/vtpm/Makefile.am Mon Feb 27 15:14:11 2006 +++ /dev/null Mon Feb 27 15:28:57 2006 @@ -1,22 +0,0 @@ - -SUBDIRS = - -TESTS = 01_vtpm-list_pos.test \ - 02_vtpm-cat_pcrs.test - -XFAIL_TESTS = - -EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) - -TESTS_ENVIRONMENT=@TENV@ - -%.test: %.py - cp $< $@ - chmod +x $@ - -clean-local: am_config_clean-local - -am_config_clean-local: - rm -f *test - rm -f *log - rm -f *~ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |