Browse Source

(fixed) nwid detection in test script

pull/1/head
Joseph Henry 10 years ago
parent
commit
2196d982c3
  1. 4
      netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh
  2. 5
      netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh
  3. 4
      netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/monitor_entrypoint.sh
  4. 2
      netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/netcon_entrypoint.sh
  5. 4
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/monitor_entrypoint.sh
  6. 2
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/netcon_entrypoint.sh
  7. 4
      netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/monitor_entrypoint.sh
  8. 2
      netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/netcon_entrypoint.sh
  9. 2
      netcon/docker-test/nodejs/nodejs-0.10.36-4.fc23/netcon_entrypoint.sh
  10. 2
      netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/netcon_entrypoint.sh
  11. 2
      netcon/docker-test/sshd/openssh-server-7.1p1-3.fc23.x86_64/netcon_entrypoint.sh
  12. 41
      netcon/docker-test/sshd/openssh-server-7.1p1-3.fc23.x86_64/two_party_test.sh
  13. 2
      netcon/docker-test/test.sh

4
netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh

@ -8,8 +8,8 @@ test_namefile=$(ls *.name)
test_name="${test_namefile%.*}" # test network id
nwconf=$(ls *.conf) # blank test network config file
nwid="${nwconf%.*}" # test network id
netcon_wait_time=25 # wait for test container to come online
app_timeout_time=15 # app-specific timeout
netcon_wait_time=35 # wait for test container to come online
app_timeout_time=25 # app-specific timeout
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
file_base="$test_name".txt # test result output file
fail=FAIL. # appended to result file in event of failure

5
netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh

@ -16,7 +16,6 @@ bigfile_name=bigfile
bigfile_size=10M # size of file we want to use for the test
tx_md5sumfile="$file_path"tx_"$bigfile_name"_md5sum"$tmp_ext"
# --- Network Config ---
echo '*** ZeroTier Network Containers Test: ' "$test_name"
chown -R daemon /var/lib/zerotier-one
@ -26,11 +25,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '--- Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
# Generate large random file for transfer test, share md5sum for monitor container to check

4
netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/monitor_entrypoint.sh

@ -8,8 +8,8 @@ test_namefile=$(ls *.name)
test_name="${test_namefile%.*}" # test network id
nwconf=$(ls *.conf) # blank test network config file
nwid="${nwconf%.*}" # test network id
netcon_wait_time=25 # wait for test container to come online
app_timeout_time=15 # app-specific timeout
netcon_wait_time=35 # wait for test container to come online
app_timeout_time=25 # app-specific timeout
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
file_base="$test_name".txt # test result output file
fail=FAIL. # appended to result file in event of failure

2
netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/netcon_entrypoint.sh

@ -26,11 +26,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
# Generate large random file for transfer test, share md5sum for monitor container to check

4
netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/monitor_entrypoint.sh

@ -8,8 +8,8 @@ test_namefile=$(ls *.name)
test_name="${test_namefile%.*}" # test network id
nwconf=$(ls *.conf) # blank test network config file
nwid="${nwconf%.*}" # test network id
netcon_wait_time=25 # wait for test container to come online
app_timeout_time=15 # app-specific timeout
netcon_wait_time=35 # wait for test container to come online
app_timeout_time=25 # app-specific timeout
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
file_base="$test_name".txt # test result output file
fail=FAIL. # appended to result file in event of failure

2
netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/netcon_entrypoint.sh

@ -26,11 +26,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
# Generate large random file for transfer test, share md5sum for monitor container to check

4
netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/monitor_entrypoint.sh

@ -8,8 +8,8 @@ test_namefile=$(ls *.name)
test_name="${test_namefile%.*}" # test network id
nwconf=$(ls *.conf) # blank test network config file
nwid="${nwconf%.*}" # test network id
netcon_wait_time=25 # wait for test container to come online
app_timeout_time=15 # app-specific timeout
netcon_wait_time=35 # wait for test container to come online
app_timeout_time=25 # app-specific timeout
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
file_base="$test_name".txt # test result output file
fail=FAIL. # appended to result file in event of failure

2
netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/netcon_entrypoint.sh

@ -26,11 +26,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
# Generate large random file for transfer test, share md5sum for monitor container to check

2
netcon/docker-test/nodejs/nodejs-0.10.36-4.fc23/netcon_entrypoint.sh

@ -23,11 +23,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
echo '*** Starting application...'

2
netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/netcon_entrypoint.sh

@ -23,11 +23,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
echo '*** Starting application...'

2
netcon/docker-test/sshd/openssh-server-7.1p1-3.fc23.x86_64/netcon_entrypoint.sh

@ -26,11 +26,13 @@ virtip4=""
while [ -z "$virtip4" ]; do
sleep 0.2
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
done
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Writing address to ' "$address_file"
echo $virtip4 > "$address_file"
export ZT_NC_NWID=$dev
# --- Test section ---
# Generate large random file for transfer test, share md5sum for monitor container to check

41
netcon/docker-test/sshd/openssh-server-7.1p1-3.fc23.x86_64/two_party_test.sh

@ -1,41 +0,0 @@
test_name=${PWD##*/}
echo 'Building dockerfiles for test: ' "$test_name"
touch "$test_name".name
# Docker won't allow the inclusion of files outside of the build directory
cp ../../*.conf .
cp ../../zerotier-one zerotier-one
cp ../../zerotier-cli zerotier-cli
cp ../../zerotier-intercept zerotier-intercept
cp ../../libzerotierintercept.so.1.0 libzerotierintercept.so.1.0
cp ../../liblwip.so liblwip.so
cp ../../netcon_identity.public netcon_identity.public
cp ../../netcon_identity.secret netcon_identity.secret
cp ../../monitor_identity.public monitor_identity.public
cp ../../monitor_identity.secret monitor_identity.secret
docker build --tag="$test_name" -f netcon_dockerfile .
docker build --tag="$test_name"_monitor -f monitor_dockerfile .
rm -f zerotier-one
rm -f zerotier-cli
rm -f zerotier-intercept
rm -f libzerotierintercept.so.1.0
rm -f liblwip.so
rm -f netcon_identity.public
rm -f netcon_identity.secret
rm -f monitor_identity.public
rm -f monitor_identity.secret
rm -f *.conf
rm -f *.name
# Start netcon container to be tested
test_container=$(docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$test_name":latest)
monitor_container=$(docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$test_name"_monitor:latest)
echo "waiting $netcon_test_wait_time for test to complete."
sleep $netcon_test_wait_time
docker kill $(docker ps -a -q)
docker rm $test_container
docker rm $monitor_container

2
netcon/docker-test/test.sh

@ -4,7 +4,7 @@
rm _results/*.txt
# How long we shall wait for each test to conclude
export netcon_test_wait_time=45s
export netcon_test_wait_time=60s
# Test structure, in later releases more complex multi-party scripts will be included
export testscript=two_party_test.sh

Loading…
Cancel
Save