X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm-remote%2Fsync%2Ffiles_test.go;h=57d27c7fa8e043b06543387a1a15a720fcdb0755;hb=b088bf0b7e872d0e6ba230d4e4b79625af4fb17e;hp=3cf7e04358386909a237150536e50d7acf03416d;hpb=edc7998408e700323fc7b6f8a9537ac16dfc6c13;p=safcm%2Fsafcm.git diff --git a/cmd/safcm-remote/sync/files_test.go b/cmd/safcm-remote/sync/files_test.go index 3cf7e04..57d27c7 100644 --- a/cmd/safcm-remote/sync/files_test.go +++ b/cmd/safcm-remote/sync/files_test.go @@ -70,7 +70,7 @@ func TestSyncFiles(t *testing.T) { }{ // NOTE: Also update MsgSyncResp in safcm test cases when - // changing anything here! + // changing the MsgSyncResp struct! // See TestSyncFile() for most file related tests. This // function only tests the overall results and triggers. @@ -415,10 +415,7 @@ func TestSyncFiles(t *testing.T) { }, }, func() { - err = os.Chmod(".", 0750) - if err != nil { - panic(err) - } + ft.CreateDirectoryExists(".", 0750) ft.CreateDirectory("dir", 0755) ft.CreateFile("dir/file", "content\n", 0644) }, @@ -850,7 +847,10 @@ func TestSyncFiles(t *testing.T) { s, res := prepareSync(tc.req, &testRunner{ t: t, }) - s.setDefaults() + err = s.setDefaults() + if err != nil { + t.Fatal(err) + } err = s.syncFiles() testutil.AssertErrorEqual(t, "err", err, tc.expErr) @@ -917,7 +917,7 @@ func TestSyncFile(t *testing.T) { }{ // NOTE: Also update MsgSyncResp in safcm test cases when - // changing anything here! + // changing the MsgSyncResp struct! // TODO: Add tests for chown and run them only as root @@ -2239,7 +2239,7 @@ file Group: group, Gid: gid, }, - DataDiff: "Binary files differ, cannot show diff", + DataDiff: "Binary files differ (3 -> 4 bytes), cannot show diff", }, }, }, @@ -2295,7 +2295,7 @@ file Gid: gid, }, DataDiff: `@@ -1,2 +1,2 @@ -- +- +content `, @@ -2355,7 +2355,7 @@ file }, DataDiff: `@@ -1,2 +1,2 @@ -content -+ ++ `, }, @@ -2390,7 +2390,10 @@ file s, res := prepareSync(tc.req, &testRunner{ t: t, }) - s.setDefaults() + err = s.setDefaults() + if err != nil { + t.Fatal(err) + } // Deterministic temporary symlink names rand.Seed(0)