2017-04-18 22:22:05 +00:00
|
|
|
test_description="Test cluster-ctl's pinning and unpinning functionality"
|
|
|
|
|
|
|
|
|
2017-04-19 00:54:08 +00:00
|
|
|
. lib/test-lib.sh
|
2017-04-18 22:22:05 +00:00
|
|
|
|
2017-04-20 17:28:09 +00:00
|
|
|
|
2017-04-19 00:54:08 +00:00
|
|
|
test_expect_success "pin data to cluster with ctl" '
|
2017-04-20 17:28:09 +00:00
|
|
|
IPFS_PATH="../.test_ipfs" eval ''ipfs add ../lib/sharness/sharness.sh >add_output.txt'' &&
|
2017-04-19 00:54:08 +00:00
|
|
|
grep "added" add_output.txt &&
|
|
|
|
awk "{print$2}" add_output.txt > CID.txt &&
|
|
|
|
ipfs-cluster-ctl pin add $(< CID.txt) >pin_output.txt &&
|
|
|
|
grep " PINNING" pin_output.txt >/dev/null &&
|
|
|
|
rm add_output.txt pin_output.txt
|
|
|
|
'
|
2017-04-18 22:22:05 +00:00
|
|
|
|
2017-04-19 00:54:08 +00:00
|
|
|
test_expect_success "unpin data from cluster with ctl" '
|
2017-04-20 17:28:09 +00:00
|
|
|
IPFS_PATH="../.test_ipfs" eval ''ipfs-cluster-ctl pin rm $(< CID.txt) >unpin_output.txt'' &&
|
2017-04-19 00:54:08 +00:00
|
|
|
grep "UNPINNING" unpin_output.txt >/dev/null &&
|
|
|
|
rm unpin_output.txt CID.txt
|
|
|
|
'
|
2017-04-18 22:22:05 +00:00
|
|
|
|
|
|
|
test_done
|