projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow running tests on macOS
[tinc]
/
test
/
variables.test
diff --git
a/test/variables.test
b/test/variables.test
index
5fe6046
..
d9494b4
100755
(executable)
--- a/
test/variables.test
+++ b/
test/variables.test
@@
-1,22
+1,22
@@
#!/bin/sh
#!/bin/sh
-.
./testlib.sh
+.
"${0%/*}/testlib.sh"
# Initialize one node
$tinc $c1 init foo
# Initialize one node
$tinc $c1 init foo
-test "`$tinc $c1 get Name`" = "foo"
+test "`$tinc $c1 get Name
| tr -d '\r'
`" = "foo"
# Test case sensitivity
$tinc $c1 set Mode switch
# Test case sensitivity
$tinc $c1 set Mode switch
-test "`$tinc $c1 get Mode`" = "switch"
-test "`$tinc $c1 get mode`" = "switch"
+test "`$tinc $c1 get Mode
| tr -d '\r'
`" = "switch"
+test "`$tinc $c1 get mode
| tr -d '\r'
`" = "switch"
$tinc $c1 set mode router
$tinc $c1 set mode router
-test "`$tinc $c1 get Mode`" = "router"
-test "`$tinc $c1 get mode`" = "router"
+test "`$tinc $c1 get Mode
| tr -d '\r'
`" = "router"
+test "`$tinc $c1 get mode
| tr -d '\r'
`" = "router"
$tinc $c1 set Mode Switch
$tinc $c1 set Mode Switch
-test "`$tinc $c1 get Mode`" = "Switch"
+test "`$tinc $c1 get Mode
| tr -d '\r'
`" = "Switch"
# Test deletion
# Test deletion
@@
-28,7
+28,7
@@
test -z "`$tinc $c1 get Mode`"
$tinc $c1 add Mode switch
$tinc $c1 add Mode hub
$tinc $c1 add Mode switch
$tinc $c1 add Mode hub
-test "`$tinc $c1 get Mode`" = "hub"
+test "`$tinc $c1 get Mode
| tr -d '\r'
`" = "hub"
# Test addition/deletion of multivalued variables
# Test addition/deletion of multivalued variables
@@
-36,11
+36,11
@@
$tinc $c1 add Subnet 1
$tinc $c1 add Subnet 2
$tinc $c1 add Subnet 2
$tinc $c1 add Subnet 3
$tinc $c1 add Subnet 2
$tinc $c1 add Subnet 2
$tinc $c1 add Subnet 3
-test "`$tinc $c1 get Subnet`" = "1
+test "`$tinc $c1 get Subnet
| tr -d '\r'
`" = "1
2
3"
$tinc $c1 del Subnet 2
2
3"
$tinc $c1 del Subnet 2
-test "`$tinc $c1 get Subnet`" = "1
+test "`$tinc $c1 get Subnet
| tr -d '\r'
`" = "1
3"
$tinc $c1 del Subnet
test -z "`$tinc $c1 get Subnet`"
3"
$tinc $c1 del Subnet
test -z "`$tinc $c1 get Subnet`"
@@
-56,17
+56,17
@@
touch $d1/hosts/bar
$tinc $c1 add bar.PMTU 1
$tinc $c1 add bar.PMTU 2
$tinc $c1 add bar.PMTU 1
$tinc $c1 add bar.PMTU 2
-test "`$tinc $c1 get bar.PMTU`" = "2"
+test "`$tinc $c1 get bar.PMTU
| tr -d '\r'
`" = "2"
$tinc $c1 add bar.Subnet 1
$tinc $c1 add bar.Subnet 2
$tinc $c1 add bar.Subnet 2
$tinc $c1 add bar.Subnet 3
$tinc $c1 add bar.Subnet 1
$tinc $c1 add bar.Subnet 2
$tinc $c1 add bar.Subnet 2
$tinc $c1 add bar.Subnet 3
-test "`$tinc $c1 get bar.Subnet`" = "1
+test "`$tinc $c1 get bar.Subnet
| tr -d '\r'
`" = "1
2
3"
$tinc $c1 del bar.Subnet 2
2
3"
$tinc $c1 del bar.Subnet 2
-test "`$tinc $c1 get bar.Subnet`" = "1
+test "`$tinc $c1 get bar.Subnet
| tr -d '\r'
`" = "1
3"
$tinc $c1 del bar.Subnet
test -z "`$tinc $c1 get bar.Subnet`"
3"
$tinc $c1 del bar.Subnet
test -z "`$tinc $c1 get bar.Subnet`"
@@
-81,6
+81,6
@@
$tinc $c1 set qu-ux.Subnet 1 && exit 1 || true
$tinc $c1 set PrivateKey 12345 && exit 1 || true
$tinc $c1 --force set PrivateKey 12345
$tinc $c1 set PrivateKey 12345 && exit 1 || true
$tinc $c1 --force set PrivateKey 12345
-test "`$tinc $c1 get PrivateKey`" = "12345"
+test "`$tinc $c1 get PrivateKey
| tr -d '\r'
`" = "12345"
$tinc $c1 del PrivateKey
test -z "`$tinc $c1 get PrivateKey`"
$tinc $c1 del PrivateKey
test -z "`$tinc $c1 get PrivateKey`"