blob: ef52ffc48a2b49426d209953ef2966c0cd09dd0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Authors: Dan Smith <danms@us.ibm.com>
from XmTestLib import *
import os
import time
rdpath = getRdPath()
# status, output = traceCommand("losetup -f %s" % rdpath)
# if status != 0:
# FAIL("Unable to get a free loop device")
#
# if verbose:
# print "Using %s" % output
if ENABLE_HVM_SUPPORT:
domain = XmTestDomain(name="14_create_blockroot")
else:
config = {"memory" : "64",
"root" : "/dev/hda1",
"name" : "14_create_blockroot",
"kernel" : getDefaultKernel(),
"disk" : "file:%s/initrd.img,hda1,w" % rdpath
}
domConfig = XenConfig()
domConfig.setOpts(config)
domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig)
try:
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:
saveLog(console.getHistory())
FAIL(str(e))
if run["return"] != 0:
FAIL("DomU 'ls' failed")
|