diff --git a/docker-test/._.DS_Store b/docker-test/._.DS_Store deleted file mode 100644 index b769b1a1e..000000000 Binary files a/docker-test/._.DS_Store and /dev/null differ diff --git a/docker-test/README.md b/docker-test/README.md deleted file mode 100644 index f3708e4d9..000000000 --- a/docker-test/README.md +++ /dev/null @@ -1,28 +0,0 @@ -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/._.DS_Store b/docker-test/_results/._.DS_Store deleted file mode 100644 index 433b5ca14..000000000 Binary files a/docker-test/_results/._.DS_Store and /dev/null differ diff --git a/docker-test/_results/httpd_bigfile_addr.txt b/docker-test/_results/httpd_bigfile_addr.txt deleted file mode 100644 index c87fdd9e5..000000000 --- a/docker-test/_results/httpd_bigfile_addr.txt +++ /dev/null @@ -1 +0,0 @@ -172.30.238.230 diff --git a/docker-test/build.sh b/docker-test/build.sh deleted file mode 100755 index d9310a5d1..000000000 --- a/docker-test/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -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/ - -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/e5cd7a9e1c5311ab.conf b/docker-test/e5cd7a9e1c5311ab.conf deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker-test/httpd/._.DS_Store b/docker-test/httpd/._.DS_Store deleted file mode 100644 index 199b64484..000000000 Binary files a/docker-test/httpd/._.DS_Store and /dev/null differ 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 008fcac8f..000000000 --- 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 208b0ad63..000000000 --- a/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/monitor_dockerfile +++ /dev/null @@ -1,24 +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 -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 deleted file mode 100644 index 792be8b27..000000000 --- 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=$(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 deleted file mode 100644 index 8aee457a9..000000000 --- a/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile +++ /dev/null @@ -1,40 +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 -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 deleted file mode 100644 index c2158b7cf..000000000 --- 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=$(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 deleted file mode 100755 index f80c97a80..000000000 --- a/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/test.sh +++ /dev/null @@ -1,40 +0,0 @@ - -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_demo/._.DS_Store b/docker-test/httpd/httpd_demo/._.DS_Store deleted file mode 100644 index 9047cbae9..000000000 Binary files a/docker-test/httpd/httpd_demo/._.DS_Store and /dev/null differ diff --git a/docker-test/httpd/httpd_demo/README.md b/docker-test/httpd/httpd_demo/README.md deleted file mode 100644 index 008fcac8f..000000000 --- a/docker-test/httpd/httpd_demo/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_demo/htdocs/ZeroTierIcon.png b/docker-test/httpd/httpd_demo/htdocs/ZeroTierIcon.png deleted file mode 100644 index 4d9641b34..000000000 Binary files a/docker-test/httpd/httpd_demo/htdocs/ZeroTierIcon.png and /dev/null differ diff --git a/docker-test/httpd/httpd_demo/htdocs/index.html b/docker-test/httpd/httpd_demo/htdocs/index.html deleted file mode 100644 index 017e44933..000000000 --- a/docker-test/httpd/httpd_demo/htdocs/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - -
- - - - -This page is being served from a Docker container with its own private TCP/IP microservice.
- --It's connected to a virtual network, but if you "docker exec" into it and look around you won't find any special devices. No special privileges or configuration changes on the Docker host were needed. Everything is completely "stock" and completely self-contained. -
- --There's nothing special about the web server. It's just Apache. There's nothing special about the Linux image. It's based on a regular Fedora Docker base image. Other than Apache, the only thing this image contains is the ZeroTier network containers microservice and dynamic library. -
- --When Apache is run, our launcher script configures it to load a special dynamic library. This library intercepts calls to the Linux C networking API, redirecting network I/O to our private network stack microservice instead of the standard Linux kernel network path. This microservice takes care of the rest, automatically encapsulating traffic and sending it over the virtual network instead of the physical. -
- --It's a bit like how networking would work on a microkernel: modular, composable, portable, and independent. -
- --Network Containers allows a Docker (or LXC, CoreOS/rkt, runc, OpenVZ, SmartOS/Triton, bocker, or even just bare metal Linux) system to connect to virtual networks without requiring any special permissions or special configuration on the host node. Processes inside the container don't even need to run with root permissions. It's 100% user-space, making it ideal for multi-tenant deployments or any other situation where modifying the configuration of the host node is impossible or just inconvenient. -
- --Once properly tuned and optimized, Network Containers also has the potential to be much faster than tun/tap or pcap based network overlays. It imposes only a single context switch from application/service to virtual network microservice as opposed to at least four for tun/tap and pcap-based solutions, since the latter require two trips through the kernel network stack. We believe it may be possible to approach or even equal the performance of VXLAN/IPSec or other fully kernel-mode configurations, but with the ease and total independence of a fully container-based solution. -
- --We created this container image to show you a preview of one of the projects we've been working on at ZeroTier. We still have a good deal of packaging, testing, and performance optimization work to do before Network Containers will be ready for a real public beta release. Follow the blog or @zerotier for updates and announcements. -
- --P.S. If you want to use ZeroTier in Docker today, you can do it with the same ZeroTier One endpoint service you're using to access this network. The only catch is that you have to launch your containers with "--device=/dev/net/tun --cap-add=NET_ADMIN". Network Containers eliminates the need for these special options. -
- -