aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test/lib/XmTestLib/Console.py
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2006-05-04 14:22:17 +0100
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2006-05-04 14:22:17 +0100
commit57a3f4ca825815cc639277ab1837984f88db0de8 (patch)
tree76d32769bee61916b490d03b9f7c3060701f3008 /tools/xm-test/lib/XmTestLib/Console.py
parent5b27032111166746826173d742c2e711918e41fc (diff)
downloadxen-57a3f4ca825815cc639277ab1837984f88db0de8.tar.gz
xen-57a3f4ca825815cc639277ab1837984f88db0de8.tar.bz2
xen-57a3f4ca825815cc639277ab1837984f88db0de8.zip
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>
Diffstat (limited to 'tools/xm-test/lib/XmTestLib/Console.py')
-rwxr-xr-xtools/xm-test/lib/XmTestLib/Console.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/xm-test/lib/XmTestLib/Console.py b/tools/xm-test/lib/XmTestLib/Console.py
index 695106be60..7a6a74548c 100755
--- a/tools/xm-test/lib/XmTestLib/Console.py
+++ b/tools/xm-test/lib/XmTestLib/Console.py
@@ -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"])