testing: Use an on-guest script to cleanup/initialize and run them in parallel
This is a bit quicker than doing this with separate SSH calls for each host sequentially (up to half a second per test).
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
#! /bin/bash
|
||||
|
||||
while getopts "i:d:" opt
|
||||
do
|
||||
case "$opt" in
|
||||
i)
|
||||
INTERFACE=${OPTARG}
|
||||
;;
|
||||
d)
|
||||
DB=${OPTARG}
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
# start tcpdump in the background
|
||||
if [ -n "$INTERFACE" ]
|
||||
then
|
||||
tcpdump -l --immediate-mode -i $INTERFACE not port ssh and not port domain >/tmp/tcpdump.log 2>/tmp/tcpdump.err.log &
|
||||
fi
|
||||
|
||||
# setup ramdisk for databases
|
||||
if [ -n "$DB" ]
|
||||
then
|
||||
mkdir -p $DB
|
||||
mount -t ramfs -o size=5m ramfs $DB
|
||||
chgrp www-data $DB
|
||||
chmod g+w $DB
|
||||
fi
|
||||
|
||||
# flush conntrack table
|
||||
conntrack -F >/dev/null 2>&1
|
||||
|
||||
# flush IPsec state
|
||||
ip xfrm state flush
|
||||
ip xfrm policy flush
|
||||
|
||||
# remove leak detective log
|
||||
rm -f $LEAK_DETECTIVE_LOG
|
||||
Reference in New Issue
Block a user