提交 eb450821 作者: rht

Add reversible gc test

License: MIT
Signed-off-by: 's avatarrht <rhtbot@gmail.com>
上级 f417cb5c
......@@ -314,3 +314,19 @@ test_str_contains() {
shift
echo "$@" | grep "$find" >/dev/null
}
disk_usage() {
# normalize du across systems
case $(uname -s) in
Linux)
DU="du -sb"
;;
FreeBSD)
DU="du -s -A -B 1"
;;
Darwin | DragonFly)
DU="du"
;;
esac
$DU "$1" | awk "{print \$1}"
}
......@@ -44,6 +44,16 @@ test_expect_success "'ipfs pin rm' output looks good" '
test_cmp expected1 actual1
'
test_expect_failure "ipfs repo gc fully reverse ipfs add" '
random 100000 41 >gcfile &&
disk_usage "$IPFS_PATH/blocks" >expected &&
hash=`ipfs add -q gcfile` &&
ipfs pin rm -r $hash &&
ipfs repo gc &&
disk_usage "$IPFS_PATH/blocks" >actual &&
test_cmp expected actual
'
test_expect_success "file no longer pinned" '
# we expect the welcome files and gw assets to show up here
echo "$HASH_WELCOME_DOCS" >expected2 &&
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论