# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID bef7f5fcf207b97f74eeb2e68fa00a81e3a81f85
# Parent 47dede68bbeddc66ba75209fac74fa595fb27662
Second step toward a new network infrastructure, move XmConsole to be
in XenDomain. The devices we will add, like network, will need to run
console commands when a domain is started. So I have made console be
a part of domain object, which it's tied to anyway.
Signed-off-by: Daniel Stekloff <dsteklof@xxxxxxxxxx>
---
tools/xm-test/lib/XmTestLib/Console.py
| 17 +++-
tools/xm-test/lib/XmTestLib/Test.py
| 3
tools/xm-test/lib/XmTestLib/XenDomain.py
| 38 +++++++++-
tools/xm-test/tests/_sanity/01_domu_proc.py
| 4 -
tools/xm-test/tests/block-create/01_block_attach_device_pos.py
| 12 ---
tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py
| 14 +--
tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py
| 13 ---
tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py
| 13 ---
tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py
| 13 ---
tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py
| 13 ---
tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py
| 13 ---
tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py
| 13 ---
tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py
| 7 -
tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py
| 12 ---
tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py
| 2
tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py
| 6 -
tools/xm-test/tests/block-list/01_block-list_pos.py
| 10 --
tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py
| 10 --
tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py
| 10 --
tools/xm-test/tests/block-list/04_block-list_nodb_pos.py
| 2
tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py
| 9 --
tools/xm-test/tests/create/01_create_basic_pos.py
| 18 +---
tools/xm-test/tests/create/04_create_conflictname_neg.py
| 4 -
tools/xm-test/tests/create/06_create_mem_neg.py
| 4 -
tools/xm-test/tests/create/07_create_mem64_pos.py
| 2
tools/xm-test/tests/create/08_create_mem128_pos.py
| 2
tools/xm-test/tests/create/09_create_mem256_pos.py
| 2
tools/xm-test/tests/create/10_create_fastdestroy.py
| 2
tools/xm-test/tests/create/11_create_concurrent_pos.py
| 4 -
tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
| 9 --
tools/xm-test/tests/create/13_create_multinic_pos.py
| 4 -
tools/xm-test/tests/create/14_create_blockroot_pos.py
| 8 --
tools/xm-test/tests/create/15_create_smallmem_pos.py
| 4 -
tools/xm-test/tests/create/16_create_smallmem_neg.py
| 4 -
tools/xm-test/tests/destroy/01_destroy_basic_pos.py
| 12 ---
tools/xm-test/tests/destroy/05_destroy_byid_pos.py
| 5 -
tools/xm-test/tests/destroy/07_destroy_stale_pos.py
| 5 -
tools/xm-test/tests/list/04_list_goodparm_pos.py
| 10 --
tools/xm-test/tests/memset/01_memset_basic_pos.py
| 7 -
tools/xm-test/tests/memset/03_memset_random_pos.py
| 2
tools/xm-test/tests/memset/04_memset_smallmem_pos.py
| 4 -
tools/xm-test/tests/migrate/01_migrate_localhost_pos.py
| 17 +---
tools/xm-test/tests/network-attach/01_network_attach_pos.py
| 12 ---
tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py
| 12 ---
tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
| 15 ---
tools/xm-test/tests/network/02_network_local_ping_pos.py
| 12 ---
tools/xm-test/tests/network/03_network_local_tcp_pos.py
| 12 ---
tools/xm-test/tests/network/04_network_local_udp_pos.py
| 12 ---
tools/xm-test/tests/network/05_network_dom0_ping_pos.py
| 11 --
tools/xm-test/tests/network/06_network_dom0_tcp_pos.py
| 11 --
tools/xm-test/tests/network/07_network_dom0_udp_pos.py
| 11 --
tools/xm-test/tests/network/11_network_domU_ping_pos.py
| 9 --
tools/xm-test/tests/network/12_network_domU_tcp_pos.py
| 9 --
tools/xm-test/tests/network/13_network_domU_udp_pos.py
| 9 --
tools/xm-test/tests/pause/01_pause_basic_pos.py
| 17 +---
tools/xm-test/tests/pause/02_pause_badopt_neg.py
| 2
tools/xm-test/tests/reboot/01_reboot_basic_pos.py
| 13 +--
tools/xm-test/tests/reboot/02_reboot_badopt_neg.py
| 2
tools/xm-test/tests/restore/01_restore_basic_pos.py
| 10 +-
tools/xm-test/tests/restore/04_restore_withdevices_pos.py
| 9 --
tools/xm-test/tests/save/01_save_basic_pos.py
| 10 --
tools/xm-test/tests/save/03_save_bogusfile_neg.py
| 10 --
tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py
| 2
tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py
| 2
tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py
| 2
tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py
| 2
tools/xm-test/tests/sedf/05_sedf_extratime_pos.py
| 2
tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py
| 2
tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py
| 12 ---
tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py
| 2
tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py
| 13 ---
tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py
| 8 --
tools/xm-test/tests/unpause/01_unpause_basic_pos.py
| 16 +---
tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py
| 2
tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py
| 2
tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
| 2
tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
| 10 --
tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
| 25 ++----
tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
| 20 ++---
79 files changed, 210 insertions(+), 485 deletions(-)
diff -r 47dede68bbed -r bef7f5fcf207 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/lib/XmTestLib/Console.py Thu May 04 14:22:17 2006 +0100
@@ -234,11 +234,14 @@ class XmConsole:
"return": 0,
}
- def closeConsole(self):
+ def __closeConsole(self):
"""Closes the console connection and ensures that the console
- process is killed"""
- os.close(self.consoleFd)
- os.kill(self.consolePid, 2)
+ process is killed. This should only be called by the domain.
+ Tests should call domain.closeConsole()"""
+ if self.consolePid != 0:
+ os.close(self.consoleFd)
+ os.kill(self.consolePid, 2)
+ self.consolePid = 0
def setLimit(self, limit):
@@ -249,6 +252,10 @@ class XmConsole:
self.limit = int(limit)
except Exception, e:
self.limit = None
+
+ def setHistorySaveCmds(self, value):
+ # True or False
+ self.historySaveCmds = value
if __name__ == "__main__":
@@ -272,7 +279,7 @@ if __name__ == "__main__":
print "Console failed (%)" % str(e)
sys.exit(255)
- t.closeConsole()
+ t._XmConsole__closeConsole()
print run["output"],
sys.exit(run["return"])
diff -r 47dede68bbed -r bef7f5fcf207 tools/xm-test/lib/XmTestLib/Test.py
--- a/tools/xm-test/lib/XmTestLib/Test.py Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/lib/XmTestLib/Test.py Thu May 04 14:22:17 2006 +0100
@@ -173,8 +173,7 @@ def isConsoleDead():
domain = XmTestDomain()
try:
- domain.start()
- console = XmConsole(domain.getName())
+ console = domain.start()
console.runCmd("ls")
except DomainError, e:
return True
diff -r 47dede68bbed -r bef7f5fcf207 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py Thu May 04 14:22:17 2006 +0100
@@ -27,6 +27,7 @@ from Xm import *
from Xm import *
from Test import *
from config import *
+from Console import *
BLOCK_ROOT_DEV = "hda"
@@ -193,6 +194,8 @@ class XenDomain:
self.name = getUniqueName()
self.config = config
+ self.console = None
+
# Set domain type, either PV for ParaVirt domU or HVM for
# FullVirt domain
if ENABLE_HVM_SUPPORT:
@@ -200,7 +203,7 @@ class XenDomain:
else:
self.type = "PV"
- def start(self):
+ def start(self, noConsole=False):
ret, output = traceCommand("xm create %s" % self.config)
@@ -213,10 +216,22 @@ class XenDomain:
if self.getDomainType() == "HVM":
waitForBoot()
+ if self.console and noConsole == True:
+ self.closeConsole()
+
+ elif self.console and noConsole == False:
+ return self.console
+
+ elif not self.console and noConsole == False:
+ return self.getConsole()
+
def stop(self):
prog = "xm"
cmd = " shutdown "
+ if self.console:
+ self.closeConsole()
+
ret, output = traceCommand(prog + cmd + self.config.getOpt("name"))
return ret
@@ -225,6 +240,9 @@ class XenDomain:
prog = "xm"
cmd = " destroy "
+ if self.console:
+ self.closeConsole()
+
ret, output = traceCommand(prog + cmd + self.config.getOpt("name"))
return ret
@@ -237,6 +255,24 @@ class XenDomain:
def getDomainType(self):
return self.type
+
+ def closeConsole(self):
+ # The domain closeConsole command must be called by tests, not the
+ # console's close command. Once close is called, the console is
+ # gone. You can't get history or anything else from it.
+ if self.console:
+ self.console._XmConsole__closeConsole()
+ self.console = None
+
+ def getConsole(self):
+ if self.console:
+ self.closeConsole()
+
+ self.console = XmConsole(self.getName())
+ # Activate the console
+ self.console.sendInput("input")
+
+ return self.console
class XmTestDomain(XenDomain):
diff -r 47dede68bbed -r bef7f5fcf207 tools/xm-test/tests/_sanity/01_domu_proc.py
--- a/tools/xm-test/tests/_sanity/01_domu_proc.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/_sanity/01_domu_proc.py Thu May 04 14:22:17
2006 +0100
@@ -15,13 +15,11 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL(str(e))
try:
- console = XmConsole(domain.getName())
- console.sendInput("foo")
run = console.runCmd("cat /proc/cpuinfo")
except ConsoleError, e:
FAIL(str(e))
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/01_block_attach_device_pos.py
--- a/tools/xm-test/tests/block-create/01_block_attach_device_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-create/01_block_attach_device_pos.py Thu May
04 14:22:17 2006 +0100
@@ -16,7 +16,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
@@ -25,13 +25,7 @@ except DomainError, e:
# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -49,7 +43,7 @@ except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py
--- a/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py
Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -16,22 +16,16 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
+# Set console to save commands and make sure we can run cmds
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -49,7 +43,7 @@ except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py
--- a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py
Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -16,22 +16,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -49,7 +42,7 @@ for i in range(10):
FAIL("Device is not actually attached to domU")
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py
---
a/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py
Thu May 04 14:20:11 2006 +0100
+++
b/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -16,22 +16,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -57,7 +50,7 @@ for i in range(10):
FAIL("Failed to dettach block device: /proc/partitions still
showing that!")
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py
--- a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py Thu May
04 14:22:17 2006 +0100
@@ -16,22 +16,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -53,7 +46,7 @@ except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py
--- a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py
Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py
Thu May 04 14:22:17 2006 +0100
@@ -16,22 +16,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -52,7 +45,7 @@ except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py
---
a/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py
Thu May 04 14:20:11 2006 +0100
+++
b/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -16,22 +16,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -72,7 +65,7 @@ for i in range(10):
FAIL("Failed to dettach block device: /proc/partitions still
showing that!")
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py
---
a/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py
Thu May 04 14:20:11 2006 +0100
+++
b/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py
Thu May 04 14:22:17 2006 +0100
@@ -53,22 +53,15 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -103,7 +96,7 @@ while i < ramdisks or devices:
FAIL(msg)
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py
--- a/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py Thu May
04 14:22:17 2006 +0100
@@ -12,15 +12,14 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
FAIL("Unable to create domain")
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- console.sendInput("input")
+ console.setHistorySaveCmds(value=True)
run = console.runCmd("cat /proc/partitions | grep hda1")
run2 = console.runCmd("cat /proc/partitions")
except ConsoleError, e:
@@ -41,7 +40,7 @@ except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
domain.stop()
if run["return"] == 0:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py
--- a/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py Thu May
04 14:22:17 2006 +0100
@@ -11,7 +11,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -23,12 +23,6 @@ if status != 0:
pass
try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- console.sendInput("input")
run = console.runCmd("cat /proc/partitions | grep hda1")
except ConsoleError, e:
saveLog(console.getHistory())
@@ -47,7 +41,7 @@ except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
+domain.stop()
+
if run["return"] == 0:
FAIL("block-detach failed to detach block device")
-
-
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py
--- a/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py
Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py
Thu May 04 14:22:17 2006 +0100
@@ -13,7 +13,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print e.extra
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py
--- a/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py Thu May
04 14:22:17 2006 +0100
@@ -12,15 +12,13 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
FAIL("Unable to create domain")
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- console.sendInput("input")
run = console.runCmd("cat /proc/partitions | grep hda1")
run2 = console.runCmd("cat /proc/partitions")
except ConsoleError, e:
@@ -41,7 +39,7 @@ except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
domain.stop()
if run["return"] == 0:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-list/01_block-list_pos.py
--- a/tools/xm-test/tests/block-list/01_block-list_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-list/01_block-list_pos.py Thu May 04
14:22:17 2006 +0100
@@ -15,7 +15,7 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -31,16 +31,12 @@ elif where < 0:
#Verify the block device on DomainU
try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- console.sendInput("input")
run = console.runCmd("cat /proc/partitions | grep hda1")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
+domain.stop()
+
if run["return"] != 0:
FAIL("Failed to verify that block dev is attached on DomainU")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py
--- a/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py Thu May
04 14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -36,16 +36,12 @@ elif where < 0 :
#Verify attached block device on DomainU
try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- console.sendInput("input")
run = console.runCmd("cat /proc/partitions | grep hda1")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
+domain.stop()
+
if run["return"] != 0:
FAIL("Failed to verify that block dev is attached on DomainU")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py
--- a/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py Thu May
04 14:22:17 2006 +0100
@@ -15,7 +15,7 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -43,16 +43,12 @@ elif (where1 < 0) and (where2 < 0):
#Verify attached block device on DomainU
try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- console.sendInput("input")
run = console.runCmd("cat /proc/partitions | grep hda1;cat
/proc/partitions | grep hda2")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
+domain.stop()
+
if run["return"] != 0:
FAIL("Failed to verify that block dev is attached on DomainU")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-list/04_block-list_nodb_pos.py
--- a/tools/xm-test/tests/block-list/04_block-list_nodb_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-list/04_block-list_nodb_pos.py Thu May 04
14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print e.extra
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py
--- a/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py Thu May
04 14:22:17 2006 +0100
@@ -11,13 +11,8 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
- FAIL(str(e))
-
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
FAIL(str(e))
s, o = traceCommand("xm block-list %s" % domain.getName())
@@ -72,4 +67,4 @@ if o:
if o:
FAIL("block-list still shows something after all devices detached!")
-
+domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/01_create_basic_pos.py
--- a/tools/xm-test/tests/create/01_create_basic_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/create/01_create_basic_pos.py Thu May 04 14:22:17
2006 +0100
@@ -18,36 +18,28 @@ if int(getInfo("free_memory")) < domain.
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
+
+# Save a transcript for human review
+saveLog(console.getHistory())
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
-
-# Save a transcript for human review
-saveLog(console.getHistory())
# Check the output of 'ls'
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/04_create_conflictname_neg.py
--- a/tools/xm-test/tests/create/04_create_conflictname_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/04_create_conflictname_neg.py Thu May 04
14:22:17 2006 +0100
@@ -17,7 +17,7 @@ domain1 = XmTestDomain("default")
#start it
try:
- domain1.start()
+ domain1.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain1 because:"
@@ -30,7 +30,7 @@ domain2 = XmTestDomain("default")
#start it
eyecatcher = "Pass"
try:
- domain2.start()
+ domain2.start(noConsole=True)
except DomainError, e:
eyecatcher = "Fail"
# Stop the domain1 (nice shutdown)
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/06_create_mem_neg.py
--- a/tools/xm-test/tests/create/06_create_mem_neg.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/create/06_create_mem_neg.py Thu May 04 14:22:17
2006 +0100
@@ -23,7 +23,7 @@ domain1=XmTestDomain(extraConfig=config1
domain1=XmTestDomain(extraConfig=config1)
try:
- domain1.start()
+ domain1.start(noConsole=True)
eyecatcher1 = "Created"
except DomainError, e:
eyecatcher1 = "Fail"
@@ -42,7 +42,7 @@ domain2=XmTestDomain(extraConfig=config2
domain2=XmTestDomain(extraConfig=config2)
try:
- domain2.start()
+ domain2.start(noConsole=True)
eyecatcher2 = "Created"
except DomainError, e:
eyecatcher2 = "Fail"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/07_create_mem64_pos.py
--- a/tools/xm-test/tests/create/07_create_mem64_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/create/07_create_mem64_pos.py Thu May 04 14:22:17
2006 +0100
@@ -28,7 +28,7 @@ domain_mem64=XmTestDomain(extraConfig=co
#start it
try:
- domain_mem64.start()
+ domain_mem64.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain_mem64 because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/08_create_mem128_pos.py
--- a/tools/xm-test/tests/create/08_create_mem128_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/08_create_mem128_pos.py Thu May 04
14:22:17 2006 +0100
@@ -28,7 +28,7 @@ domain_mem128=XmTestDomain(extraConfig=c
#start it
try:
- domain_mem128.start()
+ domain_mem128.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain_mem128 because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/09_create_mem256_pos.py
--- a/tools/xm-test/tests/create/09_create_mem256_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/09_create_mem256_pos.py Thu May 04
14:22:17 2006 +0100
@@ -28,7 +28,7 @@ domain_mem256=XmTestDomain(extraConfig=c
#start it
try:
- domain_mem256.start()
+ domain_mem256.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain_mem256 because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/10_create_fastdestroy.py
--- a/tools/xm-test/tests/create/10_create_fastdestroy.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/10_create_fastdestroy.py Thu May 04
14:22:17 2006 +0100
@@ -28,7 +28,7 @@ for i in range(0,50):
for i in range(0,50):
domain = XmTestDomain("testdomain")
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError,e:
print "Failed: " + e.extra
NSPerror = check_for_NSP_error(e.extra)
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/11_create_concurrent_pos.py
--- a/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu May 04
14:22:17 2006 +0100
@@ -43,15 +43,13 @@ for d in range(0, NUM_DOMS):
extraConfig={"memory":MEM_PER_DOM})
try:
- dom.start()
+ cons = dom.start()
except DomainError, e:
if verbose:
print str(e)
FAIL("[%i] Failed to create domain" % d)
try:
- cons = XmConsole(dom.getName())
- cons.sendInput("foo")
cons.runCmd("ls")
except ConsoleError, e:
FAIL("[%i] Failed to attach console to %s" % (d, dom.getName()))
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
--- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu May
04 14:22:17 2006 +0100
@@ -17,17 +17,11 @@ for i in range(0,DOMS):
dom = XmTestDomain(extraConfig={"memory" : MEM})
try:
- dom.start()
+ cons = dom.start()
except DomainError, e:
if verbose:
print str(e)
FAIL("Failed to start %s" % dom.getName())
-
- try:
- cons = XmConsole(dom.getName())
- cons.sendInput("foo")
- except ConsoleError, e:
- FAIL(str(e))
if verbose:
print "[%i/%i] Started %s" % (i, DOMS, dom.getName())
@@ -56,4 +50,3 @@ for d, c in domains:
if run["return"] != 0:
FAIL("Domain %s didn't survive!" % d.getName())
-
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/13_create_multinic_pos.py
--- a/tools/xm-test/tests/create/13_create_multinic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/13_create_multinic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -18,13 +18,11 @@ for i in range(0,MAX_NICS):
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL("(%i nics) " % i + str(e))
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
console.runCmd("ls")
except ConsoleError, e:
FAIL("(%i nics) Console didn't respond: probably crashed!" % i)
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/14_create_blockroot_pos.py
--- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu May 04
14:22:17 2006 +0100
@@ -31,20 +31,14 @@ else:
domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL(str(e))
#waitForBoot()
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
# console.debugMe = True
- console.sendInput("foo")
run = console.runCmd("ls")
except ConsoleError, e:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/15_create_smallmem_pos.py
--- a/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu May 04
14:22:17 2006 +0100
@@ -12,13 +12,11 @@ domain = XmTestDomain(extraConfig={"memo
"extra" :"mem=%iM" % MEM})
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL("Unable to start a domain with %i MB" % MEM)
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
console.runCmd("ls")
except ConsoleError, e:
if e.reason == RUNAWAY:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/create/16_create_smallmem_neg.py
--- a/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu May 04
14:22:17 2006 +0100
@@ -13,13 +13,11 @@ domain = XmTestDomain(extraConfig={"memo
"extra" :"mem=%iM" % MEM})
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL("Unable to start a domain with %i MB" % MEM)
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
console.runCmd("ls")
except ConsoleError, e:
if e.reason == RUNAWAY:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/destroy/01_destroy_basic_pos.py
--- a/tools/xm-test/tests/destroy/01_destroy_basic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/destroy/01_destroy_basic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -14,29 +14,21 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("foo")
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Check the output of 'ls'
if not re.search("proc", run["output"]):
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/destroy/05_destroy_byid_pos.py
--- a/tools/xm-test/tests/destroy/05_destroy_byid_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/destroy/05_destroy_byid_pos.py Thu May 04
14:22:17 2006 +0100
@@ -7,8 +7,7 @@
# Positive Test:
# Test Description:
# 1. Create a domain
-# 2. Attach a console to the domain.
-# 3. Destroy the domain by id
+# 2. Destroy the domain by id
import sys
import re
@@ -21,7 +20,7 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/destroy/07_destroy_stale_pos.py
--- a/tools/xm-test/tests/destroy/07_destroy_stale_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/destroy/07_destroy_stale_pos.py Thu May 04
14:22:17 2006 +0100
@@ -108,14 +108,11 @@ def runTests(tests):
# Create a domain
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL(str(e))
- # Attach a console and make sure it's live
try:
- console = XmConsole(domain.getName())
- console.sendInput("foo")
console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/list/04_list_goodparm_pos.py
--- a/tools/xm-test/tests/list/04_list_goodparm_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/list/04_list_goodparm_pos.py Thu May 04 14:22:17
2006 +0100
@@ -12,23 +12,17 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-
status, output = traceCommand("xm list %s" % domain.getName())
if status != 0:
FAIL("`xm list %s' failed with invalid status %i != 0" %
(domain.getName(), status))
-console.closeConsole()
+domain.closeConsole()
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/memset/01_memset_basic_pos.py
--- a/tools/xm-test/tests/memset/01_memset_basic_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/memset/01_memset_basic_pos.py Thu May 04 14:22:17
2006 +0100
@@ -28,17 +28,14 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
# Make sure it's up an running before we continue
console.runCmd("ls")
except ConsoleError, e:
@@ -96,7 +93,7 @@ if domUmem != newmem:
# quiesce everything
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/memset/03_memset_random_pos.py
--- a/tools/xm-test/tests/memset/03_memset_random_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/memset/03_memset_random_pos.py Thu May 04
14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to start domain:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/memset/04_memset_smallmem_pos.py
--- a/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Thu May 04
14:22:17 2006 +0100
@@ -11,7 +11,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to start domain: "
@@ -19,8 +19,6 @@ except DomainError, e:
FAIL(str(e))
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
# Make sure it's alive before we proceed
console.runCmd("ls")
except ConsoleError, e:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/migrate/01_migrate_localhost_pos.py
--- a/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py Thu May 04
14:22:17 2006 +0100
@@ -25,29 +25,21 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("foo")
# Set a variable to check on the other side
run = console.runCmd("foo=bar")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
old_domid = domid(domain.getName())
@@ -68,11 +60,12 @@ if (old_domid == new_domid):
# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
+ console = domain.getConsole()
console.debugMe = True
except ConsoleError, e:
pass
+console.setHistorySaveCmds(value=True)
console.sendInput("ls")
# Run 'ls'
@@ -86,7 +79,7 @@ if not re.search("bar", run["output"]):
FAIL("Migrated domain has been reset")
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network-attach/01_network_attach_pos.py
--- a/tools/xm-test/tests/network-attach/01_network_attach_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network-attach/01_network_attach_pos.py Thu May
04 14:22:17 2006 +0100
@@ -15,22 +15,14 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -45,7 +37,7 @@ if status:
##
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py
--- a/tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py
Thu May 04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -17,22 +17,14 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("input")
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -51,7 +43,7 @@ if status:
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
---
a/tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
Thu May 04 14:20:11 2006 +0100
+++
b/tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
Thu May 04 14:22:17 2006 +0100
@@ -17,25 +17,16 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
-try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- # network-detach is crashing, so we enable console debugging
- # for now, so that reports include the oops
- console.debugMe = True
-except ConsoleError, e:
- FAIL(str(e))
+console.debugMe = True
try:
- # Activate the console
- console.sendInput("input")
# Run 'ls'
run = console.runCmd("ls")
except ConsoleError, e:
@@ -54,7 +45,7 @@ for i in range(10):
FAIL(msg)
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/02_network_local_ping_pos.py
--- a/tools/xm-test/tests/network/02_network_local_ping_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/02_network_local_ping_pos.py Thu May 04
14:22:17 2006 +0100
@@ -35,24 +35,14 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-
-# Attach a console
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("bhs")
-
# Bring up the "lo" interface.
console.runCmd("ifconfig lo 127.0.0.1")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/03_network_local_tcp_pos.py
--- a/tools/xm-test/tests/network/03_network_local_tcp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/03_network_local_tcp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -40,24 +40,14 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-
-# Attach a console
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("bhs")
-
# Bring up the "lo" interface.
console.runCmd("ifconfig lo 127.0.0.1")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/04_network_local_udp_pos.py
--- a/tools/xm-test/tests/network/04_network_local_udp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/04_network_local_udp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -39,24 +39,14 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-
-# Attach a console
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("bhs")
-
# Bring up the "lo" interface.
console.runCmd("ifconfig lo 127.0.0.1")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/05_network_dom0_ping_pos.py
--- a/tools/xm-test/tests/network/05_network_dom0_ping_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/05_network_dom0_ping_pos.py Thu May 04
14:22:17 2006 +0100
@@ -40,20 +40,11 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
-
-
-# Attach a console
-try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
-except ConsoleError, e:
FAIL(str(e))
try:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/06_network_dom0_tcp_pos.py
--- a/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -40,20 +40,11 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
-
-
-# Attach a console
-try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
-except ConsoleError, e:
FAIL(str(e))
try:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/07_network_dom0_udp_pos.py
--- a/tools/xm-test/tests/network/07_network_dom0_udp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/07_network_dom0_udp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -40,20 +40,11 @@ else:
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
-
-
-# Attach a console
-try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
-except ConsoleError, e:
FAIL(str(e))
try:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/11_network_domU_ping_pos.py
--- a/tools/xm-test/tests/network/11_network_domU_ping_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/11_network_domU_ping_pos.py Thu May 04
14:22:17 2006 +0100
@@ -25,18 +25,11 @@ def netDomain(ip):
dom = XmTestDomain(extraConfig=config)
try:
- dom.start()
+ console = dom.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
- try:
- # Attach a console
- console = XmConsole(dom.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
- except ConsoleError, e:
FAIL(str(e))
return console
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/12_network_domU_tcp_pos.py
--- a/tools/xm-test/tests/network/12_network_domU_tcp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/12_network_domU_tcp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -25,18 +25,11 @@ def netDomain(ip):
dom = XmTestDomain(extraConfig=config)
try:
- dom.start()
+ console = dom.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
- try:
- # Attach a console
- console = XmConsole(dom.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
- except ConsoleError, e:
FAIL(str(e))
return console
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/network/13_network_domU_udp_pos.py
--- a/tools/xm-test/tests/network/13_network_domU_udp_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/network/13_network_domU_udp_pos.py Thu May 04
14:22:17 2006 +0100
@@ -25,18 +25,11 @@ def netDomain(ip):
dom = XmTestDomain(extraConfig=config)
try:
- dom.start()
+ console = dom.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
- FAIL(str(e))
- try:
- # Attach a console
- console = XmConsole(dom.getName(), historySaveCmds=True)
- # Activate the console
- console.sendInput("bhs")
- except ConsoleError, e:
FAIL(str(e))
return console
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/pause/01_pause_basic_pos.py
--- a/tools/xm-test/tests/pause/01_pause_basic_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/pause/01_pause_basic_pos.py Thu May 04 14:22:17
2006 +0100
@@ -20,29 +20,21 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("foo")
# Make sure a command succeeds
run = console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Pause the domain
status, output = traceCommand("xm pause %s" % domain.getName())
@@ -51,7 +43,8 @@ if status != 0:
# Try to attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
+ console = domain.getConsole()
+ console.setHistorySaveCmds(value=True)
run = console.runCmd("ls")
#If we get here, console attached to paused domain (unexpected)
FAIL("console attached to supposedly paused domain")
@@ -59,7 +52,7 @@ except ConsoleError, e:
pass
# Close the console
-console.closeConsole()
+domain.closeConsole()
status, output = traceCommand("xm unpause %s" % domain.getName())
if status != 0:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/pause/02_pause_badopt_neg.py
--- a/tools/xm-test/tests/pause/02_pause_badopt_neg.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/pause/02_pause_badopt_neg.py Thu May 04 14:22:17
2006 +0100
@@ -11,7 +11,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/reboot/01_reboot_basic_pos.py
--- a/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Thu May 04 14:22:17
2006 +0100
@@ -11,19 +11,14 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-console.closeConsole()
+domain.closeConsole()
status, output = traceCommand("xm reboot %s" % domain.getName())
@@ -33,7 +28,7 @@ time.sleep(15)
time.sleep(15)
try:
- console = XmConsole(domain.getName())
+ console = domain.getConsole()
except ConsoleError, e:
FAIL(str(e))
@@ -43,7 +38,7 @@ except ConsoleError, e:
except ConsoleError, e:
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
domain.destroy()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/reboot/02_reboot_badopt_neg.py
--- a/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py Thu May 04
14:22:17 2006 +0100
@@ -11,7 +11,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/restore/01_restore_basic_pos.py
--- a/tools/xm-test/tests/restore/01_restore_basic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/restore/01_restore_basic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -18,7 +18,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
@@ -27,13 +27,11 @@ except DomainError, e:
# Make sure the domain isn't DOA
try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
console.runCmd("foo=bar")
except ConsoleError, e:
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
# Save it out
try:
@@ -67,7 +65,7 @@ if not isDomainRunning(domain.getName())
# Make sure it's alive
try:
- newConsole = XmConsole(domain.getName())
+ newConsole = domain.getConsole()
# Enable debug dumping because this generates a Oops on x86_64
newConsole.debugMe = True
newConsole.sendInput("ls")
@@ -77,7 +75,7 @@ except ConsoleError, e:
except ConsoleError, e:
FAIL("Restored domain is dead (%s)" % str(e))
-newConsole.closeConsole()
+domain.closeConsole()
# This only works because the domain
# still has the same name
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/restore/04_restore_withdevices_pos.py
--- a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu May 04
14:22:17 2006 +0100
@@ -23,14 +23,11 @@ if s != 0:
FAIL("Unable to mke2fs /dev/ram1 in dom0")
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
FAIL(str(e))
try:
- console = XmConsole(domain.getName())
- console.sendInput("foo")
-
run = console.runCmd("mkdir /mnt/a /mnt/b")
if run["return"] != 0:
FAIL("Unable to mkdir /mnt/a /mnt/b")
@@ -67,7 +64,7 @@ except ConsoleError, e:
except ConsoleError, e:
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
try:
s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(),
@@ -91,7 +88,7 @@ if s != 0:
FAIL("xm restore exited with %i != 0" % s)
try:
- console = XmConsole(domain.getName())
+ console = domain.getConsole()
# Enable debug dumping, as this causes an Oops on x86_64
console.debugMe = True
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/save/01_save_basic_pos.py
--- a/tools/xm-test/tests/save/01_save_basic_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/save/01_save_basic_pos.py Thu May 04 14:22:17
2006 +0100
@@ -13,20 +13,14 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Make sure the domain isn't DOA
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-console.closeConsole()
+domain.closeConsole()
# Save it out
try:
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/save/03_save_bogusfile_neg.py
--- a/tools/xm-test/tests/save/03_save_bogusfile_neg.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/save/03_save_bogusfile_neg.py Thu May 04 14:22:17
2006 +0100
@@ -16,20 +16,14 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Make sure the domain isn't DOA
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- FAIL(str(e))
-
-console.closeConsole()
+domain.closeConsole()
# Save it out
status, output = traceCommand("xm save %s /NOWHERE/test.state" %
domain.getName())
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py
--- a/tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py Thu May 04
14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py
--- a/tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py Thu May 04
14:22:17 2006 +0100
@@ -16,7 +16,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py
--- a/tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py Thu May 04
14:22:17 2006 +0100
@@ -16,7 +16,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py
--- a/tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py Thu May 04
14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/05_sedf_extratime_pos.py
--- a/tools/xm-test/tests/sedf/05_sedf_extratime_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/sedf/05_sedf_extratime_pos.py Thu May 04 14:22:17
2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py
--- a/tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py Thu May 04
14:22:17 2006 +0100
@@ -14,7 +14,7 @@ domain = XmTestDomain(extraConfig = {"sc
domain = XmTestDomain(extraConfig = {"sched":"sedf"})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py
--- a/tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -19,29 +19,21 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("foo")
# Make sure a command succeeds
run = console.runCmd("ls /bin")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
status, output = traceCommand("xm shutdown %s" % domain.getName())
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py
--- a/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py Thu May 04
14:22:17 2006 +0100
@@ -20,7 +20,7 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py
--- a/tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py Thu May 04 14:22:17
2006 +0100
@@ -17,19 +17,12 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-
-# Attach a console to it
-try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
status, output = traceCommand("xm sysrq %s s" % domain.getName())
@@ -40,15 +33,13 @@ if status != 0:
# Run 'ls'
try:
- # Activate the console
- console.sendInput("foo")
# Check the dmesg output on the domU
run = console.runCmd("dmesg | grep Emerg\n")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
# Stop the domain (nice shutdown)
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py
--- a/tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py Thu May 04
14:22:17 2006 +0100
@@ -13,7 +13,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create domain:"
@@ -27,12 +27,6 @@ if status != 0:
# Wait for the reboot to finish
time.sleep(20)
-try:
- console = XmConsole(domain.getName())
- console.sendInput("input")
-except ConsoleError, e:
- FAIL(str(e))
-
status, output = traceCommand("xm sysrq %s s" % domain.getName())
if status != 0:
FAIL("sysrq failed with %i != 0" % status)
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/unpause/01_unpause_basic_pos.py
--- a/tools/xm-test/tests/unpause/01_unpause_basic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/unpause/01_unpause_basic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -22,29 +22,21 @@ domain = XmTestDomain()
# Start it
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
print e.extra
FAIL(str(e))
-# Attach a console to it
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
-except ConsoleError, e:
- FAIL(str(e))
-
-try:
- # Activate the console
- console.sendInput("foo")
# Make sure a command succeeds
run = console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
seed(time.time())
@@ -69,13 +61,13 @@ if status != 0:
# Are we still alive after all that?
try:
- console = XmConsole(domain.getName(), historySaveCmds=True)
+ console = domain.getConsole()
run = console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
# Close the console
-console.closeConsole()
+domain.closeConsole()
if run["return"] != 0:
FAIL("console failed to attach to supposedly unpaused domain")
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py
--- a/tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py Thu May
04 14:20:11 2006 +0100
+++ b/tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py Thu May
04 14:22:17 2006 +0100
@@ -42,7 +42,7 @@ domain = XmTestDomain(extraConfig={"vcpu
domain = XmTestDomain(extraConfig={"vcpus":2})
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py
--- a/tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py Thu May 04
14:20:11 2006 +0100
+++ b/tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py Thu May 04
14:22:17 2006 +0100
@@ -20,7 +20,7 @@ domain = XmTestDomain()
domain = XmTestDomain()
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print "Failed to create test domain because:"
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vtpm/01_vtpm-list_pos.py
--- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Thu May 04 14:22:17
2006 +0100
@@ -16,7 +16,7 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ domain.start(noConsole=True)
except DomainError, e:
if verbose:
print e.extra
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py
--- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Thu May 04 14:22:17
2006 +0100
@@ -16,7 +16,7 @@ domain = XmTestDomain(extraConfig=config
domain = XmTestDomain(extraConfig=config)
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -24,12 +24,6 @@ except DomainError, e:
FAIL("Unable to create domain")
domName = domain.getName()
-
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- vtpm_cleanup(domName)
- FAIL(str(e))
try:
console.sendInput("input")
@@ -49,7 +43,7 @@ if re.search("No such file",run["output"
vtpm_cleanup(domName)
FAIL("TPM frontend support not compiled into (domU?) kernel")
-console.closeConsole()
+domain.closeConsole()
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vtpm/03_vtpm-susp_res.py
--- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py Thu May 04 14:22:17
2006 +0100
@@ -15,9 +15,10 @@ import os.path
config = {"vtpm":"instance=1,backend=0"}
domain = XmTestDomain(extraConfig=config)
+consoleHistory = ""
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -25,12 +26,6 @@ except DomainError, e:
FAIL("Unable to create domain")
domName = domain.getName()
-
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- vtpm_cleanup(domName)
- FAIL(str(e))
try:
console.sendInput("input")
@@ -50,19 +45,21 @@ if re.search("No such file",run["output"
vtpm_cleanup(domName)
FAIL("TPM frontend support not compiled into (domU?) kernel")
-console.closeConsole()
+consoleHistory = console.getHistory()
+domain.closeConsole()
try:
status, ouptut = traceCommand("xm save %s %s.save" %
(domName, domName),
timeout=30)
+
except TimeoutError, e:
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL(str(e))
if status != 0:
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL("xm save did not succeed")
@@ -72,19 +69,19 @@ try:
timeout=30)
except TimeoutError, e:
os.remove("%s.save" % domName)
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL(str(e))
os.remove("%s.save" % domName)
if status != 0:
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL("xm restore did not succeed")
try:
- console = XmConsole(domain.getName())
+ console = domain.getConsole()
except ConsoleError, e:
vtpm_cleanup(domName)
FAIL(str(e))
@@ -96,7 +93,7 @@ except ConsoleError, e:
vtpm_cleanup(domName)
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
domain.stop()
diff -r 47dede68bbed -r bef7f5fcf207
tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py
--- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py Thu May 04 14:20:11
2006 +0100
+++ b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py Thu May 04 14:22:17
2006 +0100
@@ -15,9 +15,10 @@ import os.path
config = {"vtpm":"instance=1,backend=0"}
domain = XmTestDomain(extraConfig=config)
+consoleHistory = ""
try:
- domain.start()
+ console = domain.start()
except DomainError, e:
if verbose:
print e.extra
@@ -25,12 +26,6 @@ except DomainError, e:
FAIL("Unable to create domain")
domName = domain.getName()
-
-try:
- console = XmConsole(domain.getName())
-except ConsoleError, e:
- vtpm_cleanup(domName)
- FAIL(str(e))
try:
console.sendInput("input")
@@ -50,7 +45,8 @@ if re.search("No such file",run["output"
vtpm_cleanup(domName)
FAIL("TPM frontend support not compiled into (domU?) kernel")
-console.closeConsole()
+consoleHistory = console.getHistory()
+domain.closeConsole()
old_domid = domid(domName)
@@ -59,12 +55,12 @@ try:
domName,
timeout=90)
except TimeoutError, e:
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL(str(e))
if status != 0:
- saveLog(console.getHistory())
+ saveLog(consoleHistory)
vtpm_cleanup(domName)
FAIL("xm migrate did not succeed. External device migration activated?")
@@ -77,7 +73,7 @@ if (old_domid == new_domid):
FAIL("xm migrate failed, domain id is still %s" % old_domid)
try:
- console = XmConsole(domain.getName())
+ console = domain.getConsole()
except ConsoleError, e:
vtpm_cleanup(domName)
FAIL(str(e))
@@ -89,7 +85,7 @@ except ConsoleError, e:
vtpm_cleanup(domName)
FAIL(str(e))
-console.closeConsole()
+domain.closeConsole()
domain.stop()
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|