projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memcmp() reading out of bounds in the tinc info command.
[tinc]
/
test
/
invite-offline.test
diff --git
a/test/invite-offline.test
b/test/invite-offline.test
index
0903417
..
aea39b4
100755
(executable)
--- a/
test/invite-offline.test
+++ b/
test/invite-offline.test
@@
-1,50
+1,50
@@
#!/bin/sh
#!/bin/sh
-.
"${0%/*}/testlib.sh"
+.
./testlib.sh
-
#
Initialize one node
+
echo [STEP]
Initialize one node
-
$tinc $c1
<<EOF
+
tinc foo
<<EOF
init foo
set DeviceType dummy
set Mode switch
set Broadcast no
init foo
set DeviceType dummy
set Mode switch
set Broadcast no
-del Port
set Address localhost
set Address localhost
-set Port 3
2758
+set Port 3
0020
EOF
EOF
-
#
Generate an invitation offline and let another node join the VPN
+
echo [STEP]
Generate an invitation offline and let another node join the VPN
-invitation=
`$tinc $c1 invite bar`
+invitation=
$(tinc foo invite bar)
-$tinc $c1 start $r1
+start_tinc foo
+tinc bar join "$invitation"
-$tinc $c2 join $invitation
+echo [STEP] Test equivalence of host config files
-# Test equivalence of host config files
+diff -w "$DIR_FOO/hosts/foo" "$DIR_BAR/hosts/foo"
+test "$(grep ^Ed25519PublicKey "$DIR_FOO/hosts/bar")" = "$(grep ^Ed25519PublicKey "$DIR_BAR/hosts/bar")"
-cmp $d1/hosts/foo $d2/hosts/foo
-test "`grep ^Ed25519PublicKey $d1/hosts/bar`" = "`grep ^Ed25519PublicKey $d2/hosts/bar`"
+echo [STEP] Test Mode, Broadcast and ConnectTo statements
-# Test Mode, Broadcast and ConnectTo statements
+test "$(tinc bar get Mode)" = switch
+test "$(tinc bar get Broadcast)" = no
+test "$(tinc bar get ConnectTo)" = foo
-test `$tinc $c2 get Mode` = switch
-test `$tinc $c2 get Broadcast` = no
-test `$tinc $c2 get ConnectTo` = foo
+echo [STEP] Check whether the new node can join the VPN
-# Check whether the new node can join the VPN
-
-$tinc $c2 << EOF
+tinc bar <<EOF
set DeviceType dummy
set Port 0
set DeviceType dummy
set Port 0
-start $r2
EOF
EOF
-sleep 1
+create_script foo hosts/bar-up
+create_script bar hosts/foo-up
+
+start_tinc bar
-test `$tinc $c1 dump reachable nodes | wc -l` = 2
-test `$tinc $c2 dump reachable nodes | wc -l` = 2
+wait_script foo hosts/bar-up
+wait_script bar hosts/foo-up
-$tinc $c2 stop
-$tinc $c1 stop
+require_nodes foo 2
+require_nodes bar 2