3 # Skip this test if the legacy protocol is disabled
4 if grep -q "define DISABLE_LEGACY 1" "${0%/*}/../config.h"; then
10 # Initialize two nodes
28 # Exchange host config files
30 $tinc $c1 export | $tinc $c2 exchange | $tinc $c1 import
31 $tinc $c2 add ConnectTo foo
35 $tinc $c2 set ExperimentalProtocol no
36 $tinc $c1 del bar.Ed25519PublicKey
37 $tinc $c2 del foo.Ed25519PublicKey
44 test `$tinc $c1 dump reachable nodes | wc -l` = 2
45 test `$tinc $c2 dump reachable nodes | wc -l` = 2
50 test -z "`$tinc $c1 get bar.Ed25519PublicKey`"
51 test -z "`$tinc $c2 get foo.Ed25519PublicKey`"
53 # Foo 1.1, bar upgrades to 1.1
55 $tinc $c2 del ExperimentalProtocol
62 test `$tinc $c1 dump reachable nodes | wc -l` = 2
63 test `$tinc $c2 dump reachable nodes | wc -l` = 2
68 test -n "`$tinc $c1 get bar.Ed25519PublicKey`"
69 test -n "`$tinc $c2 get foo.Ed25519PublicKey`"
71 # Bar downgrades, must no longer be allowed to connect
73 $tinc $c2 set ExperimentalProtocol no
80 test `$tinc $c1 dump reachable nodes | wc -l` = 1
81 test `$tinc $c2 dump reachable nodes | wc -l` = 1