mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-11 06:54:06 +00:00
More aggressive CLI spamming (#1993)
This commit is contained in:
parent
54f339f0c0
commit
d6c5a6cd59
108
.github/workflows/validate-1m-linux.sh
vendored
108
.github/workflows/validate-1m-linux.sh
vendored
@ -21,7 +21,8 @@ NS1="ip netns exec ns1"
|
|||||||
NS2="ip netns exec ns2"
|
NS2="ip netns exec ns2"
|
||||||
|
|
||||||
ZT1="$NS1 ./zerotier-cli -D$(pwd)/node1"
|
ZT1="$NS1 ./zerotier-cli -D$(pwd)/node1"
|
||||||
ZT2="$NS2 ./zerotier-cli -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,21 +95,57 @@ 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 >>node_1.log 2>&1 &
|
./zerotier-one node1 -U >>node_1.log 2>&1 &
|
||||||
|
|
||||||
# Second instance, not run in memory profiler
|
# Second instance, not run in memory profiler
|
||||||
$NS2 ./zerotier-one node2 >>node_2.log 2>&1 &
|
$NS2 sudo ./zerotier-one node2 -U -p9997 >>node_2.log 2>&1 &
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Online Check #
|
# Online Check #
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
spam_cli()
|
||||||
|
{
|
||||||
|
echo "Spamming CLI..."
|
||||||
|
# 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
|
||||||
|
|
||||||
|
for ((s=0; s<=SPAM_TRIES; s++))
|
||||||
|
do
|
||||||
|
$ZT1 join $TEST_NETWORK
|
||||||
|
done
|
||||||
|
|
||||||
|
for ((s=0; s<=SPAM_TRIES; s++))
|
||||||
|
do
|
||||||
|
$ZT1 leave $TEST_NETWORK
|
||||||
|
done
|
||||||
|
|
||||||
|
for ((s=0; s<=SPAM_TRIES; s++))
|
||||||
|
do
|
||||||
|
$ZT1 leave $TEST_NETWORK
|
||||||
|
$ZT1 join $TEST_NETWORK
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
echo "Waiting for ZeroTier to come online before attempting test..."
|
echo "Waiting for ZeroTier to come online before attempting test..."
|
||||||
MAX_WAIT_SECS="${MAX_WAIT_SECS:-120}"
|
MAX_WAIT_SECS="${MAX_WAIT_SECS:-120}"
|
||||||
node1_online=false
|
node1_online=false
|
||||||
@ -121,6 +158,7 @@ for ((s=0; s<=MAX_WAIT_SECS; s++))
|
|||||||
do
|
do
|
||||||
node1_online="$($ZT1 -j info | jq '.online' 2>/dev/null)"
|
node1_online="$($ZT1 -j info | jq '.online' 2>/dev/null)"
|
||||||
node2_online="$($ZT2 -j info | jq '.online' 2>/dev/null)"
|
node2_online="$($ZT2 -j info | jq '.online' 2>/dev/null)"
|
||||||
|
echo "Checking for online status: try #$s, node1:$node1_online, node2:$node2_online"
|
||||||
if [[ "$node1_online" == "true" ]]
|
if [[ "$node1_online" == "true" ]]
|
||||||
then
|
then
|
||||||
time_zt_node1_online=`date +%s`
|
time_zt_node1_online=`date +%s`
|
||||||
@ -137,17 +175,32 @@ do
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
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:"
|
||||||
|
$ZT1 status
|
||||||
|
echo -e "\n\nNode 2:"
|
||||||
|
$ZT2 status
|
||||||
|
|
||||||
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." >&2
|
echo "One or more instances of ZeroTier failed to come online. Aborting test."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\nChecking status of each instance:"
|
|
||||||
|
|
||||||
$ZT1 status
|
|
||||||
$ZT2 status
|
|
||||||
|
|
||||||
echo -e "\nJoining networks"
|
echo -e "\nJoining networks"
|
||||||
|
|
||||||
$ZT1 join $TEST_NETWORK
|
$ZT1 join $TEST_NETWORK
|
||||||
@ -188,25 +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..."
|
||||||
|
|
||||||
# Rapidly spam the CLI with joins/leaves
|
spam_cli 10
|
||||||
|
|
||||||
SPAM_TRIES=128
|
|
||||||
|
|
||||||
for ((s=0; s<=SPAM_TRIES; s++))
|
|
||||||
do
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
done
|
|
||||||
|
|
||||||
for ((s=0; s<=SPAM_TRIES; s++))
|
|
||||||
do
|
|
||||||
$ZT1 leave $TEST_NETWORK
|
|
||||||
done
|
|
||||||
|
|
||||||
for ((s=0; s<=SPAM_TRIES; s++))
|
|
||||||
do
|
|
||||||
$ZT1 leave $TEST_NETWORK
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
done
|
|
||||||
|
|
||||||
$ZT1 join $TEST_NETWORK
|
$ZT1 join $TEST_NETWORK
|
||||||
|
|
||||||
@ -399,3 +434,4 @@ EOF
|
|||||||
echo $summary > $FILENAME_SUMMARY
|
echo $summary > $FILENAME_SUMMARY
|
||||||
cat $FILENAME_SUMMARY
|
cat $FILENAME_SUMMARY
|
||||||
|
|
||||||
|
"$@"
|
6
.github/workflows/validate.yml
vendored
6
.github/workflows/validate.yml
vendored
@ -1,4 +1,6 @@
|
|||||||
on: [ push ]
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_ubuntu:
|
build_ubuntu:
|
||||||
@ -36,7 +38,7 @@ jobs:
|
|||||||
CXX: 'g++'
|
CXX: 'g++'
|
||||||
BRANCH: ${{ github.ref_name }}
|
BRANCH: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y valgrind xmlstarlet gcovr iperf3
|
sudo apt install -y valgrind xmlstarlet gcovr iperf3 tree
|
||||||
make one ZT_COVERAGE=1 ZT_TRACE=1
|
make one ZT_COVERAGE=1 ZT_TRACE=1
|
||||||
sudo chmod +x ./.github/workflows/validate-1m-linux.sh
|
sudo chmod +x ./.github/workflows/validate-1m-linux.sh
|
||||||
sudo ./.github/workflows/validate-1m-linux.sh
|
sudo ./.github/workflows/validate-1m-linux.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user