]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/sync_sync_test.go
safcm: use Command struct instead of string to run commands
[safcm/safcm.git] / cmd / safcm / sync_sync_test.go
index 31252936e663861f18aa352766ab43479540caae..1294a452dc65bbff13d74852789efdf356cc75e6 100644 (file)
@@ -59,6 +59,7 @@ func TestHostSyncReq(t *testing.T) {
                                Groups: []string{
                                        "all",
                                        "group",
+                                       "group3",
                                        "remove",
                                        "host1.example.org",
                                },
@@ -135,13 +136,17 @@ func TestHostSyncReq(t *testing.T) {
                                Services: []string{
                                        "unbound",
                                },
-                               Commands: []string{
-                                       "echo command one",
-                                       "echo -n command two",
+                               Commands: []*safcm.Command{
+                                       {
+                                               Cmd: "echo command one",
+                                       },
+                                       {
+                                               Cmd: "echo -n command two",
+                                       },
                                },
                        },
                        []string{
-                               "host1.example.org: <nil> 3 host groups: all group host1.example.org remove",
+                               "host1.example.org: <nil> 3 host groups: all group group3 host1.example.org remove",
                                "host1.example.org: <nil> 3 host group priorities (desc. order): host1.example.org",
                        },
                        nil,
@@ -157,6 +162,7 @@ func TestHostSyncReq(t *testing.T) {
                                Groups: []string{
                                        "all",
                                        "group",
+                                       "group3",
                                        "remove",
                                        "host1.example.org",
                                },
@@ -233,9 +239,13 @@ func TestHostSyncReq(t *testing.T) {
                                Services: []string{
                                        "unbound",
                                },
-                               Commands: []string{
-                                       "echo command one",
-                                       "echo -n command two",
+                               Commands: []*safcm.Command{
+                                       {
+                                               Cmd: "echo command one",
+                                       },
+                                       {
+                                               Cmd: "echo -n command two",
+                                       },
                                },
                        },
                        nil,