test: check file content after mount

Signed-off-by: haoyun <yun.hao@daocloud.io>
This commit is contained in:
haoyun 2021-10-09 18:19:34 +08:00
parent e648fa2e81
commit ac2df3ba9a

View File

@ -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)
}