aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-19 23:03:47 +0200
committerJakob Unterwurzacher2020-07-19 23:03:47 +0200
commit8915785acf7e6e7908b32103406620f243093931 (patch)
tree94b7e6f1636f4d3355f8c13723125fc40a45f562 /tests
parent49fc3abcb4867ea4ce2426340dbe583ef6de055a (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/fsck/fsck_test.go9
1 files changed, 5 insertions, 4 deletions
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()