Fixes for some test cases that migrate or suspend/resume VMs
PATCH 1/1 Fixes for some test cases that migrate or suspend/resume VMs
Some test cases where a VM is suspended/resumed or migrated do not properly delete the VM configuration using 'xm delete' when 'xm' is run in Xen-API mode. It seems that 'xm destroy' is necessary since these operations lead VMs to become 'xend - managed'. Adding them to the list of managed domains before executing those operations will call 'xm destroy' when the test finishes and keep the domain list clean.
Signed-off-by Stefan Berger <[email protected]>
--- xen-unstable.hg/tools/xm-test/lib/XmTestLib/DomainTracking.py | 3 ++- xen-unstable.hg/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py | 2 ++ xen-unstable.hg/tools/xm-test/tests/restore/01_restore_basic_pos.py | 2 ++ xen-unstable.hg/tools/xm-test/tests/restore/04_restore_withdevices_pos.py | 2 ++ xen-unstable.hg/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py | 3 +++ xen-unstable.hg/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py | 3 +++ xen-unstable.hg/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py | 3 +++ xen-unstable.hg/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py | 3 +++ xen-unstable.hg/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py | 3 +++ xen-unstable.hg/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py | 3 +++ 10 files changed, 26 insertions(+), 1 deletion(-)
xen-unstable.hg/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py +3 -0
@@ -47,6 +47,9 @@ if re.search("No such file",run["output" consoleHistory = console.getHistory() domain.closeConsole() +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py +3 -0
@@ -50,6 +50,9 @@ domain.closeConsole() old_domid = domid(domName) +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py +3 -0
@@ -50,6 +50,9 @@ domain.closeConsole() old_domid = domid(domName) +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py +3 -0
@@ -72,6 +72,9 @@ if not re.search("PCR-00: 1E A7 BD",run[ consoleHistory = console.getHistory() domain.closeConsole() +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py +3 -0
@@ -75,6 +75,9 @@ domain.closeConsole() old_domid = domid(domName) +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/lib/XmTestLib/DomainTracking.py +2 -1
@@ -29,7 +29,8 @@ registered = 0 def addManagedDomain(name): global registered - _managedDomains.append(name) + if name not in _managedDomains: + _managedDomains.append(name) if not registered: atexit.register(destroyManagedDomains) registered = 1
xen-unstable.hg/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py +3 -0
@@ -75,6 +75,9 @@ domain.closeConsole() old_domid = domid(domName) +# Need to have it destroyed with 'xm delete' at the end. +addManagedDomain(domName) + loop = 0 while loop < 3: try:
xen-unstable.hg/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py +2 -0
@@ -43,6 +43,8 @@ domain.closeConsole() old_domid = domid(domain.getName()) +addManagedDomain(domain.getName()) + # Migrate the domain try: status, output = traceCommand("xm migrate -l %s localhost" % domain.getName(),
xen-unstable.hg/tools/xm-test/tests/restore/01_restore_basic_pos.py +2 -0
@@ -33,6 +33,8 @@ except ConsoleError, e: domain.closeConsole() +addManagedDomain(domain.getName()) + # Save it out try: s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(),
xen-unstable.hg/tools/xm-test/tests/restore/04_restore_withdevices_pos.py +2 -0
@@ -66,6 +66,8 @@ except ConsoleError, e: domain.closeConsole() +addManagedDomain(domain.getName()) + try: s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(), timeout=30)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel