ia64/xen-unstable
changeset 9936:bef7f5fcf207
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@us.ibm.com>
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@us.ibm.com>
line diff
1.1 --- a/tools/xm-test/lib/XmTestLib/Console.py Thu May 04 14:20:11 2006 +0100 1.2 +++ b/tools/xm-test/lib/XmTestLib/Console.py Thu May 04 14:22:17 2006 +0100 1.3 @@ -234,11 +234,14 @@ class XmConsole: 1.4 "return": 0, 1.5 } 1.6 1.7 - def closeConsole(self): 1.8 + def __closeConsole(self): 1.9 """Closes the console connection and ensures that the console 1.10 - process is killed""" 1.11 - os.close(self.consoleFd) 1.12 - os.kill(self.consolePid, 2) 1.13 + process is killed. This should only be called by the domain. 1.14 + Tests should call domain.closeConsole()""" 1.15 + if self.consolePid != 0: 1.16 + os.close(self.consoleFd) 1.17 + os.kill(self.consolePid, 2) 1.18 + self.consolePid = 0 1.19 1.20 1.21 def setLimit(self, limit): 1.22 @@ -249,6 +252,10 @@ class XmConsole: 1.23 self.limit = int(limit) 1.24 except Exception, e: 1.25 self.limit = None 1.26 + 1.27 + def setHistorySaveCmds(self, value): 1.28 + # True or False 1.29 + self.historySaveCmds = value 1.30 1.31 1.32 if __name__ == "__main__": 1.33 @@ -272,7 +279,7 @@ if __name__ == "__main__": 1.34 print "Console failed (%)" % str(e) 1.35 sys.exit(255) 1.36 1.37 - t.closeConsole() 1.38 + t._XmConsole__closeConsole() 1.39 1.40 print run["output"], 1.41 sys.exit(run["return"])
2.1 --- a/tools/xm-test/lib/XmTestLib/Test.py Thu May 04 14:20:11 2006 +0100 2.2 +++ b/tools/xm-test/lib/XmTestLib/Test.py Thu May 04 14:22:17 2006 +0100 2.3 @@ -173,8 +173,7 @@ def isConsoleDead(): 2.4 domain = XmTestDomain() 2.5 2.6 try: 2.7 - domain.start() 2.8 - console = XmConsole(domain.getName()) 2.9 + console = domain.start() 2.10 console.runCmd("ls") 2.11 except DomainError, e: 2.12 return True
3.1 --- a/tools/xm-test/lib/XmTestLib/XenDomain.py Thu May 04 14:20:11 2006 +0100 3.2 +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py Thu May 04 14:22:17 2006 +0100 3.3 @@ -27,6 +27,7 @@ import time 3.4 from Xm import * 3.5 from Test import * 3.6 from config import * 3.7 +from Console import * 3.8 3.9 BLOCK_ROOT_DEV = "hda" 3.10 3.11 @@ -193,6 +194,8 @@ class XenDomain: 3.12 self.name = getUniqueName() 3.13 3.14 self.config = config 3.15 + self.console = None 3.16 + 3.17 # Set domain type, either PV for ParaVirt domU or HVM for 3.18 # FullVirt domain 3.19 if ENABLE_HVM_SUPPORT: 3.20 @@ -200,7 +203,7 @@ class XenDomain: 3.21 else: 3.22 self.type = "PV" 3.23 3.24 - def start(self): 3.25 + def start(self, noConsole=False): 3.26 3.27 ret, output = traceCommand("xm create %s" % self.config) 3.28 3.29 @@ -213,10 +216,22 @@ class XenDomain: 3.30 if self.getDomainType() == "HVM": 3.31 waitForBoot() 3.32 3.33 + if self.console and noConsole == True: 3.34 + self.closeConsole() 3.35 + 3.36 + elif self.console and noConsole == False: 3.37 + return self.console 3.38 + 3.39 + elif not self.console and noConsole == False: 3.40 + return self.getConsole() 3.41 + 3.42 def stop(self): 3.43 prog = "xm" 3.44 cmd = " shutdown " 3.45 3.46 + if self.console: 3.47 + self.closeConsole() 3.48 + 3.49 ret, output = traceCommand(prog + cmd + self.config.getOpt("name")) 3.50 3.51 return ret 3.52 @@ -225,6 +240,9 @@ class XenDomain: 3.53 prog = "xm" 3.54 cmd = " destroy " 3.55 3.56 + if self.console: 3.57 + self.closeConsole() 3.58 + 3.59 ret, output = traceCommand(prog + cmd + self.config.getOpt("name")) 3.60 3.61 return ret 3.62 @@ -238,6 +256,24 @@ class XenDomain: 3.63 def getDomainType(self): 3.64 return self.type 3.65 3.66 + def closeConsole(self): 3.67 + # The domain closeConsole command must be called by tests, not the 3.68 + # console's close command. Once close is called, the console is 3.69 + # gone. You can't get history or anything else from it. 3.70 + if self.console: 3.71 + self.console._XmConsole__closeConsole() 3.72 + self.console = None 3.73 + 3.74 + def getConsole(self): 3.75 + if self.console: 3.76 + self.closeConsole() 3.77 + 3.78 + self.console = XmConsole(self.getName()) 3.79 + # Activate the console 3.80 + self.console.sendInput("input") 3.81 + 3.82 + return self.console 3.83 + 3.84 3.85 class XmTestDomain(XenDomain): 3.86
4.1 --- a/tools/xm-test/tests/_sanity/01_domu_proc.py Thu May 04 14:20:11 2006 +0100 4.2 +++ b/tools/xm-test/tests/_sanity/01_domu_proc.py Thu May 04 14:22:17 2006 +0100 4.3 @@ -15,13 +15,11 @@ import re 4.4 domain = XmTestDomain() 4.5 4.6 try: 4.7 - domain.start() 4.8 + console = domain.start() 4.9 except DomainError, e: 4.10 FAIL(str(e)) 4.11 4.12 try: 4.13 - console = XmConsole(domain.getName()) 4.14 - console.sendInput("foo") 4.15 run = console.runCmd("cat /proc/cpuinfo") 4.16 except ConsoleError, e: 4.17 FAIL(str(e))
5.1 --- a/tools/xm-test/tests/block-create/01_block_attach_device_pos.py Thu May 04 14:20:11 2006 +0100 5.2 +++ b/tools/xm-test/tests/block-create/01_block_attach_device_pos.py Thu May 04 14:22:17 2006 +0100 5.3 @@ -16,7 +16,7 @@ if ENABLE_HVM_SUPPORT: 5.4 domain = XmTestDomain() 5.5 5.6 try: 5.7 - domain.start() 5.8 + console = domain.start() 5.9 except DomainError, e: 5.10 if verbose: 5.11 print "Failed to create test domain because:" 5.12 @@ -25,13 +25,7 @@ except DomainError, e: 5.13 5.14 # Attach a console to it 5.15 try: 5.16 - console = XmConsole(domain.getName(), historySaveCmds=True) 5.17 -except ConsoleError, e: 5.18 - FAIL(str(e)) 5.19 - 5.20 -try: 5.21 - # Activate the console 5.22 - console.sendInput("input") 5.23 + console.setHistorySaveCmds(value=True) 5.24 # Run 'ls' 5.25 run = console.runCmd("ls") 5.26 except ConsoleError, e: 5.27 @@ -49,7 +43,7 @@ except ConsoleError, e: 5.28 FAIL(str(e)) 5.29 5.30 # Close the console 5.31 -console.closeConsole() 5.32 +domain.closeConsole() 5.33 5.34 # Stop the domain (nice shutdown) 5.35 domain.stop()
6.1 --- a/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py Thu May 04 14:20:11 2006 +0100 6.2 +++ b/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py Thu May 04 14:22:17 2006 +0100 6.3 @@ -16,22 +16,16 @@ if ENABLE_HVM_SUPPORT: 6.4 domain = XmTestDomain() 6.5 6.6 try: 6.7 - domain.start() 6.8 + console = domain.start() 6.9 except DomainError, e: 6.10 if verbose: 6.11 print "Failed to create test domain because:" 6.12 print e.extra 6.13 FAIL(str(e)) 6.14 6.15 -# Attach a console to it 6.16 +# Set console to save commands and make sure we can run cmds 6.17 try: 6.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 6.19 -except ConsoleError, e: 6.20 - FAIL(str(e)) 6.21 - 6.22 -try: 6.23 - # Activate the console 6.24 - console.sendInput("input") 6.25 + console.setHistorySaveCmds(value=True) 6.26 # Run 'ls' 6.27 run = console.runCmd("ls") 6.28 except ConsoleError, e: 6.29 @@ -49,7 +43,7 @@ except ConsoleError, e: 6.30 FAIL(str(e)) 6.31 6.32 # Close the console 6.33 -console.closeConsole() 6.34 +domain.closeConsole() 6.35 6.36 # Stop the domain (nice shutdown) 6.37 domain.stop()
7.1 --- a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py Thu May 04 14:20:11 2006 +0100 7.2 +++ b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py Thu May 04 14:22:17 2006 +0100 7.3 @@ -16,22 +16,15 @@ if ENABLE_HVM_SUPPORT: 7.4 domain = XmTestDomain() 7.5 7.6 try: 7.7 - domain.start() 7.8 + console = domain.start() 7.9 except DomainError, e: 7.10 if verbose: 7.11 print "Failed to create test domain because:" 7.12 print e.extra 7.13 FAIL(str(e)) 7.14 7.15 -# Attach a console to it 7.16 try: 7.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 7.18 -except ConsoleError, e: 7.19 - FAIL(str(e)) 7.20 - 7.21 -try: 7.22 - # Activate the console 7.23 - console.sendInput("input") 7.24 + console.setHistorySaveCmds(value=True) 7.25 # Run 'ls' 7.26 run = console.runCmd("ls") 7.27 except ConsoleError, e: 7.28 @@ -49,7 +42,7 @@ for i in range(10): 7.29 FAIL("Device is not actually attached to domU") 7.30 7.31 # Close the console 7.32 -console.closeConsole() 7.33 +domain.closeConsole() 7.34 7.35 # Stop the domain (nice shutdown) 7.36 domain.stop()
8.1 --- a/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py Thu May 04 14:20:11 2006 +0100 8.2 +++ b/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py Thu May 04 14:22:17 2006 +0100 8.3 @@ -16,22 +16,15 @@ if ENABLE_HVM_SUPPORT: 8.4 domain = XmTestDomain() 8.5 8.6 try: 8.7 - domain.start() 8.8 + console = domain.start() 8.9 except DomainError, e: 8.10 if verbose: 8.11 print "Failed to create test domain because:" 8.12 print e.extra 8.13 FAIL(str(e)) 8.14 8.15 -# Attach a console to it 8.16 try: 8.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 8.18 -except ConsoleError, e: 8.19 - FAIL(str(e)) 8.20 - 8.21 -try: 8.22 - # Activate the console 8.23 - console.sendInput("input") 8.24 + console.setHistorySaveCmds(value=True) 8.25 # Run 'ls' 8.26 run = console.runCmd("ls") 8.27 except ConsoleError, e: 8.28 @@ -57,7 +50,7 @@ for i in range(10): 8.29 FAIL("Failed to dettach block device: /proc/partitions still showing that!") 8.30 8.31 # Close the console 8.32 -console.closeConsole() 8.33 +domain.closeConsole() 8.34 8.35 # Stop the domain (nice shutdown) 8.36 domain.stop()
9.1 --- a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py Thu May 04 14:20:11 2006 +0100 9.2 +++ b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py Thu May 04 14:22:17 2006 +0100 9.3 @@ -16,22 +16,15 @@ if ENABLE_HVM_SUPPORT: 9.4 domain = XmTestDomain() 9.5 9.6 try: 9.7 - domain.start() 9.8 + console = domain.start() 9.9 except DomainError, e: 9.10 if verbose: 9.11 print "Failed to create test domain because:" 9.12 print e.extra 9.13 FAIL(str(e)) 9.14 9.15 -# Attach a console to it 9.16 try: 9.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 9.18 -except ConsoleError, e: 9.19 - FAIL(str(e)) 9.20 - 9.21 -try: 9.22 - # Activate the console 9.23 - console.sendInput("input") 9.24 + console.setHistorySaveCmds(value=True) 9.25 # Run 'ls' 9.26 run = console.runCmd("ls") 9.27 except ConsoleError, e: 9.28 @@ -53,7 +46,7 @@ except ConsoleError, e: 9.29 FAIL(str(e)) 9.30 9.31 # Close the console 9.32 -console.closeConsole() 9.33 +domain.closeConsole() 9.34 9.35 # Stop the domain (nice shutdown) 9.36 domain.stop()
10.1 --- a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py Thu May 04 14:20:11 2006 +0100 10.2 +++ b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py Thu May 04 14:22:17 2006 +0100 10.3 @@ -16,22 +16,15 @@ if ENABLE_HVM_SUPPORT: 10.4 domain = XmTestDomain() 10.5 10.6 try: 10.7 - domain.start() 10.8 + console = domain.start() 10.9 except DomainError, e: 10.10 if verbose: 10.11 print "Failed to create test domain because:" 10.12 print e.extra 10.13 FAIL(str(e)) 10.14 10.15 -# Attach a console to it 10.16 try: 10.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 10.18 -except ConsoleError, e: 10.19 - FAIL(str(e)) 10.20 - 10.21 -try: 10.22 - # Activate the console 10.23 - console.sendInput("input") 10.24 + console.setHistorySaveCmds(value=True) 10.25 # Run 'ls' 10.26 run = console.runCmd("ls") 10.27 except ConsoleError, e: 10.28 @@ -52,7 +45,7 @@ except ConsoleError, e: 10.29 FAIL(str(e)) 10.30 10.31 # Close the console 10.32 -console.closeConsole() 10.33 +domain.closeConsole() 10.34 10.35 # Stop the domain (nice shutdown) 10.36 domain.stop()
11.1 --- 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 11.2 +++ 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 11.3 @@ -16,22 +16,15 @@ if ENABLE_HVM_SUPPORT: 11.4 domain = XmTestDomain() 11.5 11.6 try: 11.7 - domain.start() 11.8 + console = domain.start() 11.9 except DomainError, e: 11.10 if verbose: 11.11 print "Failed to create test domain because:" 11.12 print e.extra 11.13 FAIL(str(e)) 11.14 11.15 -# Attach a console to it 11.16 try: 11.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 11.18 -except ConsoleError, e: 11.19 - FAIL(str(e)) 11.20 - 11.21 -try: 11.22 - # Activate the console 11.23 - console.sendInput("input") 11.24 + console.setHistorySaveCmds(value=True) 11.25 # Run 'ls' 11.26 run = console.runCmd("ls") 11.27 except ConsoleError, e: 11.28 @@ -72,7 +65,7 @@ for i in range(10): 11.29 FAIL("Failed to dettach block device: /proc/partitions still showing that!") 11.30 11.31 # Close the console 11.32 -console.closeConsole() 11.33 +domain.closeConsole() 11.34 11.35 # Stop the domain (nice shutdown) 11.36 domain.stop()
12.1 --- a/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py Thu May 04 14:20:11 2006 +0100 12.2 +++ b/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py Thu May 04 14:22:17 2006 +0100 12.3 @@ -53,22 +53,15 @@ if ENABLE_HVM_SUPPORT: 12.4 domain = XmTestDomain() 12.5 12.6 try: 12.7 - domain.start() 12.8 + console = domain.start() 12.9 except DomainError, e: 12.10 if verbose: 12.11 print "Failed to create test domain because:" 12.12 print e.extra 12.13 FAIL(str(e)) 12.14 12.15 -# Attach a console to it 12.16 try: 12.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 12.18 -except ConsoleError, e: 12.19 - FAIL(str(e)) 12.20 - 12.21 -try: 12.22 - # Activate the console 12.23 - console.sendInput("input") 12.24 + console.setHistorySaveCmds(value=True) 12.25 # Run 'ls' 12.26 run = console.runCmd("ls") 12.27 except ConsoleError, e: 12.28 @@ -103,7 +96,7 @@ while i < ramdisks or devices: 12.29 FAIL(msg) 12.30 12.31 # Close the console 12.32 -console.closeConsole() 12.33 +domain.closeConsole() 12.34 12.35 # Stop the domain (nice shutdown) 12.36 domain.stop()
13.1 --- a/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py Thu May 04 14:20:11 2006 +0100 13.2 +++ b/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py Thu May 04 14:22:17 2006 +0100 13.3 @@ -12,15 +12,14 @@ config = {"disk":"phy:/dev/ram0,hda1,w"} 13.4 domain = XmTestDomain(extraConfig=config) 13.5 13.6 try: 13.7 - domain.start() 13.8 + console = domain.start() 13.9 except DomainError, e: 13.10 if verbose: 13.11 print e.extra 13.12 FAIL("Unable to create domain") 13.13 13.14 try: 13.15 - console = XmConsole(domain.getName(), historySaveCmds=True) 13.16 - console.sendInput("input") 13.17 + console.setHistorySaveCmds(value=True) 13.18 run = console.runCmd("cat /proc/partitions | grep hda1") 13.19 run2 = console.runCmd("cat /proc/partitions") 13.20 except ConsoleError, e: 13.21 @@ -41,7 +40,7 @@ except ConsoleError, e: 13.22 saveLog(console.getHistory()) 13.23 FAIL(str(e)) 13.24 13.25 -console.closeConsole() 13.26 +domain.closeConsole() 13.27 domain.stop() 13.28 13.29 if run["return"] == 0:
14.1 --- a/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py Thu May 04 14:20:11 2006 +0100 14.2 +++ b/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py Thu May 04 14:22:17 2006 +0100 14.3 @@ -11,7 +11,7 @@ if ENABLE_HVM_SUPPORT: 14.4 domain = XmTestDomain() 14.5 14.6 try: 14.7 - domain.start() 14.8 + console = domain.start() 14.9 except DomainError, e: 14.10 if verbose: 14.11 print e.extra 14.12 @@ -23,12 +23,6 @@ if status != 0: 14.13 pass 14.14 14.15 try: 14.16 - console = XmConsole(domain.getName()) 14.17 -except ConsoleError, e: 14.18 - FAIL(str(e)) 14.19 - 14.20 -try: 14.21 - console.sendInput("input") 14.22 run = console.runCmd("cat /proc/partitions | grep hda1") 14.23 except ConsoleError, e: 14.24 saveLog(console.getHistory()) 14.25 @@ -47,7 +41,7 @@ except ConsoleError, e: 14.26 saveLog(console.getHistory()) 14.27 FAIL(str(e)) 14.28 14.29 +domain.stop() 14.30 + 14.31 if run["return"] == 0: 14.32 FAIL("block-detach failed to detach block device") 14.33 - 14.34 -
15.1 --- a/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py Thu May 04 14:20:11 2006 +0100 15.2 +++ b/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py Thu May 04 14:22:17 2006 +0100 15.3 @@ -13,7 +13,7 @@ if ENABLE_HVM_SUPPORT: 15.4 domain = XmTestDomain() 15.5 15.6 try: 15.7 - domain.start() 15.8 + domain.start(noConsole=True) 15.9 except DomainError, e: 15.10 if verbose: 15.11 print e.extra
16.1 --- a/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py Thu May 04 14:20:11 2006 +0100 16.2 +++ b/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py Thu May 04 14:22:17 2006 +0100 16.3 @@ -12,15 +12,13 @@ config = {"disk":"phy:/dev/ram0,hda1,w"} 16.4 domain = XmTestDomain(extraConfig=config) 16.5 16.6 try: 16.7 - domain.start() 16.8 + console = domain.start() 16.9 except DomainError, e: 16.10 if verbose: 16.11 print e.extra 16.12 FAIL("Unable to create domain") 16.13 16.14 try: 16.15 - console = XmConsole(domain.getName(), historySaveCmds=True) 16.16 - console.sendInput("input") 16.17 run = console.runCmd("cat /proc/partitions | grep hda1") 16.18 run2 = console.runCmd("cat /proc/partitions") 16.19 except ConsoleError, e: 16.20 @@ -41,7 +39,7 @@ except ConsoleError, e: 16.21 saveLog(console.getHistory()) 16.22 FAIL(str(e)) 16.23 16.24 -console.closeConsole() 16.25 +domain.closeConsole() 16.26 domain.stop() 16.27 16.28 if run["return"] == 0:
17.1 --- a/tools/xm-test/tests/block-list/01_block-list_pos.py Thu May 04 14:20:11 2006 +0100 17.2 +++ b/tools/xm-test/tests/block-list/01_block-list_pos.py Thu May 04 14:22:17 2006 +0100 17.3 @@ -15,7 +15,7 @@ config = {"disk":"phy:/dev/ram0,hda1,w"} 17.4 domain = XmTestDomain(extraConfig=config) 17.5 17.6 try: 17.7 - domain.start() 17.8 + console = domain.start() 17.9 except DomainError, e: 17.10 if verbose: 17.11 print e.extra 17.12 @@ -31,16 +31,12 @@ elif where < 0: 17.13 17.14 #Verify the block device on DomainU 17.15 try: 17.16 - console = XmConsole(domain.getName()) 17.17 -except ConsoleError, e: 17.18 - FAIL(str(e)) 17.19 - 17.20 -try: 17.21 - console.sendInput("input") 17.22 run = console.runCmd("cat /proc/partitions | grep hda1") 17.23 except ConsoleError, e: 17.24 saveLog(console.getHistory()) 17.25 FAIL(str(e)) 17.26 17.27 +domain.stop() 17.28 + 17.29 if run["return"] != 0: 17.30 FAIL("Failed to verify that block dev is attached on DomainU")
18.1 --- a/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py Thu May 04 14:20:11 2006 +0100 18.2 +++ b/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py Thu May 04 14:22:17 2006 +0100 18.3 @@ -14,7 +14,7 @@ if ENABLE_HVM_SUPPORT: 18.4 domain = XmTestDomain() 18.5 18.6 try: 18.7 - domain.start() 18.8 + console = domain.start() 18.9 except DomainError, e: 18.10 if verbose: 18.11 print e.extra 18.12 @@ -36,16 +36,12 @@ elif where < 0 : 18.13 18.14 #Verify attached block device on DomainU 18.15 try: 18.16 - console = XmConsole(domain.getName()) 18.17 -except ConsoleError, e: 18.18 - FAIL(str(e)) 18.19 - 18.20 -try: 18.21 - console.sendInput("input") 18.22 run = console.runCmd("cat /proc/partitions | grep hda1") 18.23 except ConsoleError, e: 18.24 saveLog(console.getHistory()) 18.25 FAIL(str(e)) 18.26 18.27 +domain.stop() 18.28 + 18.29 if run["return"] != 0: 18.30 FAIL("Failed to verify that block dev is attached on DomainU")
19.1 --- a/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py Thu May 04 14:20:11 2006 +0100 19.2 +++ b/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py Thu May 04 14:22:17 2006 +0100 19.3 @@ -15,7 +15,7 @@ config = {"disk":"phy:/dev/ram0,hda1,w"} 19.4 domain = XmTestDomain(extraConfig=config) 19.5 19.6 try: 19.7 - domain.start() 19.8 + console = domain.start() 19.9 except DomainError, e: 19.10 if verbose: 19.11 print e.extra 19.12 @@ -43,16 +43,12 @@ elif (where1 < 0) and (where2 < 0): 19.13 19.14 #Verify attached block device on DomainU 19.15 try: 19.16 - console = XmConsole(domain.getName()) 19.17 -except ConsoleError, e: 19.18 - FAIL(str(e)) 19.19 - 19.20 -try: 19.21 - console.sendInput("input") 19.22 run = console.runCmd("cat /proc/partitions | grep hda1;cat /proc/partitions | grep hda2") 19.23 except ConsoleError, e: 19.24 saveLog(console.getHistory()) 19.25 FAIL(str(e)) 19.26 19.27 +domain.stop() 19.28 + 19.29 if run["return"] != 0: 19.30 FAIL("Failed to verify that block dev is attached on DomainU")
20.1 --- a/tools/xm-test/tests/block-list/04_block-list_nodb_pos.py Thu May 04 14:20:11 2006 +0100 20.2 +++ b/tools/xm-test/tests/block-list/04_block-list_nodb_pos.py Thu May 04 14:22:17 2006 +0100 20.3 @@ -14,7 +14,7 @@ if ENABLE_HVM_SUPPORT: 20.4 domain = XmTestDomain() 20.5 20.6 try: 20.7 - domain.start() 20.8 + domain.start(noConsole=True) 20.9 except DomainError, e: 20.10 if verbose: 20.11 print e.extra
21.1 --- a/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py Thu May 04 14:20:11 2006 +0100 21.2 +++ b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py Thu May 04 14:22:17 2006 +0100 21.3 @@ -11,15 +11,10 @@ if ENABLE_HVM_SUPPORT: 21.4 domain = XmTestDomain() 21.5 21.6 try: 21.7 - domain.start() 21.8 + domain.start(noConsole=True) 21.9 except DomainError, e: 21.10 FAIL(str(e)) 21.11 21.12 -try: 21.13 - console = XmConsole(domain.getName()) 21.14 -except ConsoleError, e: 21.15 - FAIL(str(e)) 21.16 - 21.17 s, o = traceCommand("xm block-list %s" % domain.getName()) 21.18 if s != 0: 21.19 FAIL("block-list returned !0 when no devices attached") 21.20 @@ -72,4 +67,4 @@ if o.find("770") != -1: 21.21 if o: 21.22 FAIL("block-list still shows something after all devices detached!") 21.23 21.24 - 21.25 +domain.stop()
22.1 --- a/tools/xm-test/tests/create/01_create_basic_pos.py Thu May 04 14:20:11 2006 +0100 22.2 +++ b/tools/xm-test/tests/create/01_create_basic_pos.py Thu May 04 14:22:17 2006 +0100 22.3 @@ -18,37 +18,29 @@ if int(getInfo("free_memory")) < domain. 22.4 22.5 # Start it 22.6 try: 22.7 - domain.start() 22.8 + console = domain.start() 22.9 except DomainError, e: 22.10 if verbose: 22.11 print "Failed to create test domain because:" 22.12 print e.extra 22.13 FAIL(str(e)) 22.14 22.15 -# Attach a console to it 22.16 try: 22.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 22.18 -except ConsoleError, e: 22.19 - FAIL(str(e)) 22.20 - 22.21 -try: 22.22 - # Activate the console 22.23 - console.sendInput("input") 22.24 # Run 'ls' 22.25 run = console.runCmd("ls") 22.26 except ConsoleError, e: 22.27 saveLog(console.getHistory()) 22.28 FAIL(str(e)) 22.29 + 22.30 +# Save a transcript for human review 22.31 +saveLog(console.getHistory()) 22.32 22.33 # Close the console 22.34 -console.closeConsole() 22.35 +domain.closeConsole() 22.36 22.37 # Stop the domain (nice shutdown) 22.38 domain.stop() 22.39 22.40 -# Save a transcript for human review 22.41 -saveLog(console.getHistory()) 22.42 - 22.43 # Check the output of 'ls' 22.44 22.45 if not re.search("proc", run["output"]):
23.1 --- a/tools/xm-test/tests/create/04_create_conflictname_neg.py Thu May 04 14:20:11 2006 +0100 23.2 +++ b/tools/xm-test/tests/create/04_create_conflictname_neg.py Thu May 04 14:22:17 2006 +0100 23.3 @@ -17,7 +17,7 @@ domain1 = XmTestDomain("default") 23.4 23.5 #start it 23.6 try: 23.7 - domain1.start() 23.8 + domain1.start(noConsole=True) 23.9 except DomainError, e: 23.10 if verbose: 23.11 print "Failed to create test domain1 because:" 23.12 @@ -30,7 +30,7 @@ domain2 = XmTestDomain("default") 23.13 #start it 23.14 eyecatcher = "Pass" 23.15 try: 23.16 - domain2.start() 23.17 + domain2.start(noConsole=True) 23.18 except DomainError, e: 23.19 eyecatcher = "Fail" 23.20 # Stop the domain1 (nice shutdown)
24.1 --- a/tools/xm-test/tests/create/06_create_mem_neg.py Thu May 04 14:20:11 2006 +0100 24.2 +++ b/tools/xm-test/tests/create/06_create_mem_neg.py Thu May 04 14:22:17 2006 +0100 24.3 @@ -23,7 +23,7 @@ config1 = {"memory": 0} 24.4 domain1=XmTestDomain(extraConfig=config1) 24.5 24.6 try: 24.7 - domain1.start() 24.8 + domain1.start(noConsole=True) 24.9 eyecatcher1 = "Created" 24.10 except DomainError, e: 24.11 eyecatcher1 = "Fail" 24.12 @@ -42,7 +42,7 @@ config2 = {"memory": extreme_mem} 24.13 domain2=XmTestDomain(extraConfig=config2) 24.14 24.15 try: 24.16 - domain2.start() 24.17 + domain2.start(noConsole=True) 24.18 eyecatcher2 = "Created" 24.19 except DomainError, e: 24.20 eyecatcher2 = "Fail"
25.1 --- a/tools/xm-test/tests/create/07_create_mem64_pos.py Thu May 04 14:20:11 2006 +0100 25.2 +++ b/tools/xm-test/tests/create/07_create_mem64_pos.py Thu May 04 14:22:17 2006 +0100 25.3 @@ -28,7 +28,7 @@ domain_mem64=XmTestDomain(extraConfig=co 25.4 25.5 #start it 25.6 try: 25.7 - domain_mem64.start() 25.8 + domain_mem64.start(noConsole=True) 25.9 except DomainError, e: 25.10 if verbose: 25.11 print "Failed to create test domain_mem64 because:"
26.1 --- a/tools/xm-test/tests/create/08_create_mem128_pos.py Thu May 04 14:20:11 2006 +0100 26.2 +++ b/tools/xm-test/tests/create/08_create_mem128_pos.py Thu May 04 14:22:17 2006 +0100 26.3 @@ -28,7 +28,7 @@ domain_mem128=XmTestDomain(extraConfig=c 26.4 26.5 #start it 26.6 try: 26.7 - domain_mem128.start() 26.8 + domain_mem128.start(noConsole=True) 26.9 except DomainError, e: 26.10 if verbose: 26.11 print "Failed to create test domain_mem128 because:"
27.1 --- a/tools/xm-test/tests/create/09_create_mem256_pos.py Thu May 04 14:20:11 2006 +0100 27.2 +++ b/tools/xm-test/tests/create/09_create_mem256_pos.py Thu May 04 14:22:17 2006 +0100 27.3 @@ -28,7 +28,7 @@ domain_mem256=XmTestDomain(extraConfig=c 27.4 27.5 #start it 27.6 try: 27.7 - domain_mem256.start() 27.8 + domain_mem256.start(noConsole=True) 27.9 except DomainError, e: 27.10 if verbose: 27.11 print "Failed to create test domain_mem256 because:"
28.1 --- a/tools/xm-test/tests/create/10_create_fastdestroy.py Thu May 04 14:20:11 2006 +0100 28.2 +++ b/tools/xm-test/tests/create/10_create_fastdestroy.py Thu May 04 14:22:17 2006 +0100 28.3 @@ -28,7 +28,7 @@ i = 0 28.4 for i in range(0,50): 28.5 domain = XmTestDomain("testdomain") 28.6 try: 28.7 - domain.start() 28.8 + domain.start(noConsole=True) 28.9 except DomainError,e: 28.10 print "Failed: " + e.extra 28.11 NSPerror = check_for_NSP_error(e.extra)
29.1 --- a/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu May 04 14:20:11 2006 +0100 29.2 +++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu May 04 14:22:17 2006 +0100 29.3 @@ -43,15 +43,13 @@ for d in range(0, NUM_DOMS): 29.4 extraConfig={"memory":MEM_PER_DOM}) 29.5 29.6 try: 29.7 - dom.start() 29.8 + cons = dom.start() 29.9 except DomainError, e: 29.10 if verbose: 29.11 print str(e) 29.12 FAIL("[%i] Failed to create domain" % d) 29.13 29.14 try: 29.15 - cons = XmConsole(dom.getName()) 29.16 - cons.sendInput("foo") 29.17 cons.runCmd("ls") 29.18 except ConsoleError, e: 29.19 FAIL("[%i] Failed to attach console to %s" % (d, dom.getName()))
30.1 --- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu May 04 14:20:11 2006 +0100 30.2 +++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu May 04 14:22:17 2006 +0100 30.3 @@ -17,18 +17,12 @@ for i in range(0,DOMS): 30.4 dom = XmTestDomain(extraConfig={"memory" : MEM}) 30.5 30.6 try: 30.7 - dom.start() 30.8 + cons = dom.start() 30.9 except DomainError, e: 30.10 if verbose: 30.11 print str(e) 30.12 FAIL("Failed to start %s" % dom.getName()) 30.13 30.14 - try: 30.15 - cons = XmConsole(dom.getName()) 30.16 - cons.sendInput("foo") 30.17 - except ConsoleError, e: 30.18 - FAIL(str(e)) 30.19 - 30.20 if verbose: 30.21 print "[%i/%i] Started %s" % (i, DOMS, dom.getName()) 30.22 30.23 @@ -56,4 +50,3 @@ for d, c in domains: 30.24 if run["return"] != 0: 30.25 FAIL("Domain %s didn't survive!" % d.getName()) 30.26 30.27 -
31.1 --- a/tools/xm-test/tests/create/13_create_multinic_pos.py Thu May 04 14:20:11 2006 +0100 31.2 +++ b/tools/xm-test/tests/create/13_create_multinic_pos.py Thu May 04 14:22:17 2006 +0100 31.3 @@ -18,13 +18,11 @@ for i in range(0,MAX_NICS): 31.4 domain = XmTestDomain(extraConfig=config) 31.5 31.6 try: 31.7 - domain.start() 31.8 + console = domain.start() 31.9 except DomainError, e: 31.10 FAIL("(%i nics) " % i + str(e)) 31.11 31.12 try: 31.13 - console = XmConsole(domain.getName()) 31.14 - console.sendInput("input") 31.15 console.runCmd("ls") 31.16 except ConsoleError, e: 31.17 FAIL("(%i nics) Console didn't respond: probably crashed!" % i)
32.1 --- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu May 04 14:20:11 2006 +0100 32.2 +++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu May 04 14:22:17 2006 +0100 32.3 @@ -31,20 +31,14 @@ else: 32.4 domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig) 32.5 32.6 try: 32.7 - domain.start() 32.8 + console = domain.start() 32.9 except DomainError, e: 32.10 FAIL(str(e)) 32.11 32.12 #waitForBoot() 32.13 32.14 try: 32.15 - console = XmConsole(domain.getName(), historySaveCmds=True) 32.16 -except ConsoleError, e: 32.17 - FAIL(str(e)) 32.18 - 32.19 -try: 32.20 # console.debugMe = True 32.21 - console.sendInput("foo") 32.22 run = console.runCmd("ls") 32.23 32.24 except ConsoleError, e:
33.1 --- a/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu May 04 14:20:11 2006 +0100 33.2 +++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu May 04 14:22:17 2006 +0100 33.3 @@ -12,13 +12,11 @@ domain = XmTestDomain(extraConfig={"memo 33.4 "extra" :"mem=%iM" % MEM}) 33.5 33.6 try: 33.7 - domain.start() 33.8 + console = domain.start() 33.9 except DomainError, e: 33.10 FAIL("Unable to start a domain with %i MB" % MEM) 33.11 33.12 try: 33.13 - console = XmConsole(domain.getName()) 33.14 - console.sendInput("input") 33.15 console.runCmd("ls") 33.16 except ConsoleError, e: 33.17 if e.reason == RUNAWAY:
34.1 --- a/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu May 04 14:20:11 2006 +0100 34.2 +++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu May 04 14:22:17 2006 +0100 34.3 @@ -13,13 +13,11 @@ domain = XmTestDomain(extraConfig={"memo 34.4 "extra" :"mem=%iM" % MEM}) 34.5 34.6 try: 34.7 - domain.start() 34.8 + console = domain.start() 34.9 except DomainError, e: 34.10 FAIL("Unable to start a domain with %i MB" % MEM) 34.11 34.12 try: 34.13 - console = XmConsole(domain.getName()) 34.14 - console.sendInput("input") 34.15 console.runCmd("ls") 34.16 except ConsoleError, e: 34.17 if e.reason == RUNAWAY:
35.1 --- a/tools/xm-test/tests/destroy/01_destroy_basic_pos.py Thu May 04 14:20:11 2006 +0100 35.2 +++ b/tools/xm-test/tests/destroy/01_destroy_basic_pos.py Thu May 04 14:22:17 2006 +0100 35.3 @@ -14,29 +14,21 @@ domain = XmTestDomain() 35.4 35.5 # Start it 35.6 try: 35.7 - domain.start() 35.8 + console = domain.start() 35.9 except DomainError, e: 35.10 if verbose: 35.11 print "Failed to create test domain because:" 35.12 print e.extra 35.13 FAIL(str(e)) 35.14 35.15 -# Attach a console to it 35.16 try: 35.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 35.18 -except ConsoleError, e: 35.19 - FAIL(str(e)) 35.20 - 35.21 -try: 35.22 - # Activate the console 35.23 - console.sendInput("foo") 35.24 # Run 'ls' 35.25 run = console.runCmd("ls") 35.26 except ConsoleError, e: 35.27 FAIL(str(e)) 35.28 35.29 # Close the console 35.30 -console.closeConsole() 35.31 +domain.closeConsole() 35.32 35.33 # Check the output of 'ls' 35.34 if not re.search("proc", run["output"]):
36.1 --- a/tools/xm-test/tests/destroy/05_destroy_byid_pos.py Thu May 04 14:20:11 2006 +0100 36.2 +++ b/tools/xm-test/tests/destroy/05_destroy_byid_pos.py Thu May 04 14:22:17 2006 +0100 36.3 @@ -7,8 +7,7 @@ 36.4 # Positive Test: 36.5 # Test Description: 36.6 # 1. Create a domain 36.7 -# 2. Attach a console to the domain. 36.8 -# 3. Destroy the domain by id 36.9 +# 2. Destroy the domain by id 36.10 36.11 import sys 36.12 import re 36.13 @@ -21,7 +20,7 @@ domain = XmTestDomain() 36.14 36.15 # Start it 36.16 try: 36.17 - domain.start() 36.18 + domain.start(noConsole=True) 36.19 except DomainError, e: 36.20 if verbose: 36.21 print "Failed to create test domain because:"
37.1 --- a/tools/xm-test/tests/destroy/07_destroy_stale_pos.py Thu May 04 14:20:11 2006 +0100 37.2 +++ b/tools/xm-test/tests/destroy/07_destroy_stale_pos.py Thu May 04 14:22:17 2006 +0100 37.3 @@ -108,14 +108,11 @@ def runTests(tests): 37.4 # Create a domain 37.5 37.6 try: 37.7 - domain.start() 37.8 + console = domain.start() 37.9 except DomainError, e: 37.10 FAIL(str(e)) 37.11 37.12 - # Attach a console and make sure it's live 37.13 try: 37.14 - console = XmConsole(domain.getName()) 37.15 - console.sendInput("foo") 37.16 console.runCmd("ls") 37.17 except ConsoleError, e: 37.18 FAIL(str(e))
38.1 --- a/tools/xm-test/tests/list/04_list_goodparm_pos.py Thu May 04 14:20:11 2006 +0100 38.2 +++ b/tools/xm-test/tests/list/04_list_goodparm_pos.py Thu May 04 14:22:17 2006 +0100 38.3 @@ -12,23 +12,17 @@ from XmTestLib import * 38.4 domain = XmTestDomain() 38.5 38.6 try: 38.7 - domain.start() 38.8 + console = domain.start() 38.9 except DomainError, e: 38.10 if verbose: 38.11 print "Failed to create test domain because:" 38.12 print e.extra 38.13 FAIL(str(e)) 38.14 38.15 -try: 38.16 - console = XmConsole(domain.getName()) 38.17 -except ConsoleError, e: 38.18 - FAIL(str(e)) 38.19 - 38.20 - 38.21 status, output = traceCommand("xm list %s" % domain.getName()) 38.22 38.23 if status != 0: 38.24 FAIL("`xm list %s' failed with invalid status %i != 0" % (domain.getName(), status)) 38.25 38.26 -console.closeConsole() 38.27 +domain.closeConsole() 38.28 domain.stop()
39.1 --- a/tools/xm-test/tests/memset/01_memset_basic_pos.py Thu May 04 14:20:11 2006 +0100 39.2 +++ b/tools/xm-test/tests/memset/01_memset_basic_pos.py Thu May 04 14:22:17 2006 +0100 39.3 @@ -28,17 +28,14 @@ domain = XmTestDomain() 39.4 39.5 # Start it 39.6 try: 39.7 - domain.start() 39.8 + console = domain.start() 39.9 except DomainError, e: 39.10 if verbose: 39.11 print "Failed to create test domain because:" 39.12 print e.extra 39.13 FAIL(str(e)) 39.14 39.15 -# Attach a console to it 39.16 try: 39.17 - console = XmConsole(domain.getName()) 39.18 - console.sendInput("input") 39.19 # Make sure it's up an running before we continue 39.20 console.runCmd("ls") 39.21 except ConsoleError, e: 39.22 @@ -96,7 +93,7 @@ if domUmem != newmem: 39.23 39.24 # quiesce everything 39.25 # Close the console 39.26 -console.closeConsole() 39.27 +domain.closeConsole() 39.28 39.29 # Stop the domain (nice shutdown) 39.30 domain.stop()
40.1 --- a/tools/xm-test/tests/memset/03_memset_random_pos.py Thu May 04 14:20:11 2006 +0100 40.2 +++ b/tools/xm-test/tests/memset/03_memset_random_pos.py Thu May 04 14:22:17 2006 +0100 40.3 @@ -14,7 +14,7 @@ if ENABLE_HVM_SUPPORT: 40.4 domain = XmTestDomain() 40.5 40.6 try: 40.7 - domain.start() 40.8 + console = domain.start() 40.9 except DomainError, e: 40.10 if verbose: 40.11 print "Failed to start domain:"
41.1 --- a/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Thu May 04 14:20:11 2006 +0100 41.2 +++ b/tools/xm-test/tests/memset/04_memset_smallmem_pos.py Thu May 04 14:22:17 2006 +0100 41.3 @@ -11,7 +11,7 @@ if ENABLE_HVM_SUPPORT: 41.4 domain = XmTestDomain() 41.5 41.6 try: 41.7 - domain.start() 41.8 + console = domain.start() 41.9 except DomainError, e: 41.10 if verbose: 41.11 print "Failed to start domain: " 41.12 @@ -19,8 +19,6 @@ except DomainError, e: 41.13 FAIL(str(e)) 41.14 41.15 try: 41.16 - console = XmConsole(domain.getName()) 41.17 - console.sendInput("input") 41.18 # Make sure it's alive before we proceed 41.19 console.runCmd("ls") 41.20 except ConsoleError, e:
42.1 --- a/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py Thu May 04 14:20:11 2006 +0100 42.2 +++ b/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py Thu May 04 14:22:17 2006 +0100 42.3 @@ -25,29 +25,21 @@ domain = XmTestDomain() 42.4 42.5 # Start it 42.6 try: 42.7 - domain.start() 42.8 + console = domain.start() 42.9 except DomainError, e: 42.10 if verbose: 42.11 print "Failed to create test domain because:" 42.12 print e.extra 42.13 FAIL(str(e)) 42.14 42.15 -# Attach a console to it 42.16 try: 42.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 42.18 -except ConsoleError, e: 42.19 - FAIL(str(e)) 42.20 - 42.21 -try: 42.22 - # Activate the console 42.23 - console.sendInput("foo") 42.24 # Set a variable to check on the other side 42.25 run = console.runCmd("foo=bar") 42.26 except ConsoleError, e: 42.27 FAIL(str(e)) 42.28 42.29 # Close the console 42.30 -console.closeConsole() 42.31 +domain.closeConsole() 42.32 42.33 old_domid = domid(domain.getName()) 42.34 42.35 @@ -68,11 +60,12 @@ if (old_domid == new_domid): 42.36 42.37 # Attach a console to it 42.38 try: 42.39 - console = XmConsole(domain.getName(), historySaveCmds=True) 42.40 + console = domain.getConsole() 42.41 console.debugMe = True 42.42 except ConsoleError, e: 42.43 pass 42.44 42.45 +console.setHistorySaveCmds(value=True) 42.46 console.sendInput("ls") 42.47 42.48 # Run 'ls' 42.49 @@ -86,7 +79,7 @@ if not re.search("bar", run["output"]): 42.50 FAIL("Migrated domain has been reset") 42.51 42.52 # Close the console 42.53 -console.closeConsole() 42.54 +domain.closeConsole() 42.55 42.56 # Stop the domain (nice shutdown) 42.57 domain.stop()
43.1 --- a/tools/xm-test/tests/network-attach/01_network_attach_pos.py Thu May 04 14:20:11 2006 +0100 43.2 +++ b/tools/xm-test/tests/network-attach/01_network_attach_pos.py Thu May 04 14:22:17 2006 +0100 43.3 @@ -15,22 +15,14 @@ if ENABLE_HVM_SUPPORT: 43.4 domain = XmTestDomain() 43.5 43.6 try: 43.7 - domain.start() 43.8 + console = domain.start() 43.9 except DomainError, e: 43.10 if verbose: 43.11 print "Failed to create test domain because:" 43.12 print e.extra 43.13 FAIL(str(e)) 43.14 43.15 -# Attach a console to it 43.16 try: 43.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 43.18 -except ConsoleError, e: 43.19 - FAIL(str(e)) 43.20 - 43.21 -try: 43.22 - # Activate the console 43.23 - console.sendInput("input") 43.24 # Run 'ls' 43.25 run = console.runCmd("ls") 43.26 except ConsoleError, e: 43.27 @@ -45,7 +37,7 @@ if status: 43.28 43.29 ## 43.30 # Close the console 43.31 -console.closeConsole() 43.32 +domain.closeConsole() 43.33 43.34 # Stop the domain (nice shutdown) 43.35 domain.stop()
44.1 --- a/tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py Thu May 04 14:20:11 2006 +0100 44.2 +++ b/tools/xm-test/tests/network-attach/02_network_attach_detach_pos.py Thu May 04 14:22:17 2006 +0100 44.3 @@ -17,22 +17,14 @@ if ENABLE_HVM_SUPPORT: 44.4 domain = XmTestDomain() 44.5 44.6 try: 44.7 - domain.start() 44.8 + console = domain.start() 44.9 except DomainError, e: 44.10 if verbose: 44.11 print "Failed to create test domain because:" 44.12 print e.extra 44.13 FAIL(str(e)) 44.14 44.15 -# Attach a console to it 44.16 try: 44.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 44.18 -except ConsoleError, e: 44.19 - FAIL(str(e)) 44.20 - 44.21 -try: 44.22 - # Activate the console 44.23 - console.sendInput("input") 44.24 # Run 'ls' 44.25 run = console.runCmd("ls") 44.26 except ConsoleError, e: 44.27 @@ -51,7 +43,7 @@ if status: 44.28 44.29 44.30 # Close the console 44.31 -console.closeConsole() 44.32 +domain.closeConsole() 44.33 44.34 # Stop the domain (nice shutdown) 44.35 domain.stop()
45.1 --- a/tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py Thu May 04 14:20:11 2006 +0100 45.2 +++ b/tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py Thu May 04 14:22:17 2006 +0100 45.3 @@ -17,25 +17,16 @@ if ENABLE_HVM_SUPPORT: 45.4 domain = XmTestDomain() 45.5 45.6 try: 45.7 - domain.start() 45.8 + console = domain.start() 45.9 except DomainError, e: 45.10 if verbose: 45.11 print "Failed to create test domain because:" 45.12 print e.extra 45.13 FAIL(str(e)) 45.14 45.15 -# Attach a console to it 45.16 -try: 45.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 45.18 - # network-detach is crashing, so we enable console debugging 45.19 - # for now, so that reports include the oops 45.20 - console.debugMe = True 45.21 -except ConsoleError, e: 45.22 - FAIL(str(e)) 45.23 +console.debugMe = True 45.24 45.25 try: 45.26 - # Activate the console 45.27 - console.sendInput("input") 45.28 # Run 'ls' 45.29 run = console.runCmd("ls") 45.30 except ConsoleError, e: 45.31 @@ -54,7 +45,7 @@ for i in range(10): 45.32 FAIL(msg) 45.33 45.34 # Close the console 45.35 -console.closeConsole() 45.36 +domain.closeConsole() 45.37 45.38 # Stop the domain (nice shutdown) 45.39 domain.stop()
46.1 --- a/tools/xm-test/tests/network/02_network_local_ping_pos.py Thu May 04 14:20:11 2006 +0100 46.2 +++ b/tools/xm-test/tests/network/02_network_local_ping_pos.py Thu May 04 14:22:17 2006 +0100 46.3 @@ -35,24 +35,14 @@ else: 46.4 46.5 domain = XmTestDomain(extraConfig=config) 46.6 try: 46.7 - domain.start() 46.8 + console = domain.start() 46.9 except DomainError, e: 46.10 if verbose: 46.11 print "Failed to create test domain because:" 46.12 print e.extra 46.13 FAIL(str(e)) 46.14 46.15 - 46.16 -# Attach a console 46.17 try: 46.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 46.19 -except ConsoleError, e: 46.20 - FAIL(str(e)) 46.21 - 46.22 -try: 46.23 - # Activate the console 46.24 - console.sendInput("bhs") 46.25 - 46.26 # Bring up the "lo" interface. 46.27 console.runCmd("ifconfig lo 127.0.0.1") 46.28
47.1 --- a/tools/xm-test/tests/network/03_network_local_tcp_pos.py Thu May 04 14:20:11 2006 +0100 47.2 +++ b/tools/xm-test/tests/network/03_network_local_tcp_pos.py Thu May 04 14:22:17 2006 +0100 47.3 @@ -40,24 +40,14 @@ else: 47.4 47.5 domain = XmTestDomain(extraConfig=config) 47.6 try: 47.7 - domain.start() 47.8 + console = domain.start() 47.9 except DomainError, e: 47.10 if verbose: 47.11 print "Failed to create test domain because:" 47.12 print e.extra 47.13 FAIL(str(e)) 47.14 47.15 - 47.16 -# Attach a console 47.17 try: 47.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 47.19 -except ConsoleError, e: 47.20 - FAIL(str(e)) 47.21 - 47.22 -try: 47.23 - # Activate the console 47.24 - console.sendInput("bhs") 47.25 - 47.26 # Bring up the "lo" interface. 47.27 console.runCmd("ifconfig lo 127.0.0.1") 47.28
48.1 --- a/tools/xm-test/tests/network/04_network_local_udp_pos.py Thu May 04 14:20:11 2006 +0100 48.2 +++ b/tools/xm-test/tests/network/04_network_local_udp_pos.py Thu May 04 14:22:17 2006 +0100 48.3 @@ -39,24 +39,14 @@ else: 48.4 48.5 domain = XmTestDomain(extraConfig=config) 48.6 try: 48.7 - domain.start() 48.8 + console = domain.start() 48.9 except DomainError, e: 48.10 if verbose: 48.11 print "Failed to create test domain because:" 48.12 print e.extra 48.13 FAIL(str(e)) 48.14 48.15 - 48.16 -# Attach a console 48.17 try: 48.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 48.19 -except ConsoleError, e: 48.20 - FAIL(str(e)) 48.21 - 48.22 -try: 48.23 - # Activate the console 48.24 - console.sendInput("bhs") 48.25 - 48.26 # Bring up the "lo" interface. 48.27 console.runCmd("ifconfig lo 127.0.0.1") 48.28
49.1 --- a/tools/xm-test/tests/network/05_network_dom0_ping_pos.py Thu May 04 14:20:11 2006 +0100 49.2 +++ b/tools/xm-test/tests/network/05_network_dom0_ping_pos.py Thu May 04 14:22:17 2006 +0100 49.3 @@ -40,22 +40,13 @@ else: 49.4 49.5 domain = XmTestDomain(extraConfig=config) 49.6 try: 49.7 - domain.start() 49.8 + console = domain.start() 49.9 except DomainError, e: 49.10 if verbose: 49.11 print "Failed to create test domain because:" 49.12 print e.extra 49.13 FAIL(str(e)) 49.14 49.15 - 49.16 -# Attach a console 49.17 -try: 49.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 49.19 - # Activate the console 49.20 - console.sendInput("bhs") 49.21 -except ConsoleError, e: 49.22 - FAIL(str(e)) 49.23 - 49.24 try: 49.25 # Add a suitable dom0 IP address 49.26 dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0", bridge=brg)
50.1 --- a/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py Thu May 04 14:20:11 2006 +0100 50.2 +++ b/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py Thu May 04 14:22:17 2006 +0100 50.3 @@ -40,22 +40,13 @@ else: 50.4 50.5 domain = XmTestDomain(extraConfig=config) 50.6 try: 50.7 - domain.start() 50.8 + console = domain.start() 50.9 except DomainError, e: 50.10 if verbose: 50.11 print "Failed to create test domain because:" 50.12 print e.extra 50.13 FAIL(str(e)) 50.14 50.15 - 50.16 -# Attach a console 50.17 -try: 50.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 50.19 - # Activate the console 50.20 - console.sendInput("bhs") 50.21 -except ConsoleError, e: 50.22 - FAIL(str(e)) 50.23 - 50.24 try: 50.25 # Add a suitable dom0 IP address 50.26 dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0", bridge=brg)
51.1 --- a/tools/xm-test/tests/network/07_network_dom0_udp_pos.py Thu May 04 14:20:11 2006 +0100 51.2 +++ b/tools/xm-test/tests/network/07_network_dom0_udp_pos.py Thu May 04 14:22:17 2006 +0100 51.3 @@ -40,22 +40,13 @@ else: 51.4 51.5 domain = XmTestDomain(extraConfig=config) 51.6 try: 51.7 - domain.start() 51.8 + console = domain.start() 51.9 except DomainError, e: 51.10 if verbose: 51.11 print "Failed to create test domain because:" 51.12 print e.extra 51.13 FAIL(str(e)) 51.14 51.15 - 51.16 -# Attach a console 51.17 -try: 51.18 - console = XmConsole(domain.getName(), historySaveCmds=True) 51.19 - # Activate the console 51.20 - console.sendInput("bhs") 51.21 -except ConsoleError, e: 51.22 - FAIL(str(e)) 51.23 - 51.24 try: 51.25 # Add a suitable dom0 IP address 51.26 dom0ip = Net.ip("dom0", "eth0", todomname=domain.getName(), toeth="eth0", bridge=brg)
52.1 --- a/tools/xm-test/tests/network/11_network_domU_ping_pos.py Thu May 04 14:20:11 2006 +0100 52.2 +++ b/tools/xm-test/tests/network/11_network_domU_ping_pos.py Thu May 04 14:22:17 2006 +0100 52.3 @@ -25,19 +25,12 @@ def netDomain(ip): 52.4 52.5 dom = XmTestDomain(extraConfig=config) 52.6 try: 52.7 - dom.start() 52.8 + console = dom.start() 52.9 except DomainError, e: 52.10 if verbose: 52.11 print "Failed to create test domain because:" 52.12 print e.extra 52.13 FAIL(str(e)) 52.14 - try: 52.15 - # Attach a console 52.16 - console = XmConsole(dom.getName(), historySaveCmds=True) 52.17 - # Activate the console 52.18 - console.sendInput("bhs") 52.19 - except ConsoleError, e: 52.20 - FAIL(str(e)) 52.21 return console 52.22 52.23 rc = 0
53.1 --- a/tools/xm-test/tests/network/12_network_domU_tcp_pos.py Thu May 04 14:20:11 2006 +0100 53.2 +++ b/tools/xm-test/tests/network/12_network_domU_tcp_pos.py Thu May 04 14:22:17 2006 +0100 53.3 @@ -25,19 +25,12 @@ def netDomain(ip): 53.4 53.5 dom = XmTestDomain(extraConfig=config) 53.6 try: 53.7 - dom.start() 53.8 + console = dom.start() 53.9 except DomainError, e: 53.10 if verbose: 53.11 print "Failed to create test domain because:" 53.12 print e.extra 53.13 FAIL(str(e)) 53.14 - try: 53.15 - # Attach a console 53.16 - console = XmConsole(dom.getName(), historySaveCmds=True) 53.17 - # Activate the console 53.18 - console.sendInput("bhs") 53.19 - except ConsoleError, e: 53.20 - FAIL(str(e)) 53.21 return console 53.22 53.23 rc = 0
54.1 --- a/tools/xm-test/tests/network/13_network_domU_udp_pos.py Thu May 04 14:20:11 2006 +0100 54.2 +++ b/tools/xm-test/tests/network/13_network_domU_udp_pos.py Thu May 04 14:22:17 2006 +0100 54.3 @@ -25,19 +25,12 @@ def netDomain(ip): 54.4 54.5 dom = XmTestDomain(extraConfig=config) 54.6 try: 54.7 - dom.start() 54.8 + console = dom.start() 54.9 except DomainError, e: 54.10 if verbose: 54.11 print "Failed to create test domain because:" 54.12 print e.extra 54.13 FAIL(str(e)) 54.14 - try: 54.15 - # Attach a console 54.16 - console = XmConsole(dom.getName(), historySaveCmds=True) 54.17 - # Activate the console 54.18 - console.sendInput("bhs") 54.19 - except ConsoleError, e: 54.20 - FAIL(str(e)) 54.21 return console 54.22 54.23 rc = 0
55.1 --- a/tools/xm-test/tests/pause/01_pause_basic_pos.py Thu May 04 14:20:11 2006 +0100 55.2 +++ b/tools/xm-test/tests/pause/01_pause_basic_pos.py Thu May 04 14:22:17 2006 +0100 55.3 @@ -20,29 +20,21 @@ domain = XmTestDomain() 55.4 55.5 # Start it 55.6 try: 55.7 - domain.start() 55.8 + console = domain.start() 55.9 except DomainError, e: 55.10 if verbose: 55.11 print "Failed to create test domain because:" 55.12 print e.extra 55.13 FAIL(str(e)) 55.14 55.15 -# Attach a console to it 55.16 try: 55.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 55.18 -except ConsoleError, e: 55.19 - FAIL(str(e)) 55.20 - 55.21 -try: 55.22 - # Activate the console 55.23 - console.sendInput("foo") 55.24 # Make sure a command succeeds 55.25 run = console.runCmd("ls") 55.26 except ConsoleError, e: 55.27 FAIL(str(e)) 55.28 55.29 # Close the console 55.30 -console.closeConsole() 55.31 +domain.closeConsole() 55.32 55.33 # Pause the domain 55.34 status, output = traceCommand("xm pause %s" % domain.getName()) 55.35 @@ -51,7 +43,8 @@ if status != 0: 55.36 55.37 # Try to attach a console to it 55.38 try: 55.39 - console = XmConsole(domain.getName(), historySaveCmds=True) 55.40 + console = domain.getConsole() 55.41 + console.setHistorySaveCmds(value=True) 55.42 run = console.runCmd("ls") 55.43 #If we get here, console attached to paused domain (unexpected) 55.44 FAIL("console attached to supposedly paused domain") 55.45 @@ -59,7 +52,7 @@ except ConsoleError, e: 55.46 pass 55.47 55.48 # Close the console 55.49 -console.closeConsole() 55.50 +domain.closeConsole() 55.51 55.52 status, output = traceCommand("xm unpause %s" % domain.getName()) 55.53 if status != 0:
56.1 --- a/tools/xm-test/tests/pause/02_pause_badopt_neg.py Thu May 04 14:20:11 2006 +0100 56.2 +++ b/tools/xm-test/tests/pause/02_pause_badopt_neg.py Thu May 04 14:22:17 2006 +0100 56.3 @@ -11,7 +11,7 @@ from XmTestLib import * 56.4 domain = XmTestDomain() 56.5 56.6 try: 56.7 - domain.start() 56.8 + domain.start(noConsole=True) 56.9 except DomainError, e: 56.10 if verbose: 56.11 print "Failed to create test domain because:"
57.1 --- a/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Thu May 04 14:20:11 2006 +0100 57.2 +++ b/tools/xm-test/tests/reboot/01_reboot_basic_pos.py Thu May 04 14:22:17 2006 +0100 57.3 @@ -11,19 +11,14 @@ from XmTestLib import * 57.4 domain = XmTestDomain() 57.5 57.6 try: 57.7 - domain.start() 57.8 + console = domain.start() 57.9 except DomainError, e: 57.10 if verbose: 57.11 print "Failed to create test domain because:" 57.12 print e.extra 57.13 FAIL(str(e)) 57.14 57.15 -try: 57.16 - console = XmConsole(domain.getName()) 57.17 -except ConsoleError, e: 57.18 - FAIL(str(e)) 57.19 - 57.20 -console.closeConsole() 57.21 +domain.closeConsole() 57.22 57.23 status, output = traceCommand("xm reboot %s" % domain.getName()) 57.24 57.25 @@ -33,7 +28,7 @@ if status != 0: 57.26 time.sleep(15) 57.27 57.28 try: 57.29 - console = XmConsole(domain.getName()) 57.30 + console = domain.getConsole() 57.31 except ConsoleError, e: 57.32 FAIL(str(e)) 57.33 57.34 @@ -43,7 +38,7 @@ try: 57.35 except ConsoleError, e: 57.36 FAIL(str(e)) 57.37 57.38 -console.closeConsole() 57.39 +domain.closeConsole() 57.40 57.41 domain.destroy() 57.42
58.1 --- a/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py Thu May 04 14:20:11 2006 +0100 58.2 +++ b/tools/xm-test/tests/reboot/02_reboot_badopt_neg.py Thu May 04 14:22:17 2006 +0100 58.3 @@ -11,7 +11,7 @@ from XmTestLib import * 58.4 domain = XmTestDomain() 58.5 58.6 try: 58.7 - domain.start() 58.8 + domain.start(noConsole=True) 58.9 except DomainError, e: 58.10 if verbose: 58.11 print "Failed to create test domain because:"
59.1 --- a/tools/xm-test/tests/restore/01_restore_basic_pos.py Thu May 04 14:20:11 2006 +0100 59.2 +++ b/tools/xm-test/tests/restore/01_restore_basic_pos.py Thu May 04 14:22:17 2006 +0100 59.3 @@ -18,7 +18,7 @@ if ENABLE_HVM_SUPPORT: 59.4 domain = XmTestDomain() 59.5 59.6 try: 59.7 - domain.start() 59.8 + console = domain.start() 59.9 except DomainError, e: 59.10 if verbose: 59.11 print "Failed to create test domain because:" 59.12 @@ -27,13 +27,11 @@ except DomainError, e: 59.13 59.14 # Make sure the domain isn't DOA 59.15 try: 59.16 - console = XmConsole(domain.getName()) 59.17 - console.sendInput("input") 59.18 console.runCmd("foo=bar") 59.19 except ConsoleError, e: 59.20 FAIL(str(e)) 59.21 59.22 -console.closeConsole() 59.23 +domain.closeConsole() 59.24 59.25 # Save it out 59.26 try: 59.27 @@ -67,7 +65,7 @@ if not isDomainRunning(domain.getName()) 59.28 59.29 # Make sure it's alive 59.30 try: 59.31 - newConsole = XmConsole(domain.getName()) 59.32 + newConsole = domain.getConsole() 59.33 # Enable debug dumping because this generates a Oops on x86_64 59.34 newConsole.debugMe = True 59.35 newConsole.sendInput("ls") 59.36 @@ -77,7 +75,7 @@ try: 59.37 except ConsoleError, e: 59.38 FAIL("Restored domain is dead (%s)" % str(e)) 59.39 59.40 -newConsole.closeConsole() 59.41 +domain.closeConsole() 59.42 59.43 # This only works because the domain 59.44 # still has the same name
60.1 --- a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu May 04 14:20:11 2006 +0100 60.2 +++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu May 04 14:22:17 2006 +0100 60.3 @@ -23,14 +23,11 @@ if s != 0: 60.4 FAIL("Unable to mke2fs /dev/ram1 in dom0") 60.5 60.6 try: 60.7 - domain.start() 60.8 + console = domain.start() 60.9 except DomainError, e: 60.10 FAIL(str(e)) 60.11 60.12 try: 60.13 - console = XmConsole(domain.getName()) 60.14 - console.sendInput("foo") 60.15 - 60.16 run = console.runCmd("mkdir /mnt/a /mnt/b") 60.17 if run["return"] != 0: 60.18 FAIL("Unable to mkdir /mnt/a /mnt/b") 60.19 @@ -67,7 +64,7 @@ try: 60.20 except ConsoleError, e: 60.21 FAIL(str(e)) 60.22 60.23 -console.closeConsole() 60.24 +domain.closeConsole() 60.25 60.26 try: 60.27 s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(), 60.28 @@ -91,7 +88,7 @@ if s != 0: 60.29 FAIL("xm restore exited with %i != 0" % s) 60.30 60.31 try: 60.32 - console = XmConsole(domain.getName()) 60.33 + console = domain.getConsole() 60.34 # Enable debug dumping, as this causes an Oops on x86_64 60.35 console.debugMe = True 60.36
61.1 --- a/tools/xm-test/tests/save/01_save_basic_pos.py Thu May 04 14:20:11 2006 +0100 61.2 +++ b/tools/xm-test/tests/save/01_save_basic_pos.py Thu May 04 14:22:17 2006 +0100 61.3 @@ -13,20 +13,14 @@ if ENABLE_HVM_SUPPORT: 61.4 domain = XmTestDomain() 61.5 61.6 try: 61.7 - domain.start() 61.8 + console = domain.start() 61.9 except DomainError, e: 61.10 if verbose: 61.11 print "Failed to create test domain because:" 61.12 print e.extra 61.13 FAIL(str(e)) 61.14 61.15 -# Make sure the domain isn't DOA 61.16 -try: 61.17 - console = XmConsole(domain.getName()) 61.18 -except ConsoleError, e: 61.19 - FAIL(str(e)) 61.20 - 61.21 -console.closeConsole() 61.22 +domain.closeConsole() 61.23 61.24 # Save it out 61.25 try:
62.1 --- a/tools/xm-test/tests/save/03_save_bogusfile_neg.py Thu May 04 14:20:11 2006 +0100 62.2 +++ b/tools/xm-test/tests/save/03_save_bogusfile_neg.py Thu May 04 14:22:17 2006 +0100 62.3 @@ -16,20 +16,14 @@ if ENABLE_HVM_SUPPORT: 62.4 domain = XmTestDomain() 62.5 62.6 try: 62.7 - domain.start() 62.8 + console = domain.start() 62.9 except DomainError, e: 62.10 if verbose: 62.11 print "Failed to create test domain because:" 62.12 print e.extra 62.13 FAIL(str(e)) 62.14 62.15 -# Make sure the domain isn't DOA 62.16 -try: 62.17 - console = XmConsole(domain.getName()) 62.18 -except ConsoleError, e: 62.19 - FAIL(str(e)) 62.20 - 62.21 -console.closeConsole() 62.22 +domain.closeConsole() 62.23 62.24 # Save it out 62.25 status, output = traceCommand("xm save %s /NOWHERE/test.state" % domain.getName())
63.1 --- a/tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py Thu May 04 14:20:11 2006 +0100 63.2 +++ b/tools/xm-test/tests/sedf/01_sedf_period_slice_pos.py Thu May 04 14:22:17 2006 +0100 63.3 @@ -14,7 +14,7 @@ def get_sedf_params(domain): 63.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 63.5 63.6 try: 63.7 - domain.start() 63.8 + domain.start(noConsole=True) 63.9 except DomainError, e: 63.10 if verbose: 63.11 print "Failed to create test domain because:"
64.1 --- a/tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py Thu May 04 14:20:11 2006 +0100 64.2 +++ b/tools/xm-test/tests/sedf/02_sedf_period_lower_neg.py Thu May 04 14:22:17 2006 +0100 64.3 @@ -16,7 +16,7 @@ def get_sedf_params(domain): 64.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 64.5 64.6 try: 64.7 - domain.start() 64.8 + domain.start(noConsole=True) 64.9 except DomainError, e: 64.10 if verbose: 64.11 print "Failed to create test domain because:"
65.1 --- a/tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py Thu May 04 14:20:11 2006 +0100 65.2 +++ b/tools/xm-test/tests/sedf/03_sedf_slice_lower_neg.py Thu May 04 14:22:17 2006 +0100 65.3 @@ -16,7 +16,7 @@ def get_sedf_params(domain): 65.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 65.5 65.6 try: 65.7 - domain.start() 65.8 + domain.start(noConsole=True) 65.9 except DomainError, e: 65.10 if verbose: 65.11 print "Failed to create test domain because:"
66.1 --- a/tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py Thu May 04 14:20:11 2006 +0100 66.2 +++ b/tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py Thu May 04 14:22:17 2006 +0100 66.3 @@ -14,7 +14,7 @@ def get_sedf_params(domain): 66.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 66.5 66.6 try: 66.7 - domain.start() 66.8 + domain.start(noConsole=True) 66.9 except DomainError, e: 66.10 if verbose: 66.11 print "Failed to create test domain because:"
67.1 --- a/tools/xm-test/tests/sedf/05_sedf_extratime_pos.py Thu May 04 14:20:11 2006 +0100 67.2 +++ b/tools/xm-test/tests/sedf/05_sedf_extratime_pos.py Thu May 04 14:22:17 2006 +0100 67.3 @@ -14,7 +14,7 @@ def get_sedf_params(domain): 67.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 67.5 67.6 try: 67.7 - domain.start() 67.8 + domain.start(noConsole=True) 67.9 except DomainError, e: 67.10 if verbose: 67.11 print "Failed to create test domain because:"
68.1 --- a/tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py Thu May 04 14:20:11 2006 +0100 68.2 +++ b/tools/xm-test/tests/sedf/06_sedf_extratime_disable_neg.py Thu May 04 14:22:17 2006 +0100 68.3 @@ -14,7 +14,7 @@ def get_sedf_params(domain): 68.4 domain = XmTestDomain(extraConfig = {"sched":"sedf"}) 68.5 68.6 try: 68.7 - domain.start() 68.8 + domain.start(noConsole=True) 68.9 except DomainError, e: 68.10 if verbose: 68.11 print "Failed to create test domain because:"
69.1 --- a/tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py Thu May 04 14:20:11 2006 +0100 69.2 +++ b/tools/xm-test/tests/shutdown/01_shutdown_basic_pos.py Thu May 04 14:22:17 2006 +0100 69.3 @@ -19,29 +19,21 @@ domain = XmTestDomain() 69.4 69.5 # Start it 69.6 try: 69.7 - domain.start() 69.8 + console = domain.start() 69.9 except DomainError, e: 69.10 if verbose: 69.11 print "Failed to create test domain because:" 69.12 print e.extra 69.13 FAIL(str(e)) 69.14 69.15 -# Attach a console to it 69.16 try: 69.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 69.18 -except ConsoleError, e: 69.19 - FAIL(str(e)) 69.20 - 69.21 -try: 69.22 - # Activate the console 69.23 - console.sendInput("foo") 69.24 # Make sure a command succeeds 69.25 run = console.runCmd("ls /bin") 69.26 except ConsoleError, e: 69.27 FAIL(str(e)) 69.28 69.29 # Close the console 69.30 -console.closeConsole() 69.31 +domain.closeConsole() 69.32 69.33 # Stop the domain (nice shutdown) 69.34 status, output = traceCommand("xm shutdown %s" % domain.getName())
70.1 --- a/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py Thu May 04 14:20:11 2006 +0100 70.2 +++ b/tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py Thu May 04 14:22:17 2006 +0100 70.3 @@ -20,7 +20,7 @@ domain = XmTestDomain() 70.4 70.5 # Start it 70.6 try: 70.7 - domain.start() 70.8 + domain.start(noConsole=True) 70.9 except DomainError, e: 70.10 if verbose: 70.11 print "Failed to create test domain because:"
71.1 --- a/tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py Thu May 04 14:20:11 2006 +0100 71.2 +++ b/tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py Thu May 04 14:22:17 2006 +0100 71.3 @@ -17,20 +17,13 @@ domain = XmTestDomain() 71.4 71.5 # Start it 71.6 try: 71.7 - domain.start() 71.8 + console = domain.start() 71.9 except DomainError, e: 71.10 if verbose: 71.11 print "Failed to create test domain because:" 71.12 print e.extra 71.13 FAIL(str(e)) 71.14 71.15 -# Attach a console to it 71.16 -try: 71.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 71.18 -except ConsoleError, e: 71.19 - FAIL(str(e)) 71.20 - 71.21 - 71.22 status, output = traceCommand("xm sysrq %s s" % domain.getName()) 71.23 71.24 if status != 0: 71.25 @@ -40,15 +33,13 @@ if status != 0: 71.26 71.27 # Run 'ls' 71.28 try: 71.29 - # Activate the console 71.30 - console.sendInput("foo") 71.31 # Check the dmesg output on the domU 71.32 run = console.runCmd("dmesg | grep Emerg\n") 71.33 except ConsoleError, e: 71.34 FAIL(str(e)) 71.35 71.36 # Close the console 71.37 -console.closeConsole() 71.38 +domain.closeConsole() 71.39 71.40 # Stop the domain (nice shutdown) 71.41 domain.stop()
72.1 --- a/tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py Thu May 04 14:20:11 2006 +0100 72.2 +++ b/tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py Thu May 04 14:22:17 2006 +0100 72.3 @@ -13,7 +13,7 @@ if ENABLE_HVM_SUPPORT: 72.4 domain = XmTestDomain() 72.5 72.6 try: 72.7 - domain.start() 72.8 + console = domain.start() 72.9 except DomainError, e: 72.10 if verbose: 72.11 print "Failed to create domain:" 72.12 @@ -27,12 +27,6 @@ if status != 0: 72.13 # Wait for the reboot to finish 72.14 time.sleep(20) 72.15 72.16 -try: 72.17 - console = XmConsole(domain.getName()) 72.18 - console.sendInput("input") 72.19 -except ConsoleError, e: 72.20 - FAIL(str(e)) 72.21 - 72.22 status, output = traceCommand("xm sysrq %s s" % domain.getName()) 72.23 if status != 0: 72.24 FAIL("sysrq failed with %i != 0" % status)
73.1 --- a/tools/xm-test/tests/unpause/01_unpause_basic_pos.py Thu May 04 14:20:11 2006 +0100 73.2 +++ b/tools/xm-test/tests/unpause/01_unpause_basic_pos.py Thu May 04 14:22:17 2006 +0100 73.3 @@ -22,29 +22,21 @@ domain = XmTestDomain() 73.4 73.5 # Start it 73.6 try: 73.7 - domain.start() 73.8 + console = domain.start() 73.9 except DomainError, e: 73.10 if verbose: 73.11 print "Failed to create test domain because:" 73.12 print e.extra 73.13 FAIL(str(e)) 73.14 73.15 -# Attach a console to it 73.16 try: 73.17 - console = XmConsole(domain.getName(), historySaveCmds=True) 73.18 -except ConsoleError, e: 73.19 - FAIL(str(e)) 73.20 - 73.21 -try: 73.22 - # Activate the console 73.23 - console.sendInput("foo") 73.24 # Make sure a command succeeds 73.25 run = console.runCmd("ls") 73.26 except ConsoleError, e: 73.27 FAIL(str(e)) 73.28 73.29 # Close the console 73.30 -console.closeConsole() 73.31 +domain.closeConsole() 73.32 73.33 seed(time.time()) 73.34 73.35 @@ -69,13 +61,13 @@ if status != 0: 73.36 73.37 # Are we still alive after all that? 73.38 try: 73.39 - console = XmConsole(domain.getName(), historySaveCmds=True) 73.40 + console = domain.getConsole() 73.41 run = console.runCmd("ls") 73.42 except ConsoleError, e: 73.43 FAIL(str(e)) 73.44 73.45 # Close the console 73.46 -console.closeConsole() 73.47 +domain.closeConsole() 73.48 73.49 if run["return"] != 0: 73.50 FAIL("console failed to attach to supposedly unpaused domain")
74.1 --- a/tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py Thu May 04 14:20:11 2006 +0100 74.2 +++ b/tools/xm-test/tests/vcpu-disable/01_vcpu-disable_basic_pos.py Thu May 04 14:22:17 2006 +0100 74.3 @@ -42,7 +42,7 @@ if smpConcurrencyLevel() <= 1: 74.4 domain = XmTestDomain(extraConfig={"vcpus":2}) 74.5 74.6 try: 74.7 - domain.start() 74.8 + domain.start(noConsole=True) 74.9 except DomainError, e: 74.10 if verbose: 74.11 print "Failed to create test domain because:"
75.1 --- a/tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py Thu May 04 14:20:11 2006 +0100 75.2 +++ b/tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py Thu May 04 14:22:17 2006 +0100 75.3 @@ -20,7 +20,7 @@ if smpConcurrencyLevel() <= 1: 75.4 domain = XmTestDomain() 75.5 75.6 try: 75.7 - domain.start() 75.8 + domain.start(noConsole=True) 75.9 except DomainError, e: 75.10 if verbose: 75.11 print "Failed to create test domain because:"
76.1 --- a/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Thu May 04 14:20:11 2006 +0100 76.2 +++ b/tools/xm-test/tests/vtpm/01_vtpm-list_pos.py Thu May 04 14:22:17 2006 +0100 76.3 @@ -16,7 +16,7 @@ config = {"vtpm":"instance=1,backend=0"} 76.4 domain = XmTestDomain(extraConfig=config) 76.5 76.6 try: 76.7 - domain.start() 76.8 + domain.start(noConsole=True) 76.9 except DomainError, e: 76.10 if verbose: 76.11 print e.extra
77.1 --- a/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Thu May 04 14:20:11 2006 +0100 77.2 +++ b/tools/xm-test/tests/vtpm/02_vtpm-cat_pcrs.py Thu May 04 14:22:17 2006 +0100 77.3 @@ -16,7 +16,7 @@ config = {"vtpm":"instance=1,backend=0"} 77.4 domain = XmTestDomain(extraConfig=config) 77.5 77.6 try: 77.7 - domain.start() 77.8 + console = domain.start() 77.9 except DomainError, e: 77.10 if verbose: 77.11 print e.extra 77.12 @@ -26,12 +26,6 @@ except DomainError, e: 77.13 domName = domain.getName() 77.14 77.15 try: 77.16 - console = XmConsole(domain.getName()) 77.17 -except ConsoleError, e: 77.18 - vtpm_cleanup(domName) 77.19 - FAIL(str(e)) 77.20 - 77.21 -try: 77.22 console.sendInput("input") 77.23 except ConsoleError, e: 77.24 saveLog(console.getHistory()) 77.25 @@ -49,7 +43,7 @@ if re.search("No such file",run["output" 77.26 vtpm_cleanup(domName) 77.27 FAIL("TPM frontend support not compiled into (domU?) kernel") 77.28 77.29 -console.closeConsole() 77.30 +domain.closeConsole() 77.31 77.32 domain.stop() 77.33
78.1 --- a/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py Thu May 04 14:20:11 2006 +0100 78.2 +++ b/tools/xm-test/tests/vtpm/03_vtpm-susp_res.py Thu May 04 14:22:17 2006 +0100 78.3 @@ -15,9 +15,10 @@ import os.path 78.4 78.5 config = {"vtpm":"instance=1,backend=0"} 78.6 domain = XmTestDomain(extraConfig=config) 78.7 +consoleHistory = "" 78.8 78.9 try: 78.10 - domain.start() 78.11 + console = domain.start() 78.12 except DomainError, e: 78.13 if verbose: 78.14 print e.extra 78.15 @@ -27,12 +28,6 @@ except DomainError, e: 78.16 domName = domain.getName() 78.17 78.18 try: 78.19 - console = XmConsole(domain.getName()) 78.20 -except ConsoleError, e: 78.21 - vtpm_cleanup(domName) 78.22 - FAIL(str(e)) 78.23 - 78.24 -try: 78.25 console.sendInput("input") 78.26 except ConsoleError, e: 78.27 saveLog(console.getHistory()) 78.28 @@ -50,19 +45,21 @@ if re.search("No such file",run["output" 78.29 vtpm_cleanup(domName) 78.30 FAIL("TPM frontend support not compiled into (domU?) kernel") 78.31 78.32 -console.closeConsole() 78.33 +consoleHistory = console.getHistory() 78.34 +domain.closeConsole() 78.35 78.36 try: 78.37 status, ouptut = traceCommand("xm save %s %s.save" % 78.38 (domName, domName), 78.39 timeout=30) 78.40 + 78.41 except TimeoutError, e: 78.42 - saveLog(console.getHistory()) 78.43 + saveLog(consoleHistory) 78.44 vtpm_cleanup(domName) 78.45 FAIL(str(e)) 78.46 78.47 if status != 0: 78.48 - saveLog(console.getHistory()) 78.49 + saveLog(consoleHistory) 78.50 vtpm_cleanup(domName) 78.51 FAIL("xm save did not succeed") 78.52 78.53 @@ -72,19 +69,19 @@ try: 78.54 timeout=30) 78.55 except TimeoutError, e: 78.56 os.remove("%s.save" % domName) 78.57 - saveLog(console.getHistory()) 78.58 + saveLog(consoleHistory) 78.59 vtpm_cleanup(domName) 78.60 FAIL(str(e)) 78.61 78.62 os.remove("%s.save" % domName) 78.63 78.64 if status != 0: 78.65 - saveLog(console.getHistory()) 78.66 + saveLog(consoleHistory) 78.67 vtpm_cleanup(domName) 78.68 FAIL("xm restore did not succeed") 78.69 78.70 try: 78.71 - console = XmConsole(domain.getName()) 78.72 + console = domain.getConsole() 78.73 except ConsoleError, e: 78.74 vtpm_cleanup(domName) 78.75 FAIL(str(e)) 78.76 @@ -96,7 +93,7 @@ except ConsoleError, e: 78.77 vtpm_cleanup(domName) 78.78 FAIL(str(e)) 78.79 78.80 -console.closeConsole() 78.81 +domain.closeConsole() 78.82 78.83 domain.stop() 78.84
79.1 --- a/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py Thu May 04 14:20:11 2006 +0100 79.2 +++ b/tools/xm-test/tests/vtpm/04_vtpm-loc_migr.py Thu May 04 14:22:17 2006 +0100 79.3 @@ -15,9 +15,10 @@ import os.path 79.4 79.5 config = {"vtpm":"instance=1,backend=0"} 79.6 domain = XmTestDomain(extraConfig=config) 79.7 +consoleHistory = "" 79.8 79.9 try: 79.10 - domain.start() 79.11 + console = domain.start() 79.12 except DomainError, e: 79.13 if verbose: 79.14 print e.extra 79.15 @@ -27,12 +28,6 @@ except DomainError, e: 79.16 domName = domain.getName() 79.17 79.18 try: 79.19 - console = XmConsole(domain.getName()) 79.20 -except ConsoleError, e: 79.21 - vtpm_cleanup(domName) 79.22 - FAIL(str(e)) 79.23 - 79.24 -try: 79.25 console.sendInput("input") 79.26 except ConsoleError, e: 79.27 saveLog(console.getHistory()) 79.28 @@ -50,7 +45,8 @@ if re.search("No such file",run["output" 79.29 vtpm_cleanup(domName) 79.30 FAIL("TPM frontend support not compiled into (domU?) kernel") 79.31 79.32 -console.closeConsole() 79.33 +consoleHistory = console.getHistory() 79.34 +domain.closeConsole() 79.35 79.36 old_domid = domid(domName) 79.37 79.38 @@ -59,12 +55,12 @@ try: 79.39 domName, 79.40 timeout=90) 79.41 except TimeoutError, e: 79.42 - saveLog(console.getHistory()) 79.43 + saveLog(consoleHistory) 79.44 vtpm_cleanup(domName) 79.45 FAIL(str(e)) 79.46 79.47 if status != 0: 79.48 - saveLog(console.getHistory()) 79.49 + saveLog(consoleHistory) 79.50 vtpm_cleanup(domName) 79.51 FAIL("xm migrate did not succeed. External device migration activated?") 79.52 79.53 @@ -77,7 +73,7 @@ if (old_domid == new_domid): 79.54 FAIL("xm migrate failed, domain id is still %s" % old_domid) 79.55 79.56 try: 79.57 - console = XmConsole(domain.getName()) 79.58 + console = domain.getConsole() 79.59 except ConsoleError, e: 79.60 vtpm_cleanup(domName) 79.61 FAIL(str(e)) 79.62 @@ -89,7 +85,7 @@ except ConsoleError, e: 79.63 vtpm_cleanup(domName) 79.64 FAIL(str(e)) 79.65 79.66 -console.closeConsole() 79.67 +domain.closeConsole() 79.68 79.69 domain.stop() 79.70