5 echo [STEP] Initialize one node
8 test "$(tinc foo get Name)" = "foo"
10 echo [STEP] Test case sensitivity
12 tinc foo set Mode switch
13 test "$(tinc foo get Mode)" = "switch"
14 test "$(tinc foo get mode)" = "switch"
16 tinc foo set mode router
17 test "$(tinc foo get Mode)" = "router"
18 test "$(tinc foo get mode)" = "router"
20 tinc foo set Mode Switch
21 test "$(tinc foo get Mode)" = "Switch"
23 echo [STEP] Test deletion
25 expect_code "$EXIT_FAILURE" tinc foo del Mode hub
26 tinc foo del Mode switch
27 test -z "$(tinc foo get Mode)"
29 echo [STEP] There can only be one Mode variable
31 tinc foo add Mode switch
33 test "$(tinc foo get Mode)" = "hub"
35 echo [STEP] Test addition/deletion of multivalued variables
41 test "$(tinc foo get Subnet | rm_cr)" = "1
46 test "$(tinc foo get Subnet | rm_cr)" = "1
50 test -z "$(tinc foo get Subnet)"
52 echo [STEP] We should not be able to get/set server variables using node.variable syntax
54 test -z "$(tinc foo get foo.Name)"
55 expect_code "$EXIT_FAILURE" tinc foo set foo.Name bar
57 echo [STEP] Test getting/setting host variables for other nodes
59 touch "$DIR_FOO/hosts/bar"
61 tinc foo add bar.PMTU 1
62 tinc foo add bar.PMTU 2
63 test "$(tinc foo get bar.PMTU)" = "2"
65 tinc foo add bar.Subnet 1
66 tinc foo add bar.Subnet 2
67 tinc foo add bar.Subnet 2
68 tinc foo add bar.Subnet 3
69 test "$(tinc foo get bar.Subnet | rm_cr)" = "1
73 tinc foo del bar.Subnet 2
74 test "$(tinc foo get bar.Subnet | rm_cr)" = "1
77 tinc foo del bar.Subnet
78 test -z "$(tinc foo get bar.Subnet)"
80 echo [STEP] We should not be able to get/set for nodes with invalid names
82 touch "$DIR_FOO/hosts/qu-ux"
83 expect_code "$EXIT_FAILURE" tinc foo set qu-ux.Subnet 1
85 echo [STEP] We should not be able to set obsolete variables unless forced
87 expect_code "$EXIT_FAILURE" tinc foo set PrivateKey 12345
88 tinc foo --force set PrivateKey 12345
89 test "$(tinc foo get PrivateKey)" = "12345"
91 tinc foo del PrivateKey
92 test -z "$(tinc foo get PrivateKey)"