15 # Generate an invitation and let another node join the VPN
19 cat >$d1/invitation-created <<EOF
21 echo Name = \$NODE >\$INVITATION_FILE
22 echo Ifconfig = 93.184.216.34/24 >>\$INVITATION_FILE
23 echo Route = 2606:2800:220:1::/64 2606:2800:220:1:248:1893:25c8:1946 >>\$INVITATION_FILE
24 echo Route = 1.2.3.4 1234:: >>\$INVITATION_FILE
25 $tinc $c1 export >>\$INVITATION_FILE
28 chmod u+x $d1/invitation-created
30 $tinc $c1 invite bar | $tinc $c2 --batch join
32 # Test equivalence of host config files
34 cmp $d1/hosts/foo $d2/hosts/foo
35 test "`grep ^Ed25519PublicKey $d1/hosts/bar`" = "`grep ^Ed25519PublicKey $d2/hosts/bar`"
37 # Check if the tinc-up.invitation file is created and contains the right commands
39 test -f $d2/tinc-up.invitation
41 fgrep -q "93.184.216.34/24" $d2/tinc-up.invitation
42 fgrep -q "2606:2800:220:1::/64" $d2/tinc-up.invitation
43 fgrep -q "2606:2800:220:1:248:1893:25c8:1946" $d2/tinc-up.invitation
44 fgrep -q "1234::" $d2/tinc-up.invitation && exit 1
46 # Check that no tinc-up is created and that tinc-up.invitation is not executable
48 test -x $d2/tinc-up.invitation && exit 1
49 test -f $d2/tinc-up && exit 1