Skip to content

Commit ac2df3b

Browse files
committed
test: check file content after mount
Signed-off-by: haoyun <[email protected]>
1 parent e648fa2 commit ac2df3b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

snapshots/btrfs/btrfs_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,14 @@ func TestBtrfsMounts(t *testing.T) {
196196
}
197197
defer testutil.Unmount(t, target)
198198

199-
// TODO(stevvooe): Verify contents of "foo"
199+
bs, err := os.ReadFile(filepath.Join(target, "foo"))
200+
if err != nil {
201+
t.Fatal(err)
202+
}
203+
if string(bs) != "content" {
204+
t.Fatalf("wrong content in foo want: content, got: %s", bs)
205+
}
206+
200207
if err := os.WriteFile(filepath.Join(target, "bar"), []byte("content"), 0777); err != nil {
201208
t.Fatal(err)
202209
}

0 commit comments

Comments
 (0)