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 18:55:54 +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 &&
|
2017-04-20 18:55:54 +00:00
|
|
|
awk '"'"'{print $2}'"'"' add_output.txt > CID.txt &&
|
|
|
|
ipfs-cluster-ctl pin add $(< CID.txt) >pin_output.txt
|
|
|
|
grep " PINNED" pin_output.txt >/dev/null &&
|
2017-04-19 00:54:08 +00:00
|
|
|
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 18:55:54 +00:00
|
|
|
IPFS_PATH="../.test_ipfs" eval '"'"'ipfs-cluster-ctl pin rm $(< CID.txt) >unpin_output.txt'"'"' &&
|
|
|
|
grep "UNPINNED" unpin_output.txt >/dev/null &&
|
2017-04-19 00:54:08 +00:00
|
|
|
rm unpin_output.txt CID.txt
|
|
|
|
'
|
2017-04-18 22:22:05 +00:00
|
|
|
|
2017-04-20 18:55:54 +00:00
|
|
|
|
2017-04-18 22:22:05 +00:00
|
|
|
test_done
|