debuggers.hg

view tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
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 XmTestLib.network_utils import *
13 if ENABLE_HVM_SUPPORT:
14 SKIP("Network-attach not supported for HVM domains")
16 # Create a domain (default XmTestDomain, with our ramdisk)
17 domain = XmTestDomain()
19 try:
20 console = domain.start()
21 except DomainError, e:
22 if verbose:
23 print "Failed to create test domain because:"
24 print e.extra
25 FAIL(str(e))
27 console.debugMe = True
29 try:
30 # Run 'ls'
31 run = console.runCmd("ls")
32 except ConsoleError, e:
33 saveLog(console.getHistory())
34 FAIL(str(e))
36 for i in range(10):
37 print "Attaching %d device" % i
38 status, msg = network_attach(domain.getName(), console)
39 if status:
40 FAIL(msg)
42 print "Detaching %d device" % i
43 status, msg = network_detach(domain.getName(), console, i)
44 if status:
45 FAIL(msg)
47 # Close the console
48 domain.closeConsole()
50 # Stop the domain (nice shutdown)
51 domain.stop()