test: don't download files in tests
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.
This commit is contained in:
parent
cf5b344ea8
commit
8b676502de
3 changed files with 9 additions and 28 deletions
|
@ -1,12 +1,11 @@
|
||||||
This is a collection of simulation tests. They use clknetsim to simulate
|
This is a collection of simulation tests using the clknetsim simulator
|
||||||
multiple systems connected in a network. It's available at
|
(supported on Linux only).
|
||||||
|
|
||||||
https://github.com/mlichvar/clknetsim
|
https://github.com/mlichvar/clknetsim
|
||||||
|
|
||||||
If this directory doesn't have a clknetsim subdirectory, a known working
|
The CLKNETSIM_PATH environment variable should point to the directory where
|
||||||
revision will be downloaded and compiled automatically.
|
clknetsim was downloaded and compiled. If the variable is not set, the tests
|
||||||
|
will look for clknetsim in ./clknetsim in the current directory.
|
||||||
Currently it runs only on Linux.
|
|
||||||
|
|
||||||
The tests are written in bash and they can be run directly. The ./run script
|
The tests are written in bash and they can be run directly. The ./run script
|
||||||
runs all tests.
|
runs all tests.
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. test.common
|
|
||||||
|
|
||||||
passed=() failed=() skipped=()
|
passed=() failed=() skipped=()
|
||||||
|
|
||||||
[ $# -gt 0 ] && tests=($@) || tests=([0-9]*-*[^_])
|
[ $# -gt 0 ] && tests=($@) || tests=([0-9]*-*[^_])
|
||||||
|
|
|
@ -15,27 +15,11 @@
|
||||||
|
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
export PATH=../../:$PATH
|
export PATH=../../:$PATH
|
||||||
export CLKNETSIM_PATH=clknetsim
|
export CLKNETSIM_PATH=${CLKNETSIM_PATH:-clknetsim}
|
||||||
|
|
||||||
# Known working clknetsim revision
|
if [ ! -x $CLKNETSIM_PATH/clknetsim ]; then
|
||||||
clknetsim_revision=1e56224dee1db69c0027e9bd63c2a202d4765959
|
echo "SKIP (clknetsim not found)"
|
||||||
clknetsim_url=https://github.com/mlichvar/clknetsim/archive/$clknetsim_revision.tar.gz
|
exit 9
|
||||||
|
|
||||||
# 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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. $CLKNETSIM_PATH/clknetsim.bash
|
. $CLKNETSIM_PATH/clknetsim.bash
|
||||||
|
|
Loading…
Reference in a new issue