From 30c0fbd98ab3606956ea4cf9b99825b942ebe94c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 21 Jul 2023 17:23:39 +0200 Subject: tests/fsck: add malleable_base64 test filesystem This filesystem contains filenames with non-canonical base64 encodings of the same name "foo", leading to this mess: $ ls mnt/ foo foo foo foo --- tests/fsck/fsck_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/fsck/fsck_test.go') diff --git a/tests/fsck/fsck_test.go b/tests/fsck/fsck_test.go index cebc86b..b70fd49 100644 --- a/tests/fsck/fsck_test.go +++ b/tests/fsck/fsck_test.go @@ -49,6 +49,17 @@ func TestBrokenFsV14(t *testing.T) { } } +func TestMalleableBase64(t *testing.T) { + cmd := exec.Command(test_helpers.GocryptfsBinary, "-fsck", "-extpass", "echo test", "malleable_base64") + outBin, err := cmd.CombinedOutput() + out := string(outBin) + t.Log(out) + code := test_helpers.ExtractCmdExitCode(err) + if code != exitcodes.FsckErrors { + t.Errorf("wrong exit code, have=%d want=%d", code, exitcodes.FsckErrors) + } +} + func TestExampleFses(t *testing.T) { dirfd, err := os.Open("../example_filesystems") if err != nil { -- cgit v1.2.3