mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
t0081: use 'ipfs pin ls <arg>' in test_pin_flagi()
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This commit is contained in:
@ -8,30 +8,23 @@ test_description="Test ipfs repo pinning"
|
||||
|
||||
. lib/test-lib.sh
|
||||
|
||||
|
||||
|
||||
test_pin_flag() {
|
||||
object=$1
|
||||
ptype=$2
|
||||
expect=$3
|
||||
|
||||
echo "test_pin_flag" $@
|
||||
echo "test_pin_flag" "$@"
|
||||
|
||||
ipfs-pin-stat "$object" | egrep "\b$ptype\b"
|
||||
actual=$?
|
||||
|
||||
if [ "$expect" = "true" ]; then
|
||||
if [ "$actual" != "0" ]; then
|
||||
echo "$object should be pinned $ptype ($actual)"
|
||||
return 1
|
||||
fi
|
||||
if ipfs pin ls --type="$ptype" "$object" >actual
|
||||
then
|
||||
test "$expect" = "true" && return
|
||||
test_fsh cat actual
|
||||
return
|
||||
else
|
||||
if [ "$actual" != "1" ]; then
|
||||
echo "$object should NOT be pinned $ptype ($actual)"
|
||||
return 1
|
||||
test "$expect" = "false" && return
|
||||
test_fsh cat actual
|
||||
return
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
test_pin() {
|
||||
|
Reference in New Issue
Block a user