X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_sync_test.go;h=a5f65811e0d82297f642f01dcf027dd175ff9da3;hp=e96fe140ae612a6a08f2429388c2d333fced2191;hb=20686d0d25d7d22f577fc80df31c192b6a88d318;hpb=4ce09b6e6f7056883af10c3207aed6866657f9f9 diff --git a/cmd/safcm/sync_sync_test.go b/cmd/safcm/sync_sync_test.go index e96fe14..a5f6581 100644 --- a/cmd/safcm/sync_sync_test.go +++ b/cmd/safcm/sync_sync_test.go @@ -428,6 +428,39 @@ func TestHostSyncReq(t *testing.T) { }, nil, }, + + { + "group_order (single group)", + "project-group_order-single", + "host1.example.org", + nil, + safcm.LogDebug3, + safcm.MsgSyncReq{ + Groups: []string{"all", "group-b", "group-a", "host1.example.org"}, + Files: map[string]*safcm.File{ + "/": { + Path: "/", + Mode: fs.ModeDir | 0755, + Uid: -1, + Gid: -1, + OrigGroup: "group-a", + }, + "/file.txt": { + Path: "/file.txt", + Mode: 0644, + Uid: -1, + Gid: -1, + Data: []byte("file.txt: from group-a\n"), + OrigGroup: "group-a", + }, + }, + }, + []string{ + "host1.example.org: 3 host groups: all group-a group-b host1.example.org", + "host1.example.org: 3 host group priorities (desc. order): host1.example.org group-a", + }, + nil, + }, } for _, tc := range tests {