Restore libgcrypt support.
[tinc] / test / invite-offline.test
1 #!/bin/sh
2
3 . ./testlib.sh
4
5 echo [STEP] Initialize one node
6
7 tinc foo <<EOF
8 init foo
9 set DeviceType dummy
10 set Mode switch
11 set Broadcast no
12 set Address localhost
13 set Port 30020
14 EOF
15
16 echo [STEP] Generate an invitation offline and let another node join the VPN
17
18 invitation=$(tinc foo invite bar)
19
20 start_tinc foo
21 tinc bar join "$invitation"
22
23 echo [STEP] Test equivalence of host config files
24
25 diff -w "$DIR_FOO/hosts/foo" "$DIR_BAR/hosts/foo"
26 test "$(grep ^Ed25519PublicKey "$DIR_FOO/hosts/bar")" = "$(grep ^Ed25519PublicKey "$DIR_BAR/hosts/bar")"
27
28 echo [STEP] Test Mode, Broadcast and ConnectTo statements
29
30 test "$(tinc bar get Mode)" = switch
31 test "$(tinc bar get Broadcast)" = no
32 test "$(tinc bar get ConnectTo)" = foo
33
34 echo [STEP] Check whether the new node can join the VPN
35
36 tinc bar <<EOF
37 set DeviceType dummy
38 set Port 0
39 EOF
40
41 create_script foo hosts/bar-up
42 create_script bar hosts/foo-up
43
44 start_tinc bar
45
46 wait_script foo hosts/bar-up
47 wait_script bar hosts/foo-up
48
49 require_nodes foo 2
50 require_nodes bar 2