debuggers.hg

view tools/xm-test/tests/vtpm/vtpm_utils.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2006
4 # Author: Stefan Berger <stefanb@us.ibm.com>
6 from XmTestLib import *
8 if ENABLE_HVM_SUPPORT:
9 SKIP("vtpm tests not supported for HVM domains")
11 status, output = traceCommand("COLUMNS=200 ; "
12 "ps aux | grep vtpm_manager | grep -v grep")
13 if output == "":
14 SKIP("virtual TPM manager must be started to run this test; might "
15 "need /dev/tpm0")
17 def vtpm_cleanup(domName):
18 traceCommand("/etc/xen/scripts/vtpm-delete "
19 "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
20 str(domid(domName)))
22 def vtpm_cleanup(uuid):
23 from xen.xm import main
24 if main.serverType != main.SERVER_XEN_API:
25 traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
27 def vtpm_get_uuid(domainid):
28 s, o = traceCommand("xenstore-read "
29 "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
30 return o