aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test/tests/vtpm/vtpm_utils.py
blob: 01a60f90c64ad5d1c006af1b54eab8824ad54fc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python

# Copyright (C) International Business Machines Corp., 2006
# Author: Stefan Berger <stefanb@us.ibm.com>

from XmTestLib import *

if ENABLE_HVM_SUPPORT:
    SKIP("vtpm tests not supported for HVM domains")

if not os.path.exists("/dev/tpm0"):
    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")

def vtpm_cleanup(domName):
    traceCommand("/etc/xen/scripts/vtpm-delete %s" % domName)