File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,9 @@ directory_size() {
406
406
fsize=$( file_size " $fname " )
407
407
res=$?
408
408
if ! test $res -eq 0; then
409
+ if ! test -e " $fname " ; then
410
+ continue ;
411
+ fi
409
412
echo " failed to get filesize" >&2
410
413
return $res
411
414
fi
Original file line number Diff line number Diff line change @@ -48,19 +48,26 @@ test_expect_success "'ipfs pin rm' output looks good" '
48
48
test_cmp expected1 actual1
49
49
'
50
50
51
- test_expect_success " ipfs repo gc fully reverse ipfs add" '
51
+ test_expect_success " ipfs repo gc fully reverse ipfs add (part 1) " '
52
52
ipfs repo gc &&
53
53
random 100000 41 >gcfile &&
54
54
expected="$(directory_size "$IPFS_PATH/blocks")" &&
55
55
find "$IPFS_PATH/blocks" -type f &&
56
56
hash=$(ipfs add -q gcfile) &&
57
57
ipfs pin rm -r $hash &&
58
- ipfs repo gc &&
58
+ ipfs repo gc
59
+ '
60
+
61
+ test_kill_ipfs_daemon
62
+
63
+ test_expect_success " ipfs repo gc fully reverse ipfs add (part 2)" '
59
64
actual=$(directory_size "$IPFS_PATH/blocks") &&
60
65
{ test "$actual" -eq "$expected" || test_fsh echo "$actual != $expected"; } &&
61
66
{ test "$actual" -gt "0" || test_fsh echo "not($actual > 0)"; }
62
67
'
63
68
69
+ test_launch_ipfs_daemon --offline
70
+
64
71
test_expect_success " file no longer pinned" '
65
72
ipfs pin ls --type=recursive --quiet >actual2 &&
66
73
test_expect_code 1 grep $HASH actual2
You can’t perform that action at this time.
0 commit comments