| 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Copyright (c) 2017 John Reed |
| 4 | # MIT Licensed; see the LICENSE file in this repository. |
| 5 | # |
| 6 | |
| 7 | test_description="Test 'ipfs repo stat' where IPFS_PATH is a symbolic link" |
| 8 | |
| 9 | . lib/test-lib.sh |
| 10 | |
| 11 | test_expect_success "create symbolic link for IPFS_PATH" ' |
| 12 | mkdir sym_link_target && |
| 13 | ln -s sym_link_target .ipfs |
| 14 | ' |
| 15 | |
| 16 | test_init_ipfs |
| 17 | |
| 18 | # ensure that the RepoSize is reasonable when checked via a symlink. |
| 19 | test_expect_success "'ipfs repo stat' RepoSize is correct with sym link" ' |
| 20 | reposize_symlink=$(ipfs repo stat | grep RepoSize | awk '\''{ print $2 }'\'') && |
| 21 | symlink_size=$(file_size .ipfs) && |
| 22 | test "${reposize_symlink}" -gt "${symlink_size}" |
| 23 | ' |
| 24 | |
| 25 | test_done |