aboutsummaryrefslogtreecommitdiff
path: root/tests/cli
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-03-20 10:33:34 +0100
committerJakob Unterwurzacher2021-03-20 10:33:34 +0100
commit255a71c9179b9ad32587b20c41f81dc0b8cc3f44 (patch)
treec44357ac4c26defcf192e556a9a2f7c917ec2d0e /tests/cli
parentf6036c429a35dff83bd01b3e867262cf7e8468ef (diff)
tests: MountOrFatal creates mnt dir itself
Allows to drop a few Mkdir()s.
Diffstat (limited to 'tests/cli')
-rw-r--r--tests/cli/cli_test.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index 9d25062..9248f5d 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -516,17 +516,13 @@ func TestMultipleOperationFlags(t *testing.T) {
func TestNoexec(t *testing.T) {
dir := test_helpers.InitFS(t)
mnt := dir + ".mnt"
- err := os.Mkdir(mnt, 0700)
- if err != nil {
- t.Fatal(err)
- }
test_helpers.MountOrFatal(t, dir, mnt, "-extpass=echo test", "-noexec")
defer test_helpers.UnmountPanic(mnt)
sh := mnt + "/x.sh"
content := `#!/bin/bash
echo hello
`
- err = ioutil.WriteFile(sh, []byte(content), 0755)
+ err := ioutil.WriteFile(sh, []byte(content), 0755)
if err != nil {
t.Fatal(err)
}
@@ -633,11 +629,7 @@ func TestIdle(t *testing.T) {
func TestNotIdle(t *testing.T) {
dir := test_helpers.InitFS(t)
mnt := dir + ".mnt"
- err := os.Mkdir(mnt, 0700)
- if err != nil {
- t.Fatal(err)
- }
- err = test_helpers.Mount(dir, mnt, false, "-extpass", "echo test", "-i=100ms")
+ err := test_helpers.Mount(dir, mnt, false, "-extpass", "echo test", "-i=100ms")
if err != nil {
t.Fatal(err)
}
@@ -829,10 +821,6 @@ func TestInitNotEmpty(t *testing.T) {
func TestSharedstorage(t *testing.T) {
dir := test_helpers.InitFS(t)
mnt := dir + ".mnt"
- err := os.Mkdir(mnt, 0700)
- if err != nil {
- t.Fatal(err)
- }
test_helpers.MountOrFatal(t, dir, mnt, "-extpass=echo test", "-sharedstorage")
defer test_helpers.UnmountPanic(mnt)
foo1 := mnt + "/foo1"
@@ -878,10 +866,6 @@ func TestMountCreat(t *testing.T) {
dir := test_helpers.InitFS(t)
mnt := dir + ".mnt"
- err := os.Mkdir(mnt, 0700)
- if err != nil {
- t.Fatal(err)
- }
for j := 0; j < repeat; j++ {
test_helpers.MountOrFatal(t, dir, mnt, "-extpass=echo test")