summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker-test/README.md28
-rw-r--r--docker-test/_results/httpd_bigfile_addr.txt1
-rw-r--r--docker-test/e5cd7a9e1c5311ab.conf0
-rw-r--r--docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/README.md (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/README.md)0
-rw-r--r--docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile)3
-rw-r--r--docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_entrypoint.sh)4
-rw-r--r--docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile)4
-rw-r--r--docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_entrypoint.sh)4
-rwxr-xr-xdocker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh (renamed from docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/test.sh)3
-rwxr-xr-xdocker-test/test.sh3
10 files changed, 42 insertions, 8 deletions
diff --git a/docker-test/README.md b/docker-test/README.md
new file mode 100644
index 00000000..f3708e4d
--- /dev/null
+++ b/docker-test/README.md
@@ -0,0 +1,28 @@
+To run unit tests:
+
+1) Place a blank network config file in this directory (e.g. "e5cd7a9e1c5311ab.conf")
+ - This will be used to inform test-specific scripts what network to use for testing (create your own, or use the given at your own risk)
+
+2) run build.sh
+ - Builds ZeroTier with Network Containers enabled
+ - Builds LWIP library
+ - Builds library harness
+ - Copies all aformentioned files into unit test directory to be used for building docker files
+
+3) run test.sh
+ - Will (for now, one at a time), execute each unit test's (test.sh)
+
+
+
+A) Each unit test's test.sh will:
+ - temporarily copy all built files into local directory
+ - build test container
+ - build monitor container
+ - remove temporary files
+ - run each container and perform test
+
+B) Results will be written to the 'zerotierone/docker-test/_result' directory
+ - Results will be a combination of raw and formatted dumps to files whose names reflect the test performed
+ - In the event of failure, 'FAIL.' will be appended to the result file's name
+ - (e.g. FAIL.my_application_1.0.2.x86_64)
+ - In the event of success, 'OK.' will be appended
diff --git a/docker-test/_results/httpd_bigfile_addr.txt b/docker-test/_results/httpd_bigfile_addr.txt
new file mode 100644
index 00000000..c87fdd9e
--- /dev/null
+++ b/docker-test/_results/httpd_bigfile_addr.txt
@@ -0,0 +1 @@
+172.30.238.230
diff --git a/docker-test/e5cd7a9e1c5311ab.conf b/docker-test/e5cd7a9e1c5311ab.conf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/docker-test/e5cd7a9e1c5311ab.conf
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/README.md b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/README.md
index 008fcac8..008fcac8 100644
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/README.md
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/README.md
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile
index 0543ccdc..208b0ad6 100644
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile
@@ -8,7 +8,8 @@ EXPOSE 9993/udp
RUN mkdir -p /var/lib/zerotier-one/networks.d
ADD monitor_identity.public /var/lib/zerotier-one/identity.public
ADD monitor_identity.secret /var/lib/zerotier-one/identity.secret
-RUN touch /var/lib/zerotier-one/networks.d/e5cd7a9e1c5311ab.conf
+ADD *.conf /var/lib/zerotier-one/networks.d/
+ADD *.conf /
ADD zerotier-one /
ADD zerotier-cli /
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_entrypoint.sh b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh
index 7be99e9a..792be8b2 100644
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_entrypoint.sh
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh
@@ -2,7 +2,7 @@
# Parameters for test
test_name=httpd_bigfile
-nwid=e5cd7a9e1c5311ab # test network
+nwid=$(ls *.conf) # test network (assume *.conf file in root directory is where we want to test)
netcon_wait_time=45 # wait for test container to come online
app_timeout_time=10 # app-specific timeout
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
@@ -37,7 +37,7 @@ while [ -z "$virtip4" ]; do
done
echo '*** Starting Test...'
-echo '*** Up and running at' $virtip4
+echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo '*** Sleeping for 30s while we wait for the Network Container to come online...'
sleep "$netcon_wait_time"s
ncvirtip=$(<$address_file)
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile
index 20ce9bf1..8aee457a 100644
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile
@@ -21,7 +21,9 @@ RUN /usr/bin/install -c intercept /usr/bin
RUN mkdir -p /var/lib/zerotier-one/networks.d
ADD netcon_identity.public /var/lib/zerotier-one/identity.public
ADD netcon_identity.secret /var/lib/zerotier-one/identity.secret
-RUN touch /var/lib/zerotier-one/networks.d/e5cd7a9e1c5311ab.conf
+ADD *.conf /var/lib/zerotier-one/networks.d/
+ADD *.conf /
+
ADD zerotier-one /
ADD zerotier-cli /
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_entrypoint.sh b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh
index 82e8ae51..c2158b7c 100644
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_entrypoint.sh
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh
@@ -2,7 +2,7 @@
# Parameters for test
test_name=httpd_bigfile
-nwid=e5cd7a9e1c5311ab # test network
+nwid=$(ls *.conf) # test network
file_path=/opt/results/ # test result output file path (fs shared between host and containers)
file_base="$test_name".txt # test result output file
address_file="$file_path$test_name"_addr.txt # file shared between host and containers for sharing address (optional)
@@ -31,7 +31,7 @@ while [ -z "$virtip4" ]; do
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
done
-echo '*** Up and running at' $virtip4
+echo '*** Up and running at' $virtip4 ' on network: ' $nwid
echo $virtip4 > "$address_file"
# Generate large random file for transfer test
diff --git a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/test.sh b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh
index 48b87676..f80c97a8 100755
--- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/test.sh
+++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh
@@ -3,6 +3,7 @@ testname=${PWD##*/}
echo 'Building dockerfiles for test: ' "$testname"
# 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 ../../intercept intercept
@@ -13,7 +14,6 @@ cp ../../netcon_identity.secret netcon_identity.secret
cp ../../monitor_identity.public monitor_identity.public
cp ../../monitor_identity.secret monitor_identity.secret
-
docker build --tag="$testname" -f netcon_dockerfile .
docker build --tag="$testname"_monitor -f monitor_dockerfile .
@@ -26,6 +26,7 @@ rm -f netcon_identity.public
rm -f netcon_identity.secret
rm -f monitor_identity.public
rm -f monitor_identity.secret
+rm -f *.conf
# Start netcon container to be tested
docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$testname":latest
diff --git a/docker-test/test.sh b/docker-test/test.sh
index 9b28d5b5..c183815e 100755
--- a/docker-test/test.sh
+++ b/docker-test/test.sh
@@ -1,2 +1,3 @@
/httpd/httpd_demo/test.sh
-/httpd/throughput_httpd.2.4.6/test.sh
+/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh
+