From 8c3f78055ef79083d9a31bb67b80afb6fcf27e8a Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 20 Jan 2017 11:55:36 -0800 Subject: [PATCH] add test check for pinning cbor objects License: MIT Signed-off-by: Jeromy --- test/sharness/t0053-dag.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/sharness/t0053-dag.sh b/test/sharness/t0053-dag.sh index e0f4deb13..fca19d5b5 100755 --- a/test/sharness/t0053-dag.sh +++ b/test/sharness/t0053-dag.sh @@ -15,10 +15,10 @@ test_expect_success "make a few test files" ' echo "bar" > file2 && echo "baz" > file3 && echo "qux" > file4 && - HASH1=$(ipfs add -q file1) && - HASH2=$(ipfs add -q file2) && - HASH3=$(ipfs add -q file3) && - HASH4=$(ipfs add -q file4) + HASH1=$(ipfs add --pin=false -q file1) && + HASH2=$(ipfs add --pin=false -q file2) && + HASH3=$(ipfs add --pin=false -q file3) && + HASH4=$(ipfs add --pin=false -q file4) ' test_expect_success "make an ipld object in json" ' @@ -47,6 +47,15 @@ test_dag_cmd() { test_cmp file3 out3 ' + test_expect_success "can pin cbor object" ' + ipfs pin add $EXPHASH + ' + + test_expect_success "after gc, objects still acessible" ' + ipfs repo gc > /dev/null && + ipfs refs -r --timeout=2s $EXPHASH > /dev/null + ' + test_expect_success "add a normal file" ' HASH=$(echo "foobar" | ipfs add -q) '