From c22cfbbf755a5138583cd208abb43a1481ae7e06 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 15 Aug 2018 16:33:27 -0700 Subject: [PATCH] add test case for /ipns/QmId... License: MIT Signed-off-by: Steven Allen --- fuse/ipns/ipns_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 40a74639b..4b47ca17d 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -168,7 +168,7 @@ func TestIpnsBasicIO(t *testing.T) { if testing.Short() { t.SkipNow() } - _, mnt := setupIpnsTest(t, nil) + nd, mnt := setupIpnsTest(t, nil) defer closeMount(mnt) fname := mnt.Dir + "/local/testfile" @@ -182,6 +182,16 @@ func TestIpnsBasicIO(t *testing.T) { if !bytes.Equal(rbuf, data) { t.Fatal("Incorrect Read!") } + + fname2 := mnt.Dir + "/" + nd.Identity.Pretty() + "/testfile" + rbuf, err = ioutil.ReadFile(fname2) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(rbuf, data) { + t.Fatal("Incorrect Read!") + } } // Test to make sure file changes persist over mounts of ipns