8 test "`$tinc $c1 get Name`" = "foo"
10 # Test case sensitivity
12 $tinc $c1 set Mode switch
13 test "`$tinc $c1 get Mode`" = "switch"
14 test "`$tinc $c1 get mode`" = "switch"
15 $tinc $c1 set mode router
16 test "`$tinc $c1 get Mode`" = "router"
17 test "`$tinc $c1 get mode`" = "router"
18 $tinc $c1 set Mode Switch
19 test "`$tinc $c1 get Mode`" = "Switch"
23 $tinc $c1 del Mode hub
&& exit 1 || true
24 $tinc $c1 del Mode switch
25 test -z "`$tinc $c1 get Mode`"
27 # There can only be one Mode variable
29 $tinc $c1 add Mode switch
30 $tinc $c1 add Mode hub
31 test "`$tinc $c1 get Mode`" = "hub"
33 # Test addition/deletion of multivalued variables
35 $tinc $c1 add Subnet
1
36 $tinc $c1 add Subnet
2
37 $tinc $c1 add Subnet
2
38 $tinc $c1 add Subnet
3
39 test "`$tinc $c1 get Subnet`" = "1
43 $tinc $c1 del Subnet
2
44 test "`$tinc $c1 get Subnet`" = "1
47 test -z "`$tinc $c1 get Subnet`"
49 # We should not be able to get/set server variables using node.variable syntax
51 test -z "`$tinc $c1 get foo.Name`"
52 $tinc $c1 set foo.Name bar
&& exit 1 || true
54 # Test getting/setting host variables for other nodes
58 $tinc $c1 add bar.PMTU
1
59 $tinc $c1 add bar.PMTU
2
60 test "`$tinc $c1 get bar.PMTU`" = "2"
62 $tinc $c1 add bar.Subnet
1
63 $tinc $c1 add bar.Subnet
2
64 $tinc $c1 add bar.Subnet
2
65 $tinc $c1 add bar.Subnet
3
66 test "`$tinc $c1 get bar.Subnet`" = "1
70 $tinc $c1 del bar.Subnet
2
71 test "`$tinc $c1 get bar.Subnet`" = "1
73 $tinc $c1 del bar.Subnet
74 test -z "`$tinc $c1 get bar.Subnet`"
76 # We should not be able to get/set for nodes with invalid names
80 $tinc $c1 set qu-ux.Subnet
1 && exit 1 || true
82 # We should not be able to set obsolete variables unless forced
84 $tinc $c1 set PrivateKey
12345 && exit 1 || true
85 $tinc $c1 --force set PrivateKey
12345
86 test "`$tinc $c1 get PrivateKey`" = "12345"
87 $tinc $c1 del PrivateKey
88 test -z "`$tinc $c1 get PrivateKey`"