ZeroTierOne/netcon/docker-test/test.sh

39 lines
772 B
Bash
Raw Normal View History

#!/bin/bash
# Runs test images
echo "*** Running unit tests..."
# Remove previous test results
rm _results/*.txt
# How long we shall wait for each test to conclude
2015-12-04 02:50:20 +00:00
export netcon_test_wait_time=60s
# Test structure, in later releases more complex multi-party scripts will be included
2015-12-04 23:39:35 +00:00
export test_script=_two_party_test.sh
# Iterate over all depth=2 (relatively-speaking) directories and perform each test
find . -mindepth 2 -maxdepth 2 -type d | while read testdir; do
if [[ $testdir != *$1* ]]
then
continue
fi
2015-12-07 06:37:23 +00:00
echo "*** Testing: '$testdir'..."
rm _results/*.tmp
# Stage scripts
cp $test_script $testdir/$test_script
cd $testdir
# Run test
./$test_script
rm $test_script
cd ../../
done
echo "*** Done"