git://git.onelab.eu
/
tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3babd96
)
attempt to avoid remote qemus from hanging
author
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Wed, 2 Apr 2008 06:31:27 +0000
(06:31 +0000)
committer
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Wed, 2 Apr 2008 06:31:27 +0000
(06:31 +0000)
system/TestBox.py
patch
|
blob
|
history
system/TestNode.py
patch
|
blob
|
history
system/TestSsh.py
patch
|
blob
|
history
system/template-qemu/kill-qemu-node
patch
|
blob
|
history
system/template-qemu/start-qemu-node
patch
|
blob
|
history
diff --git
a/system/TestBox.py
b/system/TestBox.py
index
35de00c
..
5c25fcd
100644
(file)
--- a/
system/TestBox.py
+++ b/
system/TestBox.py
@@
-5,6
+5,7
@@
import os.path
import utils
from TestSsh import TestSsh
import utils
from TestSsh import TestSsh
+# xxx this should probably inherit TestSsh
class TestBox:
def __init__(self,hostname,buildname,key=None):
class TestBox:
def __init__(self,hostname,buildname,key=None):
@@
-26,9
+27,9
@@
class TestBox:
return True
return False
return True
return False
- def run_in_buildname (self,command):
+ def run_in_buildname (self,command
,background=False
):
utils.header("Running command %s on testbox %s"%(command,self.hostname()))
utils.header("Running command %s on testbox %s"%(command,self.hostname()))
- return self.test_ssh.run_in_buildname (command)
+ return self.test_ssh.run_in_buildname (command
,background
)
# should use rsync instead
def copy (self,local_file,recursive=False):
# should use rsync instead
def copy (self,local_file,recursive=False):
@@
-37,8
+38,8
@@
class TestBox:
def clean_dir (self,dirname):
return self.test_ssh.clean_dir(dirname)
def clean_dir (self,dirname):
return self.test_ssh.clean_dir(dirname)
- def mkdir (self,dir
e
name):
- return self.test_ssh.mkdir(dir
e
name)
+ def mkdir (self,dirname):
+ return self.test_ssh.mkdir(dirname)
def kill_all_qemus(self):
self.run_in_buildname("template-qemu/kill-qemu-node")
def kill_all_qemus(self):
self.run_in_buildname("template-qemu/kill-qemu-node")
diff --git
a/system/TestNode.py
b/system/TestNode.py
index
0624269
..
2bc232a
100644
(file)
--- a/
system/TestNode.py
+++ b/
system/TestNode.py
@@
-157,7
+157,8
@@
class TestNode:
utils.header("Starting qemu node %s on %s"%(self.name(),test_box.hostname()))
test_box.run_in_buildname("qemu-%s/env-qemu start >> nodeslogs/%s.log"%(self.name(),self.name()))
utils.header("Starting qemu node %s on %s"%(self.name(),test_box.hostname()))
test_box.run_in_buildname("qemu-%s/env-qemu start >> nodeslogs/%s.log"%(self.name(),self.name()))
- test_box.run_in_buildname("qemu-%s/start-qemu-node 2>&1 >> nodeslogs/%s.log &"%(self.name(),self.name()))
+ # kick it off in background, as it would otherwise hang
+ test_box.run_in_buildname("qemu-%s/start-qemu-node 2>&1 >> nodeslogs/%s.log &"%(self.name(),self.name()),True)
def list_qemu (self):
utils.header("Listing qemu for host %s on box %s"%(self.name(),self.test_box().hostname()))
def list_qemu (self):
utils.header("Listing qemu for host %s on box %s"%(self.name(),self.test_box().hostname()))
diff --git
a/system/TestSsh.py
b/system/TestSsh.py
index
603b63e
..
d504422
100644
(file)
--- a/
system/TestSsh.py
+++ b/
system/TestSsh.py
@@
-58,8
+58,11
@@
class TestSsh:
ssh_command += "%s %s" %(self.hostname,TestSsh.backslash_shell_specials(command))
return ssh_command
ssh_command += "%s %s" %(self.hostname,TestSsh.backslash_shell_specials(command))
return ssh_command
- def run(self, command):
- return utils.system(self.actual_command(command))
+ def run(self, command,background=False):
+ local_command = self.actual_command(command)
+ if background:
+ local_command += " &"
+ return utils.system(local_command)
def clean_dir (self,dirname):
if self.is_local():
def clean_dir (self,dirname):
if self.is_local():
@@
-87,11
+90,11
@@
class TestSsh:
self.mkdir()
self.buildname_created=True
self.mkdir()
self.buildname_created=True
- def run_in_buildname (self,command):
+ def run_in_buildname (self,command
, background=False
):
if self.is_local():
return utils.system(command)
self.create_buildname_once()
if self.is_local():
return utils.system(command)
self.create_buildname_once()
- return self.run("cd %s ; %s"%(self.buildname,command))
+ return self.run("cd %s ; %s"%(self.buildname,command)
,background
)
def copy (self,local_file,recursive=False):
if self.is_local():
def copy (self,local_file,recursive=False):
if self.is_local():
diff --git
a/system/template-qemu/kill-qemu-node
b/system/template-qemu/kill-qemu-node
index
27a2317
..
0ac501e
100755
(executable)
--- a/
system/template-qemu/kill-qemu-node
+++ b/
system/template-qemu/kill-qemu-node
@@
-17,7
+17,7
@@
function list_pids () {
if [[ -n "$hostnames" ]] ; then
for hostname in $hostnames; do
nodedir=qemu-$hostname
if [[ -n "$hostnames" ]] ; then
for hostname in $hostnames; do
nodedir=qemu-$hostname
- cat $nodedir/qemu.pid
$nodedir/shell.pid
2> /dev/null
+ cat $nodedir/qemu.pid 2> /dev/null
done
else
pgrep qemu
done
else
pgrep qemu
@@
-40,7
+40,6
@@
function kill_pids () {
for hostname in $hostnames; do
nodedir=qemu-$hostname
kill_from_file $nodedir/qemu.pid
for hostname in $hostnames; do
nodedir=qemu-$hostname
kill_from_file $nodedir/qemu.pid
- kill_from_file $nodedir/shell.pid
done
else
echo Killing all processes mathing qemu
done
else
echo Killing all processes mathing qemu
diff --git
a/system/template-qemu/start-qemu-node
b/system/template-qemu/start-qemu-node
index
377ff5f
..
b138531
100755
(executable)
--- a/
system/template-qemu/start-qemu-node
+++ b/
system/template-qemu/start-qemu-node
@@
-39,6
+39,5
@@
rm -f qemu.pid
#Command for running the Qemu Emulator
ARGS="-boot d -net nic,macaddr=${MACADDR} -net $TAP, -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -nographic -pidfile qemu.pid"
#Command for running the Qemu Emulator
ARGS="-boot d -net nic,macaddr=${MACADDR} -net $TAP, -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -nographic -pidfile qemu.pid"
-echo $$ > shell.pid
echo "Running $QEMU $ARGS < /dev/null"
exec $QEMU $ARGS < /dev/null
echo "Running $QEMU $ARGS < /dev/null"
exec $QEMU $ARGS < /dev/null