@cryptotaxi247 / kubo / commits / 8c3f78055

add test check for pinning cbor objects

License: MIT Signed-off-by: Jeromy <why@ipfs.io>

Jeromy committed Jan 20, 2017 at 11:55 UTC 8c3f78055ef79083d9a31bb67b80afb6fcf27e8a
1 file changed +13 -4
test/sharness/t0053-dag.sh
+13 -4
@@ -15,10 +15,10 @@ test_expect_success "make a few test files" '
15 echo "bar" > file2 &&
16 echo "baz" > file3 &&
17 echo "qux" > file4 &&
18 - HASH1=$(ipfs add -q file1) &&
19 - HASH2=$(ipfs add -q file2) &&
20 - HASH3=$(ipfs add -q file3) &&
21 - HASH4=$(ipfs add -q file4)
18 + HASH1=$(ipfs add --pin=false -q file1) &&
19 + HASH2=$(ipfs add --pin=false -q file2) &&
20 + HASH3=$(ipfs add --pin=false -q file3) &&
21 + HASH4=$(ipfs add --pin=false -q file4)
22 '
23
24 test_expect_success "make an ipld object in json" '
@@ -47,6 +47,15 @@ test_dag_cmd() {
47 test_cmp file3 out3
48 '
49
50 + test_expect_success "can pin cbor object" '
51 + ipfs pin add $EXPHASH
52 + '
53 +
54 + test_expect_success "after gc, objects still acessible" '
55 + ipfs repo gc > /dev/null &&
56 + ipfs refs -r --timeout=2s $EXPHASH > /dev/null
57 + '
58 +
59 test_expect_success "add a normal file" '
60 HASH=$(echo "foobar" | ipfs add -q)
61 '