mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-26 23:53:19 +08:00
add test case for /ipns/QmId...
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
@ -168,7 +168,7 @@ func TestIpnsBasicIO(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.SkipNow()
|
t.SkipNow()
|
||||||
}
|
}
|
||||||
_, mnt := setupIpnsTest(t, nil)
|
nd, mnt := setupIpnsTest(t, nil)
|
||||||
defer closeMount(mnt)
|
defer closeMount(mnt)
|
||||||
|
|
||||||
fname := mnt.Dir + "/local/testfile"
|
fname := mnt.Dir + "/local/testfile"
|
||||||
@ -182,6 +182,16 @@ func TestIpnsBasicIO(t *testing.T) {
|
|||||||
if !bytes.Equal(rbuf, data) {
|
if !bytes.Equal(rbuf, data) {
|
||||||
t.Fatal("Incorrect Read!")
|
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
|
// Test to make sure file changes persist over mounts of ipns
|
||||||
|
Reference in New Issue
Block a user