tests: Use a single timestamp in all vm-run.sh instances

This avoids possible mismatches in directory and log file timestamps if
the UNIX timestamp (seconds) changes during the startup sequence.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-11-16 22:24:18 +02:00
parent 7613345814
commit 7e6942253c
3 changed files with 10 additions and 4 deletions

View File

@ -129,7 +129,8 @@ def main():
vm = {}
for i in range(0, num_servers):
print("\rStarting virtual machine {}/{}".format(i + 1, num_servers)),
cmd = ['./vm-run.sh', '--ext', 'srv.%d' % (i + 1),
cmd = ['./vm-run.sh', '--timestamp', str(timestamp),
'--ext', 'srv.%d' % (i + 1),
'--split', '%d/%d' % (i + 1, num_servers)] + sys.argv[2:]
vm[i] = {}
vm[i]['proc'] = subprocess.Popen(cmd,

View File

@ -15,7 +15,7 @@ DATE=$(date +%s)
for i in `seq 1 $NUM`; do
printf "\rStarting virtual machine $i/$NUM"
./vm-run.sh --ext srv.$i --split $i/$NUM $* >> $LOGS/parallel-$DATE.srv.$i 2>&1 &
./vm-run.sh --timestamp $DATE --ext srv.$i --split $i/$NUM $* >> $LOGS/parallel-$DATE.srv.$i 2>&1 &
done
echo

View File

@ -43,13 +43,18 @@ fi
CMD=$TESTDIR/vm/inside.sh
unset RUN_TEST_ARGS
DATE=$(date +%s)
TIMESTAMP=$(date +%s)
DATE=$TIMESTAMP
CODECOV=no
TIMEWARP=0
while [ "$1" != "" ]; do
case $1 in
--timestamp ) shift
TIMESTAMP=$1
shift
;;
--ext ) shift
DATE=$(date +%s).$1
DATE=$TIMESTAMP.$1
shift
;;
--codecov ) shift