]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: don't download files in tests
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 5 Feb 2016 09:47:16 +0000 (10:47 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 5 Feb 2016 14:20:40 +0000 (15:20 +0100)
Remove automatic download and compilation of clknetsim. If clknetsim is
not found, skip all simulation tests, but don't fail "make check".
Also, respect the CLKNETSIM_PATH environment variable.

test/simulation/README
test/simulation/run
test/simulation/test.common

index c875ad6b138e15ffe19dcee17370875d30002f70..e174500adbeb5c6572a981994552072a646e5ed3 100644 (file)
@@ -1,12 +1,11 @@
-This is a collection of simulation tests. They use clknetsim to simulate
-multiple systems connected in a network. It's available at
+This is a collection of simulation tests using the clknetsim simulator
+(supported on Linux only).
 
 https://github.com/mlichvar/clknetsim
 
-If this directory doesn't have a clknetsim subdirectory, a known working
-revision will be downloaded and compiled automatically.
-
-Currently it runs only on Linux.
+The CLKNETSIM_PATH environment variable should point to the directory where
+clknetsim was downloaded and compiled. If the variable is not set, the tests
+will look for clknetsim in ./clknetsim in the current directory.
 
 The tests are written in bash and they can be run directly. The ./run script
 runs all tests.
index cd7b6804d015c7ea85dbc50e83a598c391e480a7..a177c8360a94015b01bda7286ec963bf4b266d85 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-. test.common
-
 passed=() failed=() skipped=()
 
 [ $# -gt 0 ] && tests=($@) || tests=([0-9]*-*[^_])
index fbde8205237fdf004f2285d3559790cb5e459eff..0a940219744a65c1144ddd152d7a04bb398cf83a 100644 (file)
 
 export LC_ALL=C
 export PATH=../../:$PATH
-export CLKNETSIM_PATH=clknetsim
+export CLKNETSIM_PATH=${CLKNETSIM_PATH:-clknetsim}
 
-# Known working clknetsim revision
-clknetsim_revision=1e56224dee1db69c0027e9bd63c2a202d4765959
-clknetsim_url=https://github.com/mlichvar/clknetsim/archive/$clknetsim_revision.tar.gz
-
-# Only Linux is supported
-if [ "$(uname -s)" != Linux ]; then
-       echo "Simulation tests supported only on Linux"
-       exit 3
-fi
-
-# Try to download clknetsim if not found
-if [ ! -e $CLKNETSIM_PATH ]; then
-       curl -L "$clknetsim_url" | tar xz || exit 3
-       ln -s clknetsim-$clknetsim_revision clknetsim || exit 3
-fi
-
-# Try to build clknetsim if not built
-if [ ! -x $CLKNETSIM_PATH/clknetsim -o ! -e $CLKNETSIM_PATH/clknetsim.so ]; then
-       make -C clknetsim || exit 3
+if [ ! -x $CLKNETSIM_PATH/clknetsim ]; then
+       echo "SKIP (clknetsim not found)"
+       exit 9
 fi
 
 . $CLKNETSIM_PATH/clknetsim.bash