aboutsummaryrefslogtreecommitdiff
path: root/tests/test_helpers/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_helpers/helpers.go')
-rw-r--r--tests/test_helpers/helpers.go32
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index 90b00b6..01ef319 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -227,20 +227,23 @@ func TestMkdirRmdir(t *testing.T, plainDir string) {
dir := plainDir + "/dir1"
err := os.Mkdir(dir, 0777)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
err = syscall.Rmdir(dir)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
-
// Removing a non-empty dir should fail with ENOTEMPTY
if os.Mkdir(dir, 0777) != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
f, err := os.Create(dir + "/file")
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
f.Close()
err = syscall.Rmdir(dir)
@@ -249,23 +252,26 @@ func TestMkdirRmdir(t *testing.T, plainDir string) {
t.Errorf("Should have gotten ENOTEMPTY, go %v", errno)
}
if syscall.Unlink(dir+"/file") != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
if syscall.Rmdir(dir) != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
-
// We should also be able to remove a directory we do not have permissions to
// read or write
err = os.Mkdir(dir, 0000)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
err = syscall.Rmdir(dir)
if err != nil {
// Make sure the directory can cleaned up by the next test run
os.Chmod(dir, 0700)
- t.Fatal(err)
+ t.Error(err)
+ return
}
}
@@ -275,11 +281,13 @@ func TestRename(t *testing.T, plainDir string) {
file2 := plainDir + "/rename2"
err := ioutil.WriteFile(file1, []byte("content"), 0777)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
err = syscall.Rename(file1, file2)
if err != nil {
- t.Fatal(err)
+ t.Error(err)
+ return
}
syscall.Unlink(file2)
}