From 9a25a627bba4a00465a3648b82fc89f61b980ed1 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Thu, 19 Nov 2015 17:34:56 -0800 Subject: WIP: Unit tests -- more generalization --- docker-test/README.md | 28 +++++++++ docker-test/_results/httpd_bigfile_addr.txt | 1 + docker-test/e5cd7a9e1c5311ab.conf | 0 .../httpd/httpd-2.4.16-1.fc23.x86_64/README.md | 8 +++ .../httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile | 24 ++++++++ .../monitor_entrypoint.sh | 66 ++++++++++++++++++++++ .../httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile | 40 +++++++++++++ .../netcon_entrypoint.sh | 44 +++++++++++++++ .../httpd/httpd-2.4.16-1.fc23.x86_64/test.sh | 40 +++++++++++++ .../httpd/httpd_2.4.16-1.fc23.x86_64/README.md | 8 --- .../httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile | 23 -------- .../monitor_entrypoint.sh | 66 ---------------------- .../httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile | 38 ------------- .../netcon_entrypoint.sh | 44 --------------- .../httpd/httpd_2.4.16-1.fc23.x86_64/test.sh | 39 ------------- docker-test/test.sh | 3 +- 16 files changed, 253 insertions(+), 219 deletions(-) create mode 100644 docker-test/README.md create mode 100644 docker-test/_results/httpd_bigfile_addr.txt create mode 100644 docker-test/e5cd7a9e1c5311ab.conf create mode 100644 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/README.md create mode 100644 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile create mode 100644 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh create mode 100644 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile create mode 100644 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh create mode 100755 docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh delete mode 100644 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/README.md delete mode 100644 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile delete mode 100644 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_entrypoint.sh delete mode 100644 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile delete mode 100644 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_entrypoint.sh delete mode 100755 docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/test.sh 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 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 new file mode 100644 index 00000000..008fcac8 --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/README.md @@ -0,0 +1,8 @@ +Network Containers Test Sequence for: httpd_demo + +1) Creates a Netcon docker container with an intercepted instance of httpd +2) Creates a test monitor container + +3) Test monitor container waits for X seconds for the Netcon container to come online +4) Test monitor attempts to curl an index.html file + - If file is of sufficient size, it will append "OK." to the result file for this test, otherwise "FAIL." is appended 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 new file mode 100644 index 00000000..208b0ad6 --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile @@ -0,0 +1,24 @@ +# ZT Network Containers Test Monitor +FROM fedora:23 +MAINTAINER https://www.zerotier.com/ + +EXPOSE 9993/udp + +# Add ZT files +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 +ADD *.conf /var/lib/zerotier-one/networks.d/ +ADD *.conf / +ADD zerotier-one / +ADD zerotier-cli / + +# Install LWIP library used by service +ADD liblwip.so / +RUN mkdir -p ext/bin/lwip +RUN cp liblwip.so ext/bin/lwip/liblwip.so + +# Start ZeroTier-One +ADD monitor_entrypoint.sh /monitor_entrypoint.sh +RUN chmod -v +x /monitor_entrypoint.sh +CMD ["./monitor_entrypoint.sh"] 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 new file mode 100644 index 00000000..792be8b2 --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_entrypoint.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Parameters for test +test_name=httpd_bigfile +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) +file_base="$test_name".txt # test result output file +fail=FAIL. # appended to result file in event of failure +ok=OK. # appended to result file in event of success +address_file="$file_path$test_name"_addr.txt # file shared between host and containers for sharing address (optional) +tmp=/test/ # for storage of large transfer test files, things that shouldn't be shared with host +bigfile=bigfile # large, random test transfer file + +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ + +echo '*** ZeroTier Network Containers Test Monitor' +chown -R daemon /var/lib/zerotier-one +chgrp -R daemon /var/lib/zerotier-one +su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1' +echo '*** Waiting for initial identity generation...' + +while [ ! -s /var/lib/zerotier-one/identity.secret ]; do + sleep 0.2 +done + +echo '*** Waiting for network config...' + +virtip4="" +while [ ! -s /var/lib/zerotier-one/networks.d/"$nwid".conf ]; do + sleep 0.2 +done +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` +done + +echo '*** Starting Test...' +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) +echo '*** Curling from intercepted server at' $ncvirtip +rm -rf "$file_path"*."$file_base" +touch "$tmp$bigfile" + +# Perform test +# curl --connect-timeout "$app_timeout_time" -v -o "$file_path$file_base" http://"$ncvirtip"/index.html + +# Large transfer test +mkdir -p "$tmp" +curl --connect-timeout "$app_timeout_time" -v -o "$tmp$bigfile" http://"$ncvirtip"/"$bigfile" + +# Test outcome logic +minimumsize=39550 +actualsize=$(wc -c <"$tmp$bigfile") +if [ $actualsize -ge $minimumsize ]; then + echo 'OK' + touch "$file_path$ok$file_base" + #mv "$file_path$file_base" "$file_path$ok$file_base" +else + echo 'FAIL' + touch "$file_path$fail$file_base" + #mv "$file_path$file_base" "$file_path$fail$file_base" +fi \ No newline at end of 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 new file mode 100644 index 00000000..8aee457a --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile @@ -0,0 +1,40 @@ +# ZT Network Containers Test +FROM fedora:23 +MAINTAINER https://www.zerotier.com/ + +# Install apps +RUN yum -y update +RUN yum -y install httpd-2.4.16-1.fc23.x86_64 +RUN yum clean all + +EXPOSE 9993/udp + +# Install syscall intercept library +ADD intercept / +ADD libintercept.so.1.0 / +RUN cp libintercept.so.1.0 lib/libintercept.so.1.0 +RUN cp libintercept.so.1.0 /lib/libintercept.so.1.0 +RUN ln -sf /lib/libintercept.so.1.0 /lib/libintercept +RUN /usr/bin/install -c intercept /usr/bin + +# Add ZT files +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 +ADD *.conf /var/lib/zerotier-one/networks.d/ +ADD *.conf / + +ADD zerotier-one / +ADD zerotier-cli / + +# Install test scripts +ADD netcon_entrypoint.sh /netcon_entrypoint.sh +RUN chmod -v +x /netcon_entrypoint.sh + +# Install LWIP library used by service +ADD liblwip.so / +RUN mkdir -p ext/bin/lwip +RUN cp liblwip.so ext/bin/lwip/liblwip.so + +# Start ZeroTier-One +CMD ["./netcon_entrypoint.sh"] 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 new file mode 100644 index 00000000..c2158b7c --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Parameters for test +test_name=httpd_bigfile +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) +bigfile_size=10M + +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ + +echo '*** ZeroTier Network Containers Test: ' "$test_name" +chown -R daemon /var/lib/zerotier-one +chgrp -R daemon /var/lib/zerotier-one +su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1' +echo '*** Waiting for initial identity generation...' + +while [ ! -s /var/lib/zerotier-one/identity.secret ]; do + sleep 0.2 +done + +echo '*** Waiting for network config...' + +virtip4="" +while [ ! -s /var/lib/zerotier-one/networks.d/"$nwid".conf ]; do + sleep 0.2 +done +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` +done + +echo '*** Up and running at' $virtip4 ' on network: ' $nwid +echo $virtip4 > "$address_file" + +# Generate large random file for transfer test +echo '*** Generating ' "$bigfile_size" ' file' +dd if=/dev/urandom of=/var/www/html/bigfile bs="$bigfile_size" count=1 + +echo '*** Starting Apache...' +sleep 0.5 +rm -rf /run/httpd/* /tmp/httpd* +intercept /usr/sbin/httpd -D FOREGROUND >>/tmp/apache.out 2>&1 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 new file mode 100755 index 00000000..f80c97a8 --- /dev/null +++ b/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh @@ -0,0 +1,40 @@ + +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 +cp ../../libintercept.so.1.0 libintercept.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="$testname" -f netcon_dockerfile . +docker build --tag="$testname"_monitor -f monitor_dockerfile . + +rm -f zerotier-one +rm -f zerotier-cli +rm -f intercept +rm -f libintercept.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 + +# Start netcon container to be tested +docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$testname":latest +docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$testname"_monitor:latest + +sleep 45s +docker kill $(docker ps -a -q) + +#docker ps -a -q --filter="name=httpd_demo" +#docker ps -a -q --filter="name=httpd_demo_monitor" +#rm -rf ../../_tmp/*.txt \ No newline at end of file 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 deleted file mode 100644 index 008fcac8..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Network Containers Test Sequence for: httpd_demo - -1) Creates a Netcon docker container with an intercepted instance of httpd -2) Creates a test monitor container - -3) Test monitor container waits for X seconds for the Netcon container to come online -4) Test monitor attempts to curl an index.html file - - If file is of sufficient size, it will append "OK." to the result file for this test, otherwise "FAIL." is appended 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 deleted file mode 100644 index 0543ccdc..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# ZT Network Containers Test Monitor -FROM fedora:23 -MAINTAINER https://www.zerotier.com/ - -EXPOSE 9993/udp - -# Add ZT files -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 zerotier-one / -ADD zerotier-cli / - -# Install LWIP library used by service -ADD liblwip.so / -RUN mkdir -p ext/bin/lwip -RUN cp liblwip.so ext/bin/lwip/liblwip.so - -# Start ZeroTier-One -ADD monitor_entrypoint.sh /monitor_entrypoint.sh -RUN chmod -v +x /monitor_entrypoint.sh -CMD ["./monitor_entrypoint.sh"] 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 deleted file mode 100644 index 7be99e9a..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/monitor_entrypoint.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Parameters for test -test_name=httpd_bigfile -nwid=e5cd7a9e1c5311ab # test network -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) -file_base="$test_name".txt # test result output file -fail=FAIL. # appended to result file in event of failure -ok=OK. # appended to result file in event of success -address_file="$file_path$test_name"_addr.txt # file shared between host and containers for sharing address (optional) -tmp=/test/ # for storage of large transfer test files, things that shouldn't be shared with host -bigfile=bigfile # large, random test transfer file - -export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ - -echo '*** ZeroTier Network Containers Test Monitor' -chown -R daemon /var/lib/zerotier-one -chgrp -R daemon /var/lib/zerotier-one -su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1' -echo '*** Waiting for initial identity generation...' - -while [ ! -s /var/lib/zerotier-one/identity.secret ]; do - sleep 0.2 -done - -echo '*** Waiting for network config...' - -virtip4="" -while [ ! -s /var/lib/zerotier-one/networks.d/"$nwid".conf ]; do - sleep 0.2 -done -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` -done - -echo '*** Starting Test...' -echo '*** Up and running at' $virtip4 -echo '*** Sleeping for 30s while we wait for the Network Container to come online...' -sleep "$netcon_wait_time"s -ncvirtip=$(<$address_file) -echo '*** Curling from intercepted server at' $ncvirtip -rm -rf "$file_path"*."$file_base" -touch "$tmp$bigfile" - -# Perform test -# curl --connect-timeout "$app_timeout_time" -v -o "$file_path$file_base" http://"$ncvirtip"/index.html - -# Large transfer test -mkdir -p "$tmp" -curl --connect-timeout "$app_timeout_time" -v -o "$tmp$bigfile" http://"$ncvirtip"/"$bigfile" - -# Test outcome logic -minimumsize=39550 -actualsize=$(wc -c <"$tmp$bigfile") -if [ $actualsize -ge $minimumsize ]; then - echo 'OK' - touch "$file_path$ok$file_base" - #mv "$file_path$file_base" "$file_path$ok$file_base" -else - echo 'FAIL' - touch "$file_path$fail$file_base" - #mv "$file_path$file_base" "$file_path$fail$file_base" -fi \ No newline at end of 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 deleted file mode 100644 index 20ce9bf1..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# ZT Network Containers Test -FROM fedora:23 -MAINTAINER https://www.zerotier.com/ - -# Install apps -RUN yum -y update -RUN yum -y install httpd-2.4.16-1.fc23.x86_64 -RUN yum clean all - -EXPOSE 9993/udp - -# Install syscall intercept library -ADD intercept / -ADD libintercept.so.1.0 / -RUN cp libintercept.so.1.0 lib/libintercept.so.1.0 -RUN cp libintercept.so.1.0 /lib/libintercept.so.1.0 -RUN ln -sf /lib/libintercept.so.1.0 /lib/libintercept -RUN /usr/bin/install -c intercept /usr/bin - -# Add ZT files -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 zerotier-one / -ADD zerotier-cli / - -# Install test scripts -ADD netcon_entrypoint.sh /netcon_entrypoint.sh -RUN chmod -v +x /netcon_entrypoint.sh - -# Install LWIP library used by service -ADD liblwip.so / -RUN mkdir -p ext/bin/lwip -RUN cp liblwip.so ext/bin/lwip/liblwip.so - -# Start ZeroTier-One -CMD ["./netcon_entrypoint.sh"] 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 deleted file mode 100644 index 82e8ae51..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/netcon_entrypoint.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Parameters for test -test_name=httpd_bigfile -nwid=e5cd7a9e1c5311ab # 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) -bigfile_size=10M - -export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ - -echo '*** ZeroTier Network Containers Test: ' "$test_name" -chown -R daemon /var/lib/zerotier-one -chgrp -R daemon /var/lib/zerotier-one -su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1' -echo '*** Waiting for initial identity generation...' - -while [ ! -s /var/lib/zerotier-one/identity.secret ]; do - sleep 0.2 -done - -echo '*** Waiting for network config...' - -virtip4="" -while [ ! -s /var/lib/zerotier-one/networks.d/"$nwid".conf ]; do - sleep 0.2 -done -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` -done - -echo '*** Up and running at' $virtip4 -echo $virtip4 > "$address_file" - -# Generate large random file for transfer test -echo '*** Generating ' "$bigfile_size" ' file' -dd if=/dev/urandom of=/var/www/html/bigfile bs="$bigfile_size" count=1 - -echo '*** Starting Apache...' -sleep 0.5 -rm -rf /run/httpd/* /tmp/httpd* -intercept /usr/sbin/httpd -D FOREGROUND >>/tmp/apache.out 2>&1 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 deleted file mode 100755 index 48b87676..00000000 --- a/docker-test/httpd/httpd_2.4.16-1.fc23.x86_64/test.sh +++ /dev/null @@ -1,39 +0,0 @@ - -testname=${PWD##*/} -echo 'Building dockerfiles for test: ' "$testname" - -# Docker won't allow the inclusion of files outside of the build directory -cp ../../zerotier-one zerotier-one -cp ../../zerotier-cli zerotier-cli -cp ../../intercept intercept -cp ../../libintercept.so.1.0 libintercept.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="$testname" -f netcon_dockerfile . -docker build --tag="$testname"_monitor -f monitor_dockerfile . - -rm -f zerotier-one -rm -f zerotier-cli -rm -f intercept -rm -f libintercept.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 - -# Start netcon container to be tested -docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$testname":latest -docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$testname"_monitor:latest - -sleep 45s -docker kill $(docker ps -a -q) - -#docker ps -a -q --filter="name=httpd_demo" -#docker ps -a -q --filter="name=httpd_demo_monitor" -#rm -rf ../../_tmp/*.txt \ No newline at end of file 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 + -- cgit v1.2.3