Skip to content

Commit

Permalink
mount: rm createFile from tests
Browse files Browse the repository at this point in the history
It's a one liner anyway, and other tests create files directly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Mar 7, 2022
1 parent 48d0b57 commit fc00352
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions mount/sharedsubtree_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestSubtreePrivate(t *testing.T) {
t.Fatal(err)
}

if err := createFile(outside1Path); err != nil {
if err := os.WriteFile(outside1Path, []byte("hello"), 0o644); err != nil {
t.Fatal(err)
}
if err := createFile(outside2Path); err != nil {
if err := os.WriteFile(outside2Path, []byte("hello"), 0o644); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -134,7 +134,7 @@ func TestSubtreeShared(t *testing.T) {
t.Fatal(err)
}

if err := createFile(outsidePath); err != nil {
if err := os.WriteFile(outsidePath, []byte("hello"), 0o644); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -210,10 +210,10 @@ func TestSubtreeSharedSlave(t *testing.T) {
t.Fatal(err)
}

if err := createFile(outside1Path); err != nil {
if err := os.WriteFile(outside1Path, []byte("hello"), 0o644); err != nil {
t.Fatal(err)
}
if err := createFile(outside2Path); err != nil {
if err := os.WriteFile(outside2Path, []byte("hello"), 0o644); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -319,7 +319,3 @@ func TestSubtreeUnbindable(t *testing.T) {
}
}()
}

func createFile(path string) error {
return os.WriteFile(path, []byte("hello"), 0o666)
}

0 comments on commit fc00352

Please sign in to comment.