mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-20 09:46:13 +00:00
Modified test scripts to match new naming conventions
This commit is contained in:
parent
afafde2571
commit
036bbfaff9
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
BIN
netcon/docker-test/zerotier-netcon-service
Executable file
BIN
netcon/docker-test/zerotier-netcon-service
Executable file
Binary file not shown.
@ -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
|
||||
|
@ -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 ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user