mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
Add more aggressive CLI testing upon startup
This commit is contained in:
parent
4e49d4d8aa
commit
aa9ade58da
1 changed files with 40 additions and 33 deletions
73
.github/workflows/validate-1m-linux.sh
vendored
73
.github/workflows/validate-1m-linux.sh
vendored
|
@ -20,8 +20,9 @@ mkdir $TEST_DIR_PREFIX
|
||||||
NS1="ip netns exec ns1"
|
NS1="ip netns exec ns1"
|
||||||
NS2="ip netns exec ns2"
|
NS2="ip netns exec ns2"
|
||||||
|
|
||||||
ZT1="$NS1 ./zerotier-cli -p9994 -D$(pwd)/node1"
|
ZT1="$NS1 ./zerotier-cli -D$(pwd)/node1"
|
||||||
ZT2="$NS2 ./zerotier-cli -p9995 -D$(pwd)/node2"
|
# Specify custom port on one node to ensure that feature works
|
||||||
|
ZT2="$NS2 ./zerotier-cli -p9997 -D$(pwd)/node2"
|
||||||
|
|
||||||
echo -e "Setting up network namespaces..."
|
echo -e "Setting up network namespaces..."
|
||||||
echo "Setting up ns1"
|
echo "Setting up ns1"
|
||||||
|
@ -66,23 +67,23 @@ sysctl -w net.ipv4.ip_forward=1
|
||||||
|
|
||||||
echo -e "\nPing from host to namespaces"
|
echo -e "\nPing from host to namespaces"
|
||||||
|
|
||||||
ping -c 4 192.168.0.1
|
ping -c 3 192.168.0.1
|
||||||
ping -c 4 192.168.1.1
|
ping -c 3 192.168.1.1
|
||||||
|
|
||||||
echo -e "\nPing from namespace to host"
|
echo -e "\nPing from namespace to host"
|
||||||
|
|
||||||
$NS1 ping -c 4 192.168.0.1
|
$NS1 ping -c 3 192.168.0.1
|
||||||
$NS1 ping -c 4 192.168.0.1
|
$NS1 ping -c 3 192.168.0.1
|
||||||
$NS2 ping -c 4 192.168.0.2
|
$NS2 ping -c 3 192.168.0.2
|
||||||
$NS2 ping -c 4 192.168.0.2
|
$NS2 ping -c 3 192.168.0.2
|
||||||
|
|
||||||
echo -e "\nPing from ns1 to ns2"
|
echo -e "\nPing from ns1 to ns2"
|
||||||
|
|
||||||
$NS1 ping -c 4 192.168.0.1
|
$NS1 ping -c 3 192.168.0.1
|
||||||
|
|
||||||
echo -e "\nPing from ns2 to ns1"
|
echo -e "\nPing from ns2 to ns1"
|
||||||
|
|
||||||
$NS2 ping -c 4 192.168.0.1
|
$NS2 ping -c 3 192.168.0.1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Memory Leak Check #
|
# Memory Leak Check #
|
||||||
|
@ -94,28 +95,19 @@ echo -e "\nStarting a ZeroTier instance in each namespace..."
|
||||||
|
|
||||||
time_test_start=`date +%s`
|
time_test_start=`date +%s`
|
||||||
|
|
||||||
|
# Spam the CLI as ZeroTier is starting
|
||||||
|
spam_cli 100
|
||||||
|
|
||||||
echo "Starting memory leak check"
|
echo "Starting memory leak check"
|
||||||
$NS1 sudo valgrind --demangle=yes --exit-on-first-error=yes \
|
$NS1 sudo valgrind --demangle=yes --exit-on-first-error=yes \
|
||||||
--error-exitcode=1 \
|
--error-exitcode=1 \
|
||||||
--xml=yes \
|
--xml=yes \
|
||||||
--xml-file=$FILENAME_MEMORY_LOG \
|
--xml-file=$FILENAME_MEMORY_LOG \
|
||||||
--leak-check=full \
|
--leak-check=full \
|
||||||
./zerotier-one node1 -U -p9994 >>node_1.log 2>&1 &
|
./zerotier-one node1 -U >>node_1.log 2>&1 &
|
||||||
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
# Second instance, not run in memory profiler
|
# Second instance, not run in memory profiler
|
||||||
$NS2 sudo ./zerotier-one node2 -U -p9995 >>node_2.log 2>&1 &
|
$NS2 sudo ./zerotier-one node2 -U -p9997 >>node_2.log 2>&1 &
|
||||||
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
ls -lga node1
|
|
||||||
tree node1
|
|
||||||
|
|
||||||
ls -lga node2
|
|
||||||
tree node2
|
|
||||||
|
|
||||||
ps aux | grep zerotier
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Online Check #
|
# Online Check #
|
||||||
|
@ -126,6 +118,15 @@ spam_cli()
|
||||||
echo "Spamming CLI..."
|
echo "Spamming CLI..."
|
||||||
# Rapidly spam the CLI with joins/leaves
|
# Rapidly spam the CLI with joins/leaves
|
||||||
|
|
||||||
|
MAX_TRIES="${$1:-10}"
|
||||||
|
|
||||||
|
for ((s=0; s<=MAX_TRIES; s++))
|
||||||
|
do
|
||||||
|
$ZT1 status
|
||||||
|
$ZT2 status
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
SPAM_TRIES=128
|
SPAM_TRIES=128
|
||||||
|
|
||||||
for ((s=0; s<=SPAM_TRIES; s++))
|
for ((s=0; s<=SPAM_TRIES; s++))
|
||||||
|
@ -174,20 +175,26 @@ do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "\nStatus of each instance:"
|
echo -e "\n\nContents of ZeroTier home paths:"
|
||||||
|
|
||||||
|
ls -lga node1
|
||||||
|
tree node1
|
||||||
|
ls -lga node2
|
||||||
|
tree node2
|
||||||
|
|
||||||
|
echo -e "\n\nRunning ZeroTier processes:"
|
||||||
|
echo -e "\nNode 1:"
|
||||||
|
$NS1 ps aux | grep zerotier-one
|
||||||
|
echo -e "\nNode 2:"
|
||||||
|
$NS2 ps aux | grep zerotier-one
|
||||||
|
|
||||||
|
echo -e "\n\nStatus of each instance:"
|
||||||
|
|
||||||
echo -e "\n\nNode 1:"
|
echo -e "\n\nNode 1:"
|
||||||
$ZT1 status
|
$ZT1 status
|
||||||
echo -e "\n\nNode 2:"
|
echo -e "\n\nNode 2:"
|
||||||
$ZT2 status
|
$ZT2 status
|
||||||
|
|
||||||
echo -e "\nps:"
|
|
||||||
|
|
||||||
echo -e "\n\nNode 1:"
|
|
||||||
$NS1 ps aux | grep zerotier-one
|
|
||||||
echo -e "\n\nNode 2:"
|
|
||||||
$NS2 ps aux | grep zerotier-one
|
|
||||||
|
|
||||||
if [[ "$both_instances_online" != "true" ]]
|
if [[ "$both_instances_online" != "true" ]]
|
||||||
then
|
then
|
||||||
echo "One or more instances of ZeroTier failed to come online. Aborting test."
|
echo "One or more instances of ZeroTier failed to come online. Aborting test."
|
||||||
|
@ -234,7 +241,7 @@ ping_loss_percent_2_to_1=$(echo "scale=2; $ping_loss_percent_2_to_1/100.0" | bc)
|
||||||
|
|
||||||
echo "Testing basic CLI functionality..."
|
echo "Testing basic CLI functionality..."
|
||||||
|
|
||||||
spam_cli
|
spam_cli 10
|
||||||
|
|
||||||
$ZT1 join $TEST_NETWORK
|
$ZT1 join $TEST_NETWORK
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue