提交 893ab6dc 作者: Christian Couder

t0081: use 'ipfs pin ls <arg>' in test_pin_flagi()

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 f5f923a7
...@@ -8,30 +8,23 @@ test_description="Test ipfs repo pinning" ...@@ -8,30 +8,23 @@ test_description="Test ipfs repo pinning"
. lib/test-lib.sh . lib/test-lib.sh
test_pin_flag() { test_pin_flag() {
object=$1 object=$1
ptype=$2 ptype=$2
expect=$3 expect=$3
echo "test_pin_flag" $@ echo "test_pin_flag" "$@"
ipfs-pin-stat "$object" | egrep "\b$ptype\b" if ipfs pin ls --type="$ptype" "$object" >actual
actual=$? then
test "$expect" = "true" && return
if [ "$expect" = "true" ]; then test_fsh cat actual
if [ "$actual" != "0" ]; then return
echo "$object should be pinned $ptype ($actual)"
return 1
fi
else else
if [ "$actual" != "1" ]; then test "$expect" = "false" && return
echo "$object should NOT be pinned $ptype ($actual)" test_fsh cat actual
return 1 return
fi
fi fi
return 0
} }
test_pin() { test_pin() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论