diff --git a/docker-test/httpd_demo/Dockerfile b/docker-test/httpd_demo/Dockerfile index a5de2140e..6e1e5a785 100644 --- a/docker-test/httpd_demo/Dockerfile +++ b/docker-test/httpd_demo/Dockerfile @@ -1,6 +1,5 @@ # A basic harnessed application example using ZeroTier-One and user-space IP stack -FROM fedora:20 - +FROM fedora:23 MAINTAINER https://www.zerotier.com/ # Install Apache @@ -8,32 +7,31 @@ RUN yum -y update && yum clean all RUN yum -y install httpd && yum clean all # Add files -ADD zerotier-one / -ADD zerotier-cli / -ADD intercept / -ADD lib/libintercept.so.1.0 / -ADD lib/liblwip.so / ADD htdocs/index.html / ADD htdocs/ZeroTierIcon.png / -RUN cp libintercept.so.1.0 lib/libintercept.so.1.0 -RUN cp liblwip.so lib/liblwip.so + # Install sys-call intercept library +ADD zerotier-one / +ADD zerotier-cli / +ADD intercept / +ADD libintercept.so.1.0 / +ADD liblwip.so / +RUN cp liblwip.so lib/liblwip.so 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 + RUN echo "Apache" >> /var/www/html/index.html EXPOSE 9993/udp - RUN mv index.html /var/www/html/index.html RUN mv ZeroTierIcon.png /var/www/html/ZeroTierIcon.png # Start ZeroTier-One RUN mkdir -p /var/lib/zerotier-one/networks.d RUN touch /var/lib/zerotier-one/networks.d/8056c2e21c000001.conf - ADD entrypoint.sh /entrypoint.sh RUN chmod -v +x /entrypoint.sh CMD ["./entrypoint.sh"] diff --git a/docker-test/httpd_demo/build.sh b/docker-test/httpd_demo/build.sh new file mode 100755 index 000000000..a651fc1c0 --- /dev/null +++ b/docker-test/httpd_demo/build.sh @@ -0,0 +1,18 @@ +cd ../../ +make clean +make +cd netcon +make -f make-intercept.mk lib +rm *.o +rm liblwip.so +make -f make-liblwip.mk + +cd ../docker-test/httpd_demo + +cp ../../zerotier-one zerotier-one +cp ../../zerotier-cli zerotier-cli + +cp ../../netcon/liblwip.so liblwip.so +cp ../../netcon/libintercept.so.1.0 libintercept.so.1.0 +cp ../../netcon/intercept intercept + diff --git a/docker-test/httpd_demo/entrypoint.sh b/docker-test/httpd_demo/entrypoint.sh index 3e8845b4e..6cb6e1990 100644 --- a/docker-test/httpd_demo/entrypoint.sh +++ b/docker-test/httpd_demo/entrypoint.sh @@ -2,6 +2,8 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ +touch /opt/results/results.txt + echo '***' echo '*** ZeroTier Network Containers Preview' echo '*** https://www.zerotier.com/' diff --git a/docker-test/httpd_demo/test.sh b/docker-test/httpd_demo/test.sh new file mode 100755 index 000000000..ad78f9b13 --- /dev/null +++ b/docker-test/httpd_demo/test.sh @@ -0,0 +1,2 @@ +docker build --tag="throughput_httpd_2.4.6" . +docker run -it -v $PWD/../_results:/opt/results --device=/dev/net/tun throughput_httpd_2.4.6:latest diff --git a/docker-test/redis-3.0.4-1.fc23.x86_64/Dockerfile b/docker-test/redis-3.0.4-1.fc23.x86_64/Dockerfile new file mode 100644 index 000000000..77a1a26a0 --- /dev/null +++ b/docker-test/redis-3.0.4-1.fc23.x86_64/Dockerfile @@ -0,0 +1,40 @@ +# ZT Netcon Throughput test +FROM fedora:23 +MAINTAINER https://www.zerotier.com/ + +# Install apps +RUN yum -y update +RUN yum -y install httpd-2.4.17-3.fc23 +RUN yum -y install nano +RUN yum -y install strace +RUN yum clean all + +EXPOSE 9993/udp 9992/udp 9991/udp 9990/udp + +# Install sys-call 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 +RUN touch /var/lib/zerotier-one/networks.d/e5cd7a9e1c5311ab.conf +ADD zerotier-one / +ADD zerotier-cli / + +# Install test-setup scripts +ADD generate_file.sh /generate_file.sh +RUN chmod -v +x /generate_file.sh +ADD entrypoint.sh /entrypoint.sh +RUN chmod -v +x /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 ["./entrypoint.sh"] diff --git a/docker-test/redis-3.0.4-1.fc23.x86_64/build.sh b/docker-test/redis-3.0.4-1.fc23.x86_64/build.sh new file mode 100755 index 000000000..d1c8b5c67 --- /dev/null +++ b/docker-test/redis-3.0.4-1.fc23.x86_64/build.sh @@ -0,0 +1,18 @@ +cd ../../ +make clean +make +cd netcon +make -f make-intercept.mk lib +rm *.o +rm liblwip.so +make -f make-liblwip.mk + +cd ../docker-test/redis-3.0.4-1.fc23.x86_64 + +cp ../../zerotier-one zerotier-one +cp ../../zerotier-cli zerotier-cli + +cp ../../netcon/liblwip.so liblwip.so +cp ../../netcon/libintercept.so.1.0 libintercept.so.1.0 +cp ../../netcon/intercept intercept + diff --git a/docker-test/redis-3.0.4-1.fc23.x86_64/entrypoint.sh b/docker-test/redis-3.0.4-1.fc23.x86_64/entrypoint.sh new file mode 100644 index 000000000..00fdd2be6 --- /dev/null +++ b/docker-test/redis-3.0.4-1.fc23.x86_64/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ + +echo '***' +echo '*** ZeroTier Network Containers Test Image' +echo '*** https://www.zerotier.com/' +echo '***' + +./zerotier-one & +./zerotier-cli join e5cd7a9e1c5311ab +./zerotier-cli listnetworks + + diff --git a/docker-test/redis-3.0.4-1.fc23.x86_64/generate_file.sh b/docker-test/redis-3.0.4-1.fc23.x86_64/generate_file.sh new file mode 100644 index 000000000..ac5b24338 --- /dev/null +++ b/docker-test/redis-3.0.4-1.fc23.x86_64/generate_file.sh @@ -0,0 +1 @@ +dd if=/dev/urandom of=/var/www/html/big bs=100M count=1 diff --git a/docker-test/test.sh b/docker-test/test.sh new file mode 100755 index 000000000..aa081860b --- /dev/null +++ b/docker-test/test.sh @@ -0,0 +1,2 @@ +/httpd_demo/test.sh +/throughput_httpd.2.4.6/test.sh diff --git a/docker-test/throughput_httpd_2.4.6/entrypoint.sh b/docker-test/throughput_httpd_2.4.6/entrypoint.sh index 00fdd2be6..27f28717b 100644 --- a/docker-test/throughput_httpd_2.4.6/entrypoint.sh +++ b/docker-test/throughput_httpd_2.4.6/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/bash +touch /opt/results/results.txt + export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ echo '***' diff --git a/docker-test/throughput_httpd_2.4.6/intercept b/docker-test/throughput_httpd_2.4.6/intercept new file mode 100755 index 000000000..3eb27ff7b --- /dev/null +++ b/docker-test/throughput_httpd_2.4.6/intercept @@ -0,0 +1,54 @@ +#!/bin/sh +# usage: +# /usr/bin/intercept program + +if [ $# = 0 ] ; then + echo "$0: insufficient arguments" + exit +fi + +case "$1" in + on) + if [ -z "$LD_PRELOAD" ] + then + export LD_PRELOAD="/lib/libintercept.so.1.0" + else + echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ + export LD_PRELOAD="/lib/libintercept.so $LD_PRELOAD" + fi + ;; + off) + export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/lib\/libintercept.so.1.0 \?//'` + if [ -z "$LD_PRELOAD" ] + then + unset LD_PRELOAD + fi + ;; + show|sh) + echo "LD_PRELOAD=\"$LD_PRELOAD\"" + ;; + -h|-?) + echo "" + ;; + *) + if [ -z "$LD_PRELOAD" ] + then + export LD_PRELOAD="/lib/libintercept.so.1.0" + else + echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ + export LD_PRELOAD="/lib/libintercept.so.1.0 $LD_PRELOAD" + fi + + if [ $# = 0 ] + then + ${SHELL:-/bin/sh} + fi + + if [ $# -gt 0 ] + then + exec "$@" + fi + ;; +esac + +#EOF diff --git a/docker-test/throughput_httpd_2.4.6/test.sh b/docker-test/throughput_httpd_2.4.6/test.sh new file mode 100755 index 000000000..ad78f9b13 --- /dev/null +++ b/docker-test/throughput_httpd_2.4.6/test.sh @@ -0,0 +1,2 @@ +docker build --tag="throughput_httpd_2.4.6" . +docker run -it -v $PWD/../_results:/opt/results --device=/dev/net/tun throughput_httpd_2.4.6:latest diff --git a/netcon/README.md b/netcon/README.md index 2bdca7303..700120fc4 100644 --- a/netcon/README.md +++ b/netcon/README.md @@ -100,7 +100,7 @@ Network Containers have been tested with the following: curl [ WORKS as of 20151021] apache (debug mode) [ WORKS as of 20150810] apache (prefork MPM) [ WORKS as of 20151112] (2.4.6-31.x86-64 on Centos 7), (2.4.16-1.x84-64 on F22), (2.4.17-3.x86-64 on F22) - nginx [ WORKS as of 20151022] + nginx [BROKEN as of 20151022] 1.8.0-3 and 1.8.0-4 both suffer from lost intercept connections nodejs [ WORKS as of 20151021] java [ WORKS as of 20151010] tomcat [ WORKS as of 2015xxxx] diff --git a/netcon/libintercept.so.1.0 b/netcon/libintercept.so.1.0 deleted file mode 100755 index 163b1ac2e..000000000 Binary files a/netcon/libintercept.so.1.0 and /dev/null differ