Skip to content

Commit e9cc320

Browse files
committed
make sure the repo size is greater than the size of the symlink
Before, we'd check to make sure the repo, when checked through a symlink, is at least as large as the repo *before* we checked it through the symlink. However, this assumes that the repo can't shrink. Really, this test exists to ensure we measure the repo size itself instead of the size of the symlink; this commit changes the test to reflect this. This test fails when 54d7e03 is reverted. fixes #4408 License: MIT Signed-off-by: Steven Allen <[email protected]>
1 parent a81025f commit e9cc320

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/sharness/t0088-repo-stat-symlink.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ test_expect_success "create symbolic link for IPFS_PATH" '
1515

1616
test_init_ipfs
1717

18-
# compare RepoSize when getting it directly vs via symbolic link
18+
# ensure that the RepoSize is reasonable when checked via a symlink.
1919
test_expect_success "'ipfs repo stat' RepoSize is correct with sym link" '
20-
export IPFS_PATH="sym_link_target" &&
21-
reposize_direct=$(ipfs repo stat | grep RepoSize | awk '\''{ print $2 }'\'') &&
22-
export IPFS_PATH=".ipfs" &&
2320
reposize_symlink=$(ipfs repo stat | grep RepoSize | awk '\''{ print $2 }'\'') &&
24-
echo "reposize_symlink: $reposize_symlink; reposize_direct: $reposize_direct" &&
25-
test $reposize_symlink -ge $reposize_direct
21+
symlink_size=$(stat --format="%s" .ipfs) &&
22+
test "${reposize_symlink}" -gt "${symlink_size}"
2623
'
2724

2825
test_done

0 commit comments

Comments
 (0)