Ensure "make distcheck" really runs without errors.
[tinc] / test / invite-join.test
1 #!/bin/sh
2
3 . "${0%/*}/testlib.sh"
4
5 # Initialize one node
6
7 $tinc $c1 <<EOF
8 init foo
9 set DeviceType dummy
10 set Mode switch
11 set Broadcast no
12 del Port
13 set Address localhost
14 set Port 32751
15 start $r1
16 EOF
17
18 # Generate an invitation and let another node join the VPN
19
20 $tinc $c1 invite bar | $tinc $c2 join
21
22 # Test equivalence of host config files
23
24 cmp $d1/hosts/foo $d2/hosts/foo
25 test "`grep ^Ed25519PublicKey $d1/hosts/bar`" = "`grep ^Ed25519PublicKey $d2/hosts/bar`"
26
27 # Test Mode, Broadcast and ConnectTo statements
28
29 test `$tinc $c2 get Mode` = switch
30 test `$tinc $c2 get Broadcast` = no
31 test `$tinc $c2 get ConnectTo` = foo
32
33 # Check whether the new node can join the VPN
34
35 $tinc $c2 << EOF
36 set DeviceType dummy
37 set Port 0
38 start $r2
39 EOF
40
41 sleep 1
42
43 test `$tinc $c1 dump reachable nodes | wc -l` = 2
44 test `$tinc $c2 dump reachable nodes | wc -l` = 2
45
46 $tinc $c2 stop
47 $tinc $c1 stop