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
42 $tinc $c1 del Subnet 2
43 test "`$tinc $c1 get Subnet`" = "1
46 test -z "`$tinc $c1 get Subnet`"
48 # We should not be able to get/set server variables using node.variable syntax
50 test -z "`$tinc $c1 get foo.Name`"
51 $tinc $c1 set foo.Name bar && exit 1 || true
53 # Test getting/setting host variables for other nodes
57 $tinc $c1 add bar.PMTU 1
58 $tinc $c1 add bar.PMTU 2
59 test "`$tinc $c1 get bar.PMTU`" = "2"
61 $tinc $c1 add bar.Subnet 1
62 $tinc $c1 add bar.Subnet 2
63 $tinc $c1 add bar.Subnet 2
64 $tinc $c1 add bar.Subnet 3
65 test "`$tinc $c1 get bar.Subnet`" = "1
68 $tinc $c1 del bar.Subnet 2
69 test "`$tinc $c1 get bar.Subnet`" = "1
71 $tinc $c1 del bar.Subnet
72 test -z "`$tinc $c1 get bar.Subnet`"
74 # We should not be able to get/set for nodes with invalid names
78 $tinc $c1 set qu-ux.Subnet 1 && exit 1 || true
80 # We should not be able to set obsolete variables unless forced
82 $tinc $c1 set PrivateKey 12345 && exit 1 || true
83 $tinc $c1 --force set PrivateKey 12345
84 test "`$tinc $c1 get PrivateKey`" = "12345"
85 $tinc $c1 del PrivateKey
86 test -z "`$tinc $c1 get PrivateKey`"