Browse Source

Modified test scripts to match new naming conventions

root 9 years ago
parent
commit
036bbfaff9
23 changed files with 55 additions and 57 deletions
  1. 9 1
      make-linux.mk
  2. 2 0
      netcon/docker-test/_build_single_image.sh
  3. 4 7
      netcon/docker-test/build_zt.sh
  4. 1 0
      netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile
  5. 3 3
      netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_entrypoint.sh
  6. 1 0
      netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/netcon_dockerfile
  7. 3 3
      netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/netcon_entrypoint.sh
  8. 0 16
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/_two_party_test.sh
  9. 1 0
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/netcon_dockerfile
  10. 4 4
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/netcon_entrypoint.sh
  11. 0 0
      netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/nginx-1.8.0-13.fc23.x86_64.name
  12. 1 0
      netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/netcon_dockerfile
  13. 4 4
      netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/netcon_entrypoint.sh
  14. 1 0
      netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_dockerfile
  15. 4 4
      netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_entrypoint.sh
  16. 1 0
      netcon/docker-test/nodejs/nodejs-0.10.36-4.fc23/netcon_dockerfile
  17. 3 3
      netcon/docker-test/nodejs/nodejs-0.10.36-4.fc23/netcon_entrypoint.sh
  18. 1 0
      netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/netcon_dockerfile
  19. 3 3
      netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/netcon_entrypoint.sh
  20. 0 0
      netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/redis-3.0.4-1.fc23.x86_64.name
  21. BIN
      netcon/docker-test/zerotier-netcon-service
  22. 3 3
      netcon/make-intercept.mk
  23. 6 6
      netcon/zerotier-intercept

+ 9 - 1
make-linux.mk

@@ -97,6 +97,14 @@ one:	$(OBJS) one.o
 	ln -sf zerotier-one zerotier-idtool
 	ln -sf zerotier-one zerotier-cli
 
+netcon: $(OBJS) one.o
+	# Need to selectively rebuild one.cpp and OneService.cpp with ZT_SERVICE_NETCON and ZT_ONE_NO_ROOT_CHECK defined, and also NetconEthernetTap
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) 	-DZT_SERVICE_NETCON -DZT_ONE_NO_ROOT_CHECK -o zerotier-netcon-service $(OBJS) one.o $(LDLIBS) -ldl
+	# Build netcon/liblwip.so which must be placed in ZT home for zerotier-netcon-service to work
+	cd netcon ; make -f make-liblwip.mk
+	# Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility
+	cd netcon ; gcc -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -DDEBUG_RPC -DCHECKS -D_GNU_SOURCE -DNETCON_INTERCEPT -I. -nostdlib -shared -o ../libzerotierintercept.so Intercept.c
+
 selftest:	$(OBJS) selftest.o
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LDLIBS)
 	$(STRIP) zerotier-selftest
@@ -105,7 +113,7 @@ installer: one FORCE
 	./ext/installfiles/linux/buildinstaller.sh
 
 clean:
-	rm -rf *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest build-* ZeroTierOneInstaller-* *.deb *.rpm
+	rm -rf *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o $(OBJS) zerotier-netcon-service zerotier-one zerotier-idtool zerotier-cli zerotier-selftest build-* ZeroTierOneInstaller-* *.deb *.rpm
 	# Remove files from all the funny places we put them for tests
 	find netcon -type f \( -name '*.o' -o -name '*.so' -o -name '*.1.0' -o -name 'zerotier-one' -o -name 'zerotier-cli' \) -delete
 	find netcon/docker-test -name "zerotier-intercept" -type f -delete

+ 2 - 0
netcon/docker-test/_build_single_image.sh

