X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_sync_test.go;fp=cmd%2Fsafcm%2Fsync_sync_test.go;h=8ef0113f269012e2506a1dd70b17fbaae76c4e86;hp=2214e0ebfa98ebabd473c452d61a3ff3e8a239e2;hb=c661469342af4e738e7ef4a7cedc96c9be4dd9d1;hpb=4206e0dbca82f5df7d8e534f78cb737979880916 diff --git a/cmd/safcm/sync_sync_test.go b/cmd/safcm/sync_sync_test.go index 2214e0e..8ef0113 100644 --- a/cmd/safcm/sync_sync_test.go +++ b/cmd/safcm/sync_sync_test.go @@ -62,8 +62,9 @@ func TestHostSyncReq(t *testing.T) { "host1.example.org", }, Files: map[string]*safcm.File{ - "/": {Path: "/", + "/": { OrigGroup: "group", + Path: "/", Mode: fs.ModeDir | 0755 | fs.ModeSetgid, Uid: -1, Gid: -1, @@ -225,26 +226,26 @@ func TestHostSyncReq(t *testing.T) { Groups: []string{"all", "group-b", "group-a", "host1.example.org"}, Files: map[string]*safcm.File{ "/": { + OrigGroup: "host1.example.org", Path: "/", Mode: fs.ModeDir | 0755, Uid: -1, Gid: -1, - OrigGroup: "host1.example.org", }, "/etc": { + OrigGroup: "host1.example.org", Path: "/etc", Mode: fs.ModeDir | 0755, Uid: -1, Gid: -1, - OrigGroup: "host1.example.org", }, "/etc/dir-to-file": { + OrigGroup: "group-a", Path: "/etc/dir-to-file", Mode: 0644, Uid: -1, Gid: -1, Data: []byte("dir-to-file: from group-a\n"), - OrigGroup: "group-a", }, "/etc/dir-to-filex": { OrigGroup: "group-b", @@ -255,12 +256,12 @@ func TestHostSyncReq(t *testing.T) { Data: []byte("dir-to-filex\n"), }, "/etc/dir-to-link": { + OrigGroup: "group-a", Path: "/etc/dir-to-link", Mode: fs.ModeSymlink | 0777, Uid: -1, Gid: -1, Data: []byte("target"), - OrigGroup: "group-a", }, "/etc/dir-to-linkx": { OrigGroup: "group-b", @@ -271,42 +272,42 @@ func TestHostSyncReq(t *testing.T) { Data: []byte("dir-to-linkx\n"), }, "/etc/file-to-dir": { + OrigGroup: "group-a", Path: "/etc/file-to-dir", Mode: fs.ModeDir | 0755, Uid: -1, Gid: -1, - OrigGroup: "group-a", }, "/etc/file-to-dir/file": { + OrigGroup: "group-a", Path: "/etc/file-to-dir/file", Mode: 0644, Uid: -1, Gid: -1, Data: []byte("file: from group-a\n"), - OrigGroup: "group-a", }, "/etc/file-to-dir/dir": { + OrigGroup: "group-a", Path: "/etc/file-to-dir/dir", Mode: fs.ModeDir | 0755, Uid: -1, Gid: -1, - OrigGroup: "group-a", }, "/etc/file-to-dir/dir/file2": { + OrigGroup: "group-a", Path: "/etc/file-to-dir/dir/file2", Mode: 0644, Uid: -1, Gid: -1, Data: []byte("file2: from group-a\n"), - OrigGroup: "group-a", }, "/etc/motd": { + OrigGroup: "host1.example.org", Path: "/etc/motd", Mode: 0644, Uid: -1, Gid: -1, Data: []byte("motd: from host1\n"), - OrigGroup: "host1.example.org", }, }, }, @@ -328,19 +329,19 @@ func TestHostSyncReq(t *testing.T) { Groups: []string{"all", "group-b", "group-a", "host1.example.org"}, Files: map[string]*safcm.File{ "/": { + OrigGroup: "group-a", Path: "/", Mode: fs.ModeDir | 0755, Uid: -1, Gid: -1, - OrigGroup: "group-a", }, "/file.txt": { + OrigGroup: "group-a", Path: "/file.txt", Mode: 0644, Uid: -1, Gid: -1, Data: []byte("file.txt: from group-a\n"), - OrigGroup: "group-a", }, }, },