5 # Initialize server node
21 for script in tinc-up tinc-down host-up host-down subnet-up subnet-down hosts/foo-up hosts/foo-down hosts/bar-up hosts/bar-down invitation-created invitation-accepted; do
22 cat >$d1/$script << EOF
24 echo $script \$NETNAME,\$NAME,\$DEVICE,\$IFACE,\$NODE,\$REMOTEADDRESS,\$REMOTEPORT,\$SUBNET,\$WEIGHT,\$INVITATION_FILE,\$INVITATION_URL,\$DEBUG >>$OUT
31 $tinc -n netname $c1 start $r1
33 echo foo-started >>$OUT
37 url=`$tinc -n netname2 $c1 invite bar`
38 file=`cd $d1/invitations; ls | grep -v ed25519_key.priv`
39 echo bar-invited >>$OUT
40 $tinc -n netname3 $c2 join $url
41 echo bar-joined >>$OUT
43 # Start and stop client node
49 add Subnet fec0::/64#5
55 echo bar-started >>$OUT
62 echo bar-stopped >>$OUT
69 echo bar-started >>$OUT
75 # Check if the script output is what is expected
77 cat >$OUT.expected << EOF
78 tinc-up netname,foo,dummy,,,,,,,,,5
79 subnet-up netname,foo,dummy,,foo,,,10.0.0.1,,,,5
80 subnet-up netname,foo,dummy,,foo,,,fec0::/64,,,,5
82 invitation-created netname2,foo,,,bar,,,,,$d1/invitations/$file,$url,
84 invitation-accepted netname,foo,dummy,,bar,127.0.0.1,,,,,,5
86 host-up netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
87 hosts/bar-up netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
88 subnet-up netname,foo,dummy,,bar,127.0.0.1,32760,10.0.0.2,,,,5
89 subnet-up netname,foo,dummy,,bar,127.0.0.1,32760,fec0::/64,5,,,5
91 host-down netname,foo,dummy,,bar,127.0.0.1,32760,,,,,4
92 hosts/bar-down netname,foo,dummy,,bar,127.0.0.1,32760,,,,,4
93 subnet-down netname,foo,dummy,,bar,127.0.0.1,32760,10.0.0.2,,,,4
94 subnet-down netname,foo,dummy,,bar,127.0.0.1,32760,fec0::/64,5,,,4
96 host-up netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
97 hosts/bar-up netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
98 subnet-up netname,foo,dummy,,bar,127.0.0.1,32760,10.0.0.2,,,,5
99 subnet-up netname,foo,dummy,,bar,127.0.0.1,32760,fec0::/64,5,,,5
101 host-down netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
102 hosts/bar-down netname,foo,dummy,,bar,127.0.0.1,32760,,,,,5
103 subnet-down netname,foo,dummy,,bar,127.0.0.1,32760,10.0.0.2,,,,5
104 subnet-down netname,foo,dummy,,bar,127.0.0.1,32760,fec0::/64,5,,,5
105 subnet-down netname,foo,dummy,,foo,,,10.0.0.1,,,,5
106 subnet-down netname,foo,dummy,,foo,,,fec0::/64,,,,5
107 tinc-down netname,foo,dummy,,,,,,,,,5
110 cmp $OUT $OUT.expected