@@ -8,6 +8,7 @@ touch "$test_name".name
 cp ../../*.conf .
 cp ../../zerotier-one zerotier-one
 cp ../../zerotier-cli zerotier-cli
+cp ../../zerotier-cli zerotier-netcon-service
 cp ../../zerotier-intercept zerotier-intercept
 cp ../../libzerotierintercept.so.1.0 libzerotierintercept.so.1.0
 cp ../../liblwip.so liblwip.so
@@ -21,6 +22,7 @@ docker build --tag="$test_name"_monitor -f monitor_dockerfile .
 
 rm -f zerotier-one
 rm -f zerotier-cli
+rm -f zerotier-netcon-service
 rm -f zerotier-intercept
 rm -f libzerotierintercept.so.1.0
 rm -f liblwip.so

+ 4 - 7
netcon/docker-test/build_zt.sh

@@ -6,17 +6,14 @@
 cd ../../
 
 make clean
-make
-cd netcon
-make -f make-intercept.mk lib
-rm *.o
-rm liblwip.so
-make -f make-liblwip.mk
+make netcon
+make one
 
-cd docker-test
+cd netcon/docker-test
 
 cp ../../zerotier-one zerotier-one
 cp ../../zerotier-cli zerotier-cli
+cp ../../zerotier-cli zerotier-netcon-service
 
 cp ../liblwip.so liblwip.so
 cp ../libzerotierintercept.so.1.0 libzerotierintercept.so.1.0

+ 1 - 0
netcon/docker-test/httpd/httpd-2.4.16-1.fc23.x86_64/netcon_dockerfile

@@ -30,6 +30,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -18,9 +18,9 @@ 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
-chgrp -R daemon /var/lib/zerotier-one
-su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 1 - 0
netcon/docker-test/httpd/httpd-2.4.17-3.fc23.x86_64/netcon_dockerfile

@@ -30,6 +30,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -19,9 +19,9 @@ 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
-chgrp -R daemon /var/lib/zerotier-one
-su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 0 - 16
netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/_two_party_test.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Runs test image and monitor image as daemons
-test_name=${PWD##*/}
-echo 'Starting containers for: ' "$test_name"
-touch "$test_name".name
-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 stop $(docker ps -a -q)
-docker rm $test_container
-docker rm $monitor_container
-
-rm -f *.name

+ 1 - 0
netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/netcon_dockerfile

@@ -30,6 +30,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -6,7 +6,7 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/
 # --- Test Parameters ---
 test_namefile=$(ls *.name)
 test_name="${test_namefile%.*}" # test network id
-nwconf=$(ls *.{conf,}) # blank test network config file
+nwconf=$(ls {*.conf,}) # blank test network config file
 nwid="${nwconf%.*}" # test network id
 file_path=/opt/results/ # test result output file path (fs shared between host and containers)
 file_base="$test_name".txt # test result output file
@@ -19,9 +19,9 @@ 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
-chgrp -R daemon /var/lib/zerotier-one
-su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 0 - 0
netcon/docker-test/nginx/nginx-1.8.0-13.fc23.x86_64/nginx-1.8.0-13.fc23.x86_64.name


+ 1 - 0
netcon/docker-test/nginx/nginx-1.8.0-14.fc23.x86_64/netcon_dockerfile

@@ -30,6 +30,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -6,7 +6,7 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/
 # --- Test Parameters ---
 test_namefile=$(ls *.name)
 test_name="${test_namefile%.*}" # test network id
-nwconf=$(ls *.{conf,}) # blank test network config file
+nwconf=$(ls {*.conf,}) # blank test network config file
 nwid="${nwconf%.*}" # test network id
 file_path=/opt/results/ # test result output file path (fs shared between host and containers)
 file_base="$test_name".txt # test result output file
@@ -19,9 +19,9 @@ 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
-chgrp -R daemon /var/lib/zerotier-one
-su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 1 - 0
netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_dockerfile

@@ -33,6 +33,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

+ 4 - 4
netcon/docker-test/nginx/nginx-1.8.0-ub14.x86_64/netcon_entrypoint.sh

@@ -6,7 +6,7 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/
 # --- Test Parameters ---
 test_namefile=$(ls *.name)
 test_name="${test_namefile%.*}" # test network id
-nwconf=$(ls *.{conf,}) # blank test network config file
+nwconf=$(ls {*.conf,}) # blank test network config file
 nwid="${nwconf%.*}" # test network id
 file_path=/opt/results/ # test result output file path (fs shared between host and containers)
 file_base="$test_name".txt # test result output file
@@ -19,9 +19,9 @@ 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
-chgrp -R daemon /var/lib/zerotier-one
-su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 1 - 0
netcon/docker-test/nodejs/nodejs-0.10.36-4.fc23/netcon_dockerfile

@@ -33,6 +33,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+ADD zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -16,9 +16,9 @@ address_file="$file_path$test_name"_addr"$tmp_ext" # file shared between host an
 
 # --- Network Config ---
 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'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 1 - 0
netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/netcon_dockerfile

@@ -30,6 +30,7 @@ RUN /usr/bin/install -c zerotier-intercept /usr/bin
 
 ADD zerotier-one /
 ADD zerotier-cli /
+Add zerotier-netcon-service /
 
 # Install test scripts
 ADD netcon_entrypoint.sh /netcon_entrypoint.sh

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

@@ -16,9 +16,9 @@ address_file="$file_path$test_name"_addr"$tmp_ext" # file shared between host an
 
 # --- Network Config ---
 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'
+chown -R daemon /var/lib/zerotier-netcon-service
+chgrp -R daemon /var/lib/zerotier-netcon-service
+su daemon -s /bin/bash -c '/zerotier-netcon-service -d -U -p9993 >>/tmp/zerotier-netcon-service.out 2>&1'
 virtip4=""
 while [ -z "$virtip4" ]; do
 	sleep 0.2

+ 0 - 0
netcon/docker-test/redis/redis-3.0.4-1.fc23.x86_64/redis-3.0.4-1.fc23.x86_64.name


BIN
netcon/docker-test/zerotier-netcon-service


+ 3 - 3
netcon/make-intercept.mk

@@ -43,11 +43,11 @@ lib:
 	${SHCC} $(SHLDFLAGS) Intercept.o -o libzerotierintercept.so.1.0 $(LIBS)
 
 install:
-	cp libzerotierintercept.so.1.0 /lib/libzerotierintercept.so.1.0
-	ln -sf /lib/libzerotierintercept.so.1.0 /lib/libzerotierintercept
+	cp ../libzerotierintercept.so /lib/libzerotierintercept.so
+	ln -sf /lib/libzerotierintercept.so /lib/libzerotierintercept
 	/usr/bin/install -c zerotier-intercept /usr/bin
 
 uninstall:
-	rm -r /lib/libzerotierintercept.so.1.0
+	rm -r /lib/libzerotierintercept.so
 	rm -r /lib/libzerotierintercept
 	rm -r /usr/bin/zerotier-intercept

+ 6 - 6
netcon/zerotier-intercept

@@ -11,14 +11,14 @@ case "$1" in
 	on)
 		if [ -z "$LD_PRELOAD" ]
 			then
-				export LD_PRELOAD="/lib/libzerotierintercept.so.1.0"
+				export LD_PRELOAD="/lib/libzerotierintercept.so"
 			else
-				echo $LD_PRELOAD | grep -q "/lib/libzerotierintercept\.so.1.0" || \
+				echo $LD_PRELOAD | grep -q "/lib/libzerotierintercept\.so" || \
 				export LD_PRELOAD="/lib/libzerotierintercept.so $LD_PRELOAD"
 		fi
 	;;
 	off)
-		export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/lib\/libzerotierintercept.so.1.0 \?//'`
+		export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/lib\/libzerotierintercept.so \?//'`
 		if [ -z "$LD_PRELOAD" ]
 			then
 				unset LD_PRELOAD
@@ -33,10 +33,10 @@ case "$1" in
 	*)
 		if [ -z "$LD_PRELOAD" ]
 		then
-			export LD_PRELOAD="/lib/libzerotierintercept.so.1.0"
+			export LD_PRELOAD="/lib/libzerotierintercept.so"
 		else
-			echo $LD_PRELOAD | grep -q "/lib/libzerotierintercept\.so.1.0" || \
-			export LD_PRELOAD="/lib/libzerotierintercept.so.1.0 $LD_PRELOAD"
+			echo $LD_PRELOAD | grep -q "/lib/libzerotierintercept\.so" || \
+			export LD_PRELOAD="/lib/libzerotierintercept.so $LD_PRELOAD"
 		fi
 
 		if [ $# = 0 ]