* reset-host [cf] [JOB]
- Allow a job which has been run before to run on a different host
- next time. Otherwise osstest will complain if you change the host
- which a job is running on on successive runs.
+ Allow a job which has been run before to run on a different host or
+ hosts next time. Otherwise osstest will complain if you change the
+ host(s) which a job is running on on successive runs.
Options:
-c FILE, --config=FILE Use FILE as configuration file
-f FLIGHT, --flight=FLIGHT Operate on FLIGHT
--h HOST, --host=HOST Test host
+-h HOST, --host=HOST Test host, HOST can also be ident=HOST can
+ be given multiple times, not that the
+ order matters in some cases (e.g run-test)
-r, --reuse Do not wipe test host (default)
-R, --noreuse, --reinstall Wipe the test host (if job or test does so)
-s, --simulate, --dry-run Dry run, printing what would be run
config=$HOME/.xen-osstest/config
fi
flight="standalone"
-host=
+hosts=
reuse=1 # Don't blow away machines by default
dryrun=0
lvextendmax=50 # Leave some LVM space free for running tests
nobaseline=y
+add_host() {
+ local h=$1
+ case $h in
+ *=*)
+ local ident=${h/=*}
+ h=${h/*=}
+ hosts="$hosts $ident=$h"
+ ;;
+ *)
+ hosts="$hosts host=$h"
+ ;;
+ esac
+}
+
+export_hosts_environ() {
+ for h in $hosts ; do
+ local ident=${h/=*}
+ h=${h/*=}
+ eval export OSSTEST_HOST_${ident^^}=$h
+ done
+}
+
while true ; do
case "$1" in
-c|--config) config=$2; shift 2;;
-f|--flight) flight=$2; shift 2;;
- -h|--host) host=$2; shift 2;;
+ -h|--host) add_host $2; shift 2;;
-r|--reuse) reuse=1; shift 1;;
-R|--noreuse|--reinstall)reuse=0;shift 1;;
-s|--simulate|--dry-run)dryrun=1;shift 1;;
fi
if [ $reuse -eq 0 ]; then
- echo "WARNING: Will blow away machine..."
+ echo "WARNING: Will blow away machine(s)..."
echo "Press ENTER to confirm."
read
fi
fi
}
need_host() {
- if [ -z "$host" ] ; then
+ if [ "x$hosts" = x ] ; then
echo "run-job: Need a host" >&2
exit 1
fi
fi
job=$1; shift
- ./cs-adjust-flight -v $flight runvar-del $job host
+ ./cs-adjust-flight -v $flight runvar-del $job '/(?:\w+_)?host$'
;;
run-job)
job=$1; shift
+ export_hosts_environ
+
OSSTEST_CONFIG=$config \
OSSTEST_FLIGHT=$flight \
- OSSTEST_HOST_HOST=$host \
OSSTEST_HOST_REUSE=$reuse \
OSSTEST_SIMULATE=$dryrun \
with_logging logs/$flight/$job.log ./sg-run-job $job
OSSTEST_FLIGHT=$flight \
OSSTEST_HOST_REUSE=$reuse \
OSSTEST_JOB=$job \
- with_logging logs/$flight/$job.$ts.log ./$ts host=$host $@
+ with_logging logs/$flight/$job.$ts.log ./$ts $hosts $@
;;
*)
echo "Unknown op $op" ; exit 1 ;;