ia64/xen-unstable

view tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py @ 8151:f4c57a520424

Enable console debug dumping so that we submit the oops generated by
network-detach to the reporting site.
author dan@guaranine.beaverton.ibm.com
date Wed Nov 30 11:41:33 2005 +0000 (2005-11-30)
parents 1d754a4ad350
children 30f54abf9592
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Murillo F. Bernardes <mfb@br.ibm.com>
6 import sys
7 import re
8 import time
10 from XmTestLib import *
11 from network_utils import *
13 # Create a domain (default XmTestDomain, with our ramdisk)
14 domain = XmTestDomain()
16 try:
17 domain.start()
18 except DomainError, e:
19 if verbose:
20 print "Failed to create test domain because:"
21 print e.extra
22 FAIL(str(e))
24 # Attach a console to it
25 try:
26 console = XmConsole(domain.getName(), historySaveCmds=True)
27 # network-detach is crashing, so we enable console debugging
28 # for now, so that reports include the oops
29 console.debugMe = True
30 except ConsoleError, e:
31 FAIL(str(e))
33 try:
34 # Activate the console
35 console.sendInput("input")
36 # Run 'ls'
37 run = console.runCmd("ls")
38 except ConsoleError, e:
39 saveLog(console.getHistory())
40 FAIL(str(e))
42 for i in range(10):
43 print "Attaching %d device" % i
44 status, msg = network_attach(domain.getName(), console)
45 if status:
46 FAIL(msg)
48 print "Detaching %d device" % i
49 status, msg = network_detach(domain.getName(), console, i)
50 if status:
51 FAIL(msg)
53 # Close the console
54 console.closeConsole()
56 # Stop the domain (nice shutdown)
57 domain.stop()