2014-05-15 16:50:51 +02:00
|
|
|
#!/bin/bash
|
2014-03-24 00:35:58 +01:00
|
|
|
|
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
|
|
|
NUM=$1
|
|
|
|
if [ -z "$NUM" ]; then
|
|
|
|
echo "usage: $0 <num servers> [params..]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
|
2015-11-24 17:39:58 +01:00
|
|
|
if [ -n "$HWSIM_TEST_LOG_DIR" ] ; then
|
|
|
|
LOGS="$HWSIM_TEST_LOG_DIR"
|
|
|
|
else
|
|
|
|
LOGS=/tmp/hwsim-test-logs
|
|
|
|
fi
|
2014-03-24 00:35:58 +01:00
|
|
|
mkdir -p $LOGS
|
|
|
|
DATE=$(date +%s)
|
|
|
|
|
|
|
|
for i in `seq 1 $NUM`; do
|
2014-05-15 16:50:51 +02:00
|
|
|
printf "\rStarting virtual machine $i/$NUM"
|
2014-11-16 21:24:18 +01:00
|
|
|
./vm-run.sh --timestamp $DATE --ext srv.$i --split $i/$NUM $* >> $LOGS/parallel-$DATE.srv.$i 2>&1 &
|
2014-03-24 00:35:58 +01:00
|
|
|
done
|
2014-05-15 16:50:51 +02:00
|
|
|
echo
|
2014-03-24 00:35:58 +01:00
|
|
|
|
|
|
|
echo "Waiting for virtual machines to complete testing"
|
2014-05-15 16:50:51 +02:00
|
|
|
count=$NUM
|
|
|
|
for i in `seq 1 $NUM`; do
|
|
|
|
printf "\r$count VM(s) remaining "
|
|
|
|
wait -n
|
|
|
|
count=$((count-1))
|
|
|
|
done
|
|
|
|
printf "\rTesting completed "
|
|
|
|
echo
|
2014-03-24 00:35:58 +01:00
|
|
|
|
|
|
|
echo -n "PASS count: "
|
|
|
|
grep ^PASS $LOGS/parallel-$DATE.srv.* | wc -l
|
|
|
|
cat $LOGS/parallel-$DATE.srv.* | grep FAIL | sort
|