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:
3f525ac
)
quick fix for qemu start/stop on remote testboxes
author
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Mon, 7 Apr 2008 21:10:54 +0000
(21:10 +0000)
committer
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Mon, 7 Apr 2008 21:10:54 +0000
(21:10 +0000)
system/TestBox.py
patch
|
blob
|
history
system/TestPlc.py
patch
|
blob
|
history
system/template-qemu/qemu-kill-node
patch
|
blob
|
history
system/template-qemu/qemu-start-node
patch
|
blob
|
history
diff --git
a/system/TestBox.py
b/system/TestBox.py
index
978344c
..
773a914
100644
(file)
--- a/
system/TestBox.py
+++ b/
system/TestBox.py
@@
-34,8
+34,9
@@
class TestBox:
def mkdir (self,dirname):
return self.test_ssh.mkdir(dirname)
def mkdir (self,dirname):
return self.test_ssh.mkdir(dirname)
- def kill_all_qemus(self):
- self.run_in_buildname("template-qemu/qemu-kill-node")
+ # we need at least one nodename, as template-qemu is not synced on remote testboxes
+ def kill_all_qemus(self,nodename):
+ self.run_in_buildname("qemu-%s/qemu-kill-node"%nodename)
return True
def list_all_qemus(self):
return True
def list_all_qemus(self):
diff --git
a/system/TestPlc.py
b/system/TestPlc.py
index
112b993
..
df4d431
100644
(file)
--- a/
system/TestPlc.py
+++ b/
system/TestPlc.py
@@
-181,7
+181,7
@@
class TestPlc:
test_node = TestNode (self, test_site, node_spec)
if not test_node.is_real():
tuples.append( (test_node.host_box(),test_node) )
test_node = TestNode (self, test_site, node_spec)
if not test_node.is_real():
tuples.append( (test_node.host_box(),test_node) )
- # transform into a dict { 'host_box' -> [
hostnames
.. ] }
+ # transform into a dict { 'host_box' -> [
test_node
.. ] }
result = {}
for (box,node) in tuples:
if not result.has_key(box):
result = {}
for (box,node) in tuples:
if not result.has_key(box):
@@
-198,9
+198,11
@@
class TestPlc:
# make this a valid step
def kill_all_qemus(self):
# make this a valid step
def kill_all_qemus(self):
+ # this is the brute force version, kill all qemus on that host box
for (box,nodes) in self.gather_hostBoxes().iteritems():
for (box,nodes) in self.gather_hostBoxes().iteritems():
- # this is the brute force version, kill all qemus on that host box
- TestBox(box,self.options.buildname).kill_all_qemus()
+ # pass the first nodename, as we don't push template-qemu on testboxes
+ nodename=nodes[0].name()
+ TestBox(box,self.options.buildname).kill_all_qemus(nodename)
return True
# make this a valid step
return True
# make this a valid step
diff --git
a/system/template-qemu/qemu-kill-node
b/system/template-qemu/qemu-kill-node
index
830d33d
..
a4a00d0
100755
(executable)
--- a/
system/template-qemu/qemu-kill-node
+++ b/
system/template-qemu/qemu-kill-node
@@
-4,11
+4,16
@@
COMMAND=$(basename $0)
cd $(dirname $0)
cd ..
cd $(dirname $0)
cd ..
+# somehow qemu-system-x86_64 show up in pgrep as qemu-system-x86
+COMMANDS_TO_KILL="qemu qemu-system-x86_64 qemu-system-x86"
+
function usage () {
echo "Usage: $COMMAND -l"
echo " lists current qemu processes"
echo "usage: $COMMAND hostname"
echo " kill qemu instance for that node"
function usage () {
echo "Usage: $COMMAND -l"
echo " lists current qemu processes"
echo "usage: $COMMAND hostname"
echo " kill qemu instance for that node"
+ echo "usage: $COMMAND"
+ echo " kill all instances of [$COMMANDS_TO_KILL]"
exit 1
}
exit 1
}
@@
-20,7
+25,9
@@
function list_pids () {
cat $nodedir/qemu.pid 2> /dev/null
done
else
cat $nodedir/qemu.pid 2> /dev/null
done
else
- pgrep qemu
+ for command in $COMMANDS_TO_KILL; do
+ pgrep -x $command
+ done
fi
}
fi
}
@@
-44,8
+51,10
@@
function kill_pids () {
kill_from_file $nodedir/qemu.pid
done
else
kill_from_file $nodedir/qemu.pid
done
else
- echo Killing all processes mathing qemu
- pkill qemu
+ echo "Killing all processes mathing $COMMANDS_TO_KILL"
+ for command in $COMMANDS_TO_KILL ; do
+ pkill -x $command
+ done
fi
}
fi
}
diff --git
a/system/template-qemu/qemu-start-node
b/system/template-qemu/qemu-start-node
index
c0606f0
..
29f465c
100755
(executable)
--- a/
system/template-qemu/qemu-start-node
+++ b/
system/template-qemu/qemu-start-node
@@
-22,6
+22,7
@@
fi
. $CONFIG
# the launcher, depending on local/target archs
. $CONFIG
# the launcher, depending on local/target archs
+# make sure to check qemu-kill-node for consistency
archs="$(uname -i)+$TARGET_ARCH"
case $archs in
i386+i386) QEMU=qemu;;
archs="$(uname -i)+$TARGET_ARCH"
case $archs in
i386+i386) QEMU=qemu;;