diff options
Diffstat (limited to 'tools/xm-test/tests/vtpm/01_vtpm-list_pos.py')
-rw-r--r-- | tools/xm-test/tests/vtpm/01_vtpm-list_pos.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py index a427bf2fde..dfd1227a00 100644 --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py +++ b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py @@ -11,6 +11,7 @@ from XmTestLib import * from vtpm_utils import * import commands import os +import atexit config = {"vtpm":"instance=1,backend=0"} domain = XmTestDomain(extraConfig=config) @@ -23,18 +24,17 @@ except DomainError, e: vtpm_cleanup(domain.getName()) FAIL("Unable to create domain") + domName = domain.getName() +atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName))) + 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) |