From ac2df3ba9ad2d26da08395d294abb7c0fa0105e5 Mon Sep 17 00:00:00 2001 From: haoyun Date: Sat, 9 Oct 2021 18:19:34 +0800 Subject: [PATCH] test: check file content after mount Signed-off-by: haoyun --- snapshots/btrfs/btrfs_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/snapshots/btrfs/btrfs_test.go b/snapshots/btrfs/btrfs_test.go index 9eef4040c..6f0c82b1c 100644 --- a/snapshots/btrfs/btrfs_test.go +++ b/snapshots/btrfs/btrfs_test.go @@ -196,7 +196,14 @@ func TestBtrfsMounts(t *testing.T) { } defer testutil.Unmount(t, target) - // TODO(stevvooe): Verify contents of "foo" + bs, err := os.ReadFile(filepath.Join(target, "foo")) + if err != nil { + t.Fatal(err) + } + if string(bs) != "content" { + t.Fatalf("wrong content in foo want: content, got: %s", bs) + } + if err := os.WriteFile(filepath.Join(target, "bar"), []byte("content"), 0777); err != nil { t.Fatal(err) }