提交 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"
. 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
fi
test "$expect" = "false" && return
test_fsh cat actual
return
fi
return 0
}
test_pin() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论