From 8915785acf7e6e7908b32103406620f243093931 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 19 Jul 2020 23:03:47 +0200 Subject: v2api: fsck: use a temporary mount Directly accessing the Nodes does not work properly, as there is no way to attach a newly LOOKUPped Node to the tree. This means Path() does not work. Use an actual mount instead and walk the tree. --- tests/fsck/fsck_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/fsck') diff --git a/tests/fsck/fsck_test.go b/tests/fsck/fsck_test.go index f56e21c..3aaba9e 100644 --- a/tests/fsck/fsck_test.go +++ b/tests/fsck/fsck_test.go @@ -6,6 +6,7 @@ import ( "os/exec" "runtime" "strings" + "syscall" "testing" "time" @@ -98,8 +99,8 @@ func TestTerabyteFile(t *testing.T) { pDir := cDir + ".mnt" test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test") defer test_helpers.UnmountErr(pDir) - exabyteFile := pDir + "/exabyteFile" - fd, err := os.Create(exabyteFile) + veryBigFile := pDir + "/veryBigFile" + fd, err := os.Create(veryBigFile) if err != nil { t.Fatal(err) } @@ -119,8 +120,8 @@ func TestTerabyteFile(t *testing.T) { cmd.Stdout = os.Stdout cmd.Start() timer := time.AfterFunc(10*time.Second, func() { - cmd.Process.Kill() - t.Fatalf("timeout") + t.Error("timeout, sending SIGINT") + syscall.Kill(cmd.Process.Pid, syscall.SIGINT) }) cmd.Wait() timer.Stop() -- cgit v1.2.3