# xxx quick n dirty
def run_in_guest_piped (self,local,remote):
- return utils.system(local+" | "+self.test_ssh.actual_command(self.host_to_guest(remote)))
+ return utils.system(local+" | "+self.test_ssh.actual_command(self.host_to_guest(remote),keep_stdin=True))
def auth_root (self):
return {'Username':self.plc_spec['PLC_ROOT_USER'],
return "%s@%s"%(self.username,self.hostname)
# command gets run on the right box
- def actual_command (self, command):
+ def actual_command (self, command,keep_stdin=False):
if self.is_local():
return command
ssh_command = "ssh "
+ if not keep_stdin:
+ ssh_command += "-n "
ssh_command += TestSsh.std_options
ssh_command += self.key_part()
ssh_command += "%s %s" %(self.hostname_part(),TestSsh.backslash_shell_specials(command))
# figure if TestMain succeeds, as the retcod gets lost in the pipe
rm -f logs/success
-(python -u TestMain.py "$@" && touch logs/success) | tee $logfile
+python -u TestMain.py "$@" &> $logfile && touch logs/success
+cat $logfile
if [ -f logs/success ] ; then
exit 0
# $Id$
COMMAND=$(basename $0)
cd $(dirname $0)
+THISNODE=$(basename $(pwd -P) | sed -e s,qemu-,,)
cd ..
# somehow qemu-system-x86_64 show up in pgrep as qemu-system-x86
echo " lists current qemu processes"
echo "usage: $COMMAND hostname"
echo " kill qemu instance for that node"
+ echo "usage: $COMMAND this"
+ echo " kill qemu instance that was started in this directory"
echo "usage: $COMMAND"
echo " kill all instances of [$COMMANDS_TO_KILL]"
exit 1
hostnames="$@"
if [[ -n "$hostnames" ]] ; then
for hostname in $hostnames; do
+ [ $hostname == this ] && hostname=$THISNODE
nodedir=qemu-$hostname
cat $nodedir/qemu.pid 2> /dev/null
done
hostnames="$@"
if [[ -n "$hostnames" ]] ; then
for hostname in $hostnames; do
+ [ $hostname == this ] && hostname=$THISNODE
nodedir=qemu-$hostname
kill_from_file $nodedir/qemu.pid
done
while getopts "lk" opt; do
case $opt in
l) OPT_LIST=true ;;
- k) OPT_GREP=true ;;
*) usage ;;
esac
done
#!/bin/bash
# cd in this command's directory
+COMMAND=$(basename $0)
cd $(dirname $0)
########## globals
x86_64+x86_64) QEMU=qemu-system-x86_64;;
esac
+echo "Running $COMMAND in $(pwd)"
+echo "Starting at $(date)"
+
#Creating new HDA if needed only
#using qcow2 disk image format which is essential to support VM snapshots
if [ -f $HDA ] ; then