diff options
| author | Joseph Henry <[email protected]> | 2023-08-25 09:51:33 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-25 12:51:33 -0400 |
| commit | 7637ef10d7e746991282960e77c948e4bc77de9e (patch) | |
| tree | 45502b14c0acfbd24e866e2a7966b0e891a27c97 /.github/workflows | |
| parent | ffb63f3ee5616b069ab453427f4f62701b8ed802 (diff) | |
Fix primary port binding issue in 1.12 (#2107)
* Add test for primary port bindings to validator - See #2105
* Add delay to binding test
* Remove TCP binding logic from Binder to fix #2105
* add second control plane socket for ipv6
* fix controller network post endpoint
* exit if we can't bind at least one of IPV4 or IPV6 for control plane port
---------
Co-authored-by: Grant Limberg <[email protected]>
Diffstat (limited to '.github/workflows')
| -rwxr-xr-x | .github/workflows/validate-linux.sh | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/.github/workflows/validate-linux.sh b/.github/workflows/validate-linux.sh index 61670d67..a661f6f6 100755 --- a/.github/workflows/validate-linux.sh +++ b/.github/workflows/validate-linux.sh @@ -20,6 +20,9 @@ mkdir $TEST_DIR_PREFIX # How long we will wait for ZT to come online before considering it a failure MAX_WAIT_SECS=30 +ZT_PORT_NODE_1=9996 +ZT_PORT_NODE_2=9997 + ################################################################################ # Multi-node connectivity and performance test # ################################################################################ @@ -99,14 +102,19 @@ test() { --xml=yes \ --xml-file=$FILENAME_MEMORY_LOG \ --leak-check=full \ - ./zerotier-one node1 -p9996 -U >>node_1.log 2>&1 & + ./zerotier-one node1 -p$ZT_PORT_NODE_1 -U >>node_1.log 2>&1 & # Second instance, not run in memory profiler # Don't set up internet access until _after_ zerotier is running # This has been a source of stuckness in the past. $NS2 ip addr del 192.168.1.2/24 dev veth3 - $NS2 sudo ./zerotier-one node2 -U -p9997 >>node_2.log 2>&1 & - sleep 1; + $NS2 sudo ./zerotier-one node2 -U -p$ZT_PORT_NODE_2 >>node_2.log 2>&1 & + + sleep 10; # New HTTP control plane is a bit sluggish, so we delay here + + check_bind_to_correct_ports $ZT_PORT_NODE_1 + check_bind_to_correct_ports $ZT_PORT_NODE_2 + $NS2 ip addr add 192.168.1.2/24 dev veth3 $NS2 ip route add default via 192.168.1.1 @@ -458,4 +466,32 @@ check_exit_on_invalid_identity() { fi } +################################################################################ +# Check that we're binding to the primary port for TCP/TCP6/UDP # +################################################################################ + +check_bind_to_correct_ports() { + PORT_NUMBER=$1 + echo "Checking bound ports:" + sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" + if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp") ]]; + then + : + else + exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp/$1" + fi + if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp6") ]]; + then + : + else + exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp6/$1" + fi + if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "udp") ]]; + then + : + else + exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to udp/$1" + fi +} + test "$@" |
