]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use a single timestamp in all vm-run.sh instances
authorJouni Malinen <j@w1.fi>
Sun, 16 Nov 2014 20:24:18 +0000 (22:24 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 16 Nov 2014 20:24:18 +0000 (22:24 +0200)
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>
tests/hwsim/vm/parallel-vm.py
tests/hwsim/vm/parallel-vm.sh
tests/hwsim/vm/vm-run.sh

index 42083f761cd67e3e421d5dc5ce467bff2fb12736..6436c341cf8778776b02c8edcca1132247601faf 100755 (executable)
@@ -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,
index 9074b82e598952948ea190f6ded8e903d04aa8f5..b2fd0786fd7b9a30bced7863097f05625c7ffbce 100755 (executable)
@@ -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
 
index 762651695e491d86e5dd3f6c17f0dbdc7d8c0897..478690a9cbd23da6cce25203924c95e7a3e0cf71 100755 (executable)
@@ -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