aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test
diff options
context:
space:
mode:
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-11-13 10:47:00 +0000
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-11-13 10:47:00 +0000
commitb918dce5bb2a665a34ff893a9df5392fb8ea429d (patch)
tree01485ddfa0f78b9e0b59ea896c3a88580d3182d3 /tools/xm-test
parentdde22055ac3aa45eb9ec4b297874638c2a25c320 (diff)
downloadxen-b918dce5bb2a665a34ff893a9df5392fb8ea429d.tar.gz
xen-b918dce5bb2a665a34ff893a9df5392fb8ea429d.tar.bz2
xen-b918dce5bb2a665a34ff893a9df5392fb8ea429d.zip
tools: Remove the vtpm process model
Remove the old vtpm process model. It doesn't work very well and is no longer supported. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/xm-test')
-rw-r--r--tools/xm-test/configure.ac1
-rw-r--r--tools/xm-test/grouptest/default1
-rw-r--r--tools/xm-test/grouptest/medium1
-rw-r--r--tools/xm-test/grouptest/xapi1
-rw-r--r--tools/xm-test/lib/XmTestLib/XenDomain.py1
-rw-r--r--tools/xm-test/tests/Makefile.am1
-rw-r--r--tools/xm-test/tests/vtpm/01_vtpm-list_pos.py40
-rw-r--r--tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py49
-rw-r--r--tools/xm-test/tests/vtpm/03_vtpm-susp_res.py99
-rw-r--r--tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py93
-rw-r--r--tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py93
-rw-r--r--tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py125
-rw-r--r--tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py119
-rw-r--r--tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py119
-rw-r--r--tools/xm-test/tests/vtpm/09_vtpm-xapi.py158
-rw-r--r--tools/xm-test/tests/vtpm/Makefile.am27
-rw-r--r--tools/xm-test/tests/vtpm/vtpm_utils.py30
17 files changed, 0 insertions, 958 deletions
diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac
index ad1eb78391..c1421406cd 100644
--- a/tools/xm-test/configure.ac
+++ b/tools/xm-test/configure.ac
@@ -143,7 +143,6 @@ AC_CONFIG_FILES([
tests/unpause/Makefile
tests/vcpu-pin/Makefile
tests/vcpu-disable/Makefile
- tests/vtpm/Makefile
tests/xapi/Makefile
tests/enforce_dom0_cpus/Makefile
tests/cpupool/Makefile
diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
index f0516b2949..e04591b44e 100644
--- a/tools/xm-test/grouptest/default
+++ b/tools/xm-test/grouptest/default
@@ -27,5 +27,4 @@ sysrq
unpause
vcpu-disable
vcpu-pin
-vtpm
xapi
diff --git a/tools/xm-test/grouptest/medium b/tools/xm-test/grouptest/medium
index bafc988903..5c3e1b16e3 100644
--- a/tools/xm-test/grouptest/medium
+++ b/tools/xm-test/grouptest/medium
@@ -22,4 +22,3 @@ sysrq 01_sysrq_basic_neg.test 02_sysrq_sync_pos.test
unpause
vcpu-disable
vcpu-pin
-vtpm
diff --git a/tools/xm-test/grouptest/xapi b/tools/xm-test/grouptest/xapi
index 3b049219dd..7a08b7786a 100644
--- a/tools/xm-test/grouptest/xapi
+++ b/tools/xm-test/grouptest/xapi
@@ -1,2 +1 @@
xapi
-vtpm 09_vtpm-xapi.test
diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py
index ae8c550c48..3ba7433e2b 100644
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -59,7 +59,6 @@ class XenConfig:
# These options need to be lists
self.defaultOpts["disk"] = []
self.defaultOpts["vif"] = []
- self.defaultOpts["vtpm"] = []
self.opts = self.defaultOpts
diff --git a/tools/xm-test/tests/Makefile.am b/tools/xm-test/tests/Makefile.am
index 8d673ed525..455f50cf09 100644
--- a/tools/xm-test/tests/Makefile.am
+++ b/tools/xm-test/tests/Makefile.am
@@ -25,7 +25,6 @@ SUBDIRS = \
unpause \
vcpu-disable \
vcpu-pin \
- vtpm \
enforce_dom0_cpus \
save restore migrate \
cpupool
diff --git a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
deleted file mode 100644
index dfd1227a00..0000000000
--- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# verify list
-
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-
-try:
- domain.start(noConsole=True)
-except DomainError, e:
- if verbose:
- print e.extra
- 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:
- FAIL("xm vtpm-list returned bad status, expected 0, status is %i" % status)
-elif where < 0:
- FAIL("Fail to list virtual TPM device")
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
deleted file mode 100644
index a18cbab2f7..0000000000
--- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# check list of pcrs
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-domain.closeConsole()
-
-domain.stop()
-
-if not re.search("PCR-00:",run["output"]):
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
diff --git a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
deleted file mode 100644
index b863f27494..0000000000
--- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# check list of pcrs; suspend and resume the domain and
-# check list of pcrs again
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm save %s %s.save" %
- (domName, domName),
- timeout=30)
-
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm save did not succeed")
-
- try:
- status, ouptut = traceCommand("xm restore %s.save" %
- (domName),
- timeout=30)
- except TimeoutError, e:
- os.remove("%s.save" % domName)
- saveLog(consoleHistory)
- FAIL(str(e))
-
- os.remove("%s.save" % domName)
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm restore did not succeed")
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
deleted file mode 100644
index ccc8b73782..0000000000
--- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# check list of pcrs; locally migrate the domain and
-# check list of pcrs again
-# This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm migrate -l %s localhost" %
- domName,
- timeout=90)
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm migrate did not succeed. External device migration activated?")
-
-
- domName = domain.getName()
- new_domid = domid(domName)
-
- if (old_domid == new_domid):
- FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
- (old_domid,loop))
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py b/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
deleted file mode 100644
index 57b87dfda8..0000000000
--- a/tools/xm-test/tests/vtpm/05_vtpm-loc_migr.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# check list of pcrs; locally migrate the domain and
-# check list of pcrs again
-# This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm migrate %s localhost" %
- domName,
- timeout=90)
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm migrate did not succeed. External device migration activated?")
-
-
- domName = domain.getName()
- new_domid = domid(domName)
-
- if (old_domid == new_domid):
- FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
- (old_domid,loop))
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
deleted file mode 100644
index c70691d8e7..0000000000
--- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# extend a pcr
-# check list of pcrs; suspend and resume the domain and
-# check list of pcrs again and validate extended pcr
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while creating /dev/tpm0")
-
-try:
- run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while extending PCR 0")
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm save %s %s.save" %
- (domName, domName),
- timeout=30)
-
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm save did not succeed")
-
- try:
- status, ouptut = traceCommand("xm restore %s.save" %
- (domName),
- timeout=30)
- except TimeoutError, e:
- os.remove("%s.save" % domName)
- saveLog(consoleHistory)
- FAIL(str(e))
-
- os.remove("%s.save" % domName)
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm restore did not succeed")
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
-
diff --git a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
deleted file mode 100644
index 4ff33600a0..0000000000
--- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# extend a pcr
-# check list of pcrs; locally migrate the domain and
-# check list of pcrs again and validate extended pcr
-# This test does local live migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while creating /dev/tpm0")
-
-try:
- run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while extending PCR 0")
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm migrate -l %s localhost" %
- domName,
- timeout=90)
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm migrate did not succeed. External device migration activated?")
-
-
- domName = domain.getName()
- new_domid = domid(domName)
-
- if (old_domid == new_domid):
- FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
- (old_domid,loop))
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
deleted file mode 100644
index 27125fca44..0000000000
--- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Positive Test: create domain with virtual TPM attached at build time,
-# extend a pcr
-# check list of pcrs; locally migrate the domain and
-# check list of pcrs again and validate extended pcr
-# This test does local (non-live) migration.
-
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-import os.path
-import atexit
-
-config = {"vtpm":"instance=1,backend=0"}
-domain = XmTestDomain(extraConfig=config)
-domName = domain.getName()
-consoleHistory = ""
-
-try:
- console = domain.start()
-except DomainError, e:
- if verbose:
- print e.extra
- FAIL("Unable to create domain (%s)" % domName)
-
-atexit.register(vtpm_cleanup, vtpm_get_uuid(domid(domName)))
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("mknod /dev/tpm0 c 10 224")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while creating /dev/tpm0")
-
-try:
- run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("Error while extending PCR 0")
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Extend did not lead to expected result (1E A7 BD ...): \n%s" % run["output"])
-
-consoleHistory = console.getHistory()
-domain.closeConsole()
-
-old_domid = domid(domName)
-
-loop = 0
-while loop < 3:
- try:
- status, ouptut = traceCommand("xm migrate %s localhost" %
- domName,
- timeout=90)
- except TimeoutError, e:
- saveLog(consoleHistory)
- FAIL(str(e))
-
- if status != 0:
- saveLog(consoleHistory)
- FAIL("xm migrate did not succeed. External device migration activated?")
-
-
- domName = domain.getName()
- new_domid = domid(domName)
-
- if (old_domid == new_domid):
- FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
- (old_domid,loop))
-
- try:
- console = domain.getConsole()
- except ConsoleError, e:
- FAIL(str(e))
-
- try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
- except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("No result from dumping the PCRs")
-
- if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM is not working correctly on /dev/vtpm on backend side")
-
- if not re.search("PCR-00: 1E A7 BD",run["output"]):
- saveLog(console.getHistory())
- FAIL("Virtual TPM lost PCR 0 value: \n%s" % run["output"])
-
- loop += 1
-
-domain.closeConsole()
-
-domain.stop()
diff --git a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
deleted file mode 100644
index a1aa8b3c70..0000000000
--- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) International Business Machines Corp., 2006
-# Author: Stefan Berger <stefanb@us.ibm.com>
-
-# Test to test the vtpm class through the Xen-API
-#
-# Tested methods:
-# VTPM: get_uuid, get_backend, get_by_uuid, get_record
-# create, destroy, get_VM
-# VM: get_VTPMS
-
-from XmTestLib import xapi
-from XmTestLib.XenAPIDomain import XmTestAPIDomain
-from XmTestLib import *
-from vtpm_utils import *
-import commands
-import os
-
-VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid', 'other_config' ]
-
-try:
- # XmTestAPIDomain tries to establish a connection to XenD
- domain = XmTestAPIDomain()
-except Exception, e:
- SKIP("Skipping test. Error: %s" % str(e))
-vm_uuid = domain.get_uuid()
-
-vtpmcfg = {}
-vtpmcfg['backend'] = DOM0_UUID
-vtpmcfg['VM'] = vm_uuid
-
-session = xapi.connect()
-
-vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
-
-vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
-if vtpm_be != vtpmcfg['backend']:
- FAIL("vTPM's backend is in '%s', expected: '%s'" %
- (vtpm_be, vtpmcfg['backend']))
-
-vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
-
-miss_keys = []
-for k in VTPM_RECORD_KEYS:
- if k not in vtpm_rec.keys():
- miss_keys.append(k)
-if len(miss_keys) > 0:
- FAIL("vTPM record is missing key(s): %s" % miss_keys)
-
-if vtpm_rec['uuid'] != vtpm_uuid:
- FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
- (vtpm_rec['uuid'], vtpm_uuid))
-if vtpm_rec['VM'] != vm_uuid:
- FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
- (vtpm_rec['VM'], vm_uuid))
-if vtpm_rec['backend'] != vtpmcfg['backend']:
- FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
- (vtpm_rev['backend'], vtpmcfg['backend']))
-
-badkeys = []
-keys = vtpm_rec.keys()
-for k in keys:
- if k not in VTPM_RECORD_KEYS:
- badkeys.append(k)
-if len(badkeys) > 0:
- FAIL("Unexpected attributes in result: %s" % badkeys)
-
-if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
- FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
- (vm_ref, vm_uuid))
-
-uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
-if uuid != vtpm_uuid:
- FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
- (uuid, vtpm_uuid))
-
-vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
-if vtpm_ref != vtpm_uuid:
- FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
- (vtpm_ref, vtpm_uuid))
-
-vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
-if len(vm_vtpms) != 1:
- FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
- (len(vm_vtpms), 1))
-if vtpm_uuid not in vm_vtpms:
- FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
- (vm_vtpms[0], vtpm_uuid))
-
-try:
- console = domain.start()
-except DomainError, e:
- FAIL("Unable to create domain.")
-
-try:
- console.sendInput("input")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("1. No result from dumping the PCRs")
-
-if re.search("No such file",run["output"]):
- FAIL("TPM frontend support not compiled into (domU?) kernel")
-
-if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-try:
- session.xenapi.VTPM.destroy(vtpm_uuid)
- #Should never get here
- FAIL("Could destroy vTPM while VM is running")
-except:
- pass
-
-rc = session.xenapi.VM.suspend(vm_uuid)
-if rc:
- FAIL("Could not suspend VM")
-
-try:
- session.xenapi.VTPM.destroy(vtpm_uuid)
- #May not throw an exception in 'suspend' state
-except:
- pass
-
-rc = session.xenapi.VM.resume(vm_uuid, False)
-if rc:
- FAIL("Could not resume VM")
-
-try:
- console = domain.getConsole()
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
-except ConsoleError, e:
- saveLog(console.getHistory())
- FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
-
-if not re.search("PCR-00:",run["output"]):
- saveLog(console.getHistory())
- FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
-
-domain.stop()
-
-try:
- session.xenapi.VTPM.destroy(vtpm_uuid)
-except:
- FAIL("Could NOT destroy vTPM while domain is halted.")
-
-domain.destroy()
diff --git a/tools/xm-test/tests/vtpm/Makefile.am b/tools/xm-test/tests/vtpm/Makefile.am
deleted file mode 100644
index dd67e459ec..0000000000
--- a/tools/xm-test/tests/vtpm/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-SUBDIRS =
-
-TESTS = 01_vtpm-list_pos.test \
- 02_vtpm-cat_pcrs.test \
- 03_vtpm-susp_res.test \
- 04_vtpm-loc_migr.test \
- 05_vtpm-loc_migr.test \
- 06_vtpm-susp_res_pcrs.test \
- 07_vtpm-mig_pcrs.test \
- 08_vtpm-mig_pcrs.test \
- 09_vtpm-xapi.test
-
-XFAIL_TESTS =
-
-EXTRA_DIST = $(TESTS) $(XFAIL_TESTS) vtpm_utils.py
-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 --git a/tools/xm-test/tests/vtpm/vtpm_utils.py b/tools/xm-test/tests/vtpm/vtpm_utils.py
deleted file mode 100644
index 4e5b281bb8..0000000000
--- a/tools/xm-test/tests/vtpm/vtpm_utils.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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")
-
-status, output = traceCommand("COLUMNS=200 ; "
- "ps aux | grep vtpm_manager | grep -v grep")
-if output == "":
- SKIP("virtual TPM manager must be started to run this test; might "
- "need /dev/tpm0")
-
-def vtpm_cleanup(domName):
- traceCommand("/etc/xen/scripts/vtpm-delete "
- "`xenstore-read /local/domain/0/backend/vtpm/%s/0/uuid`" %
- str(domid(domName)))
-
-def vtpm_cleanup(uuid):
- from xen.xm import main
- if main.serverType != main.SERVER_XEN_API:
- traceCommand("/etc/xen/scripts/vtpm-delete %s" % uuid)
-
-def vtpm_get_uuid(domainid):
- s, o = traceCommand("xenstore-read "
- "/local/domain/0/backend/vtpm/%s/0/uuid" % domainid)
- return o