3 # shellcheck disable=SC1090
6 echo [STEP] Initialize one node
15 create_script foo tinc-up
17 wait_script foo tinc-up
19 echo [STEP] Generate an invitation and let another node join the VPN
21 # shellcheck disable=SC2016
22 create_script foo invitation-created '
23 cat >"$INVITATION_FILE" <<INVITE
25 Ifconfig = 93.184.216.34/24
26 Route = 2606:2800:220:1::/64 2606:2800:220:1:248:1893:25c8:1946
27 Route = 1.2.3.4 1234::
33 tinc foo invite bar | tail -1 | tinc bar --batch join
35 echo [STEP] Test equivalence of host config files
37 diff -w "$DIR_FOO/hosts/foo" "$DIR_BAR/hosts/foo"
38 test "$(grep ^Ed25519PublicKey "$DIR_FOO/hosts/bar")" = "$(grep ^Ed25519PublicKey "$DIR_BAR/hosts/bar")"
40 echo [STEP] Check if the tinc-up.invitation file is created and contains the right commands
42 bar_tinc_up="$DIR_BAR/tinc-up.invitation"
43 test -f "$bar_tinc_up"
45 grep -F -q "93.184.216.34/24" "$bar_tinc_up"
46 grep -F -q "2606:2800:220:1::/64" "$bar_tinc_up"
47 grep -F -q "2606:2800:220:1:248:1893:25c8:1946" "$bar_tinc_up"
48 must_fail grep -F -q "1234::" "$bar_tinc_up"
50 echo [STEP] Check that no tinc-up is created and that tinc-up.invitation is not executable
52 must_fail test -x "$bar_tinc_up"
53 must_fail test -f "$DIR_BAR/tinc-up"