| 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Copyright (c) 2016 Jeromy Johnson |
| 4 | # MIT Licensed; see the LICENSE file in this repository. |
| 5 | # |
| 6 | |
| 7 | test_description="Test very large number of pins" |
| 8 | |
| 9 | . lib/test-lib.sh |
| 10 | |
| 11 | test_init_ipfs |
| 12 | |
| 13 | test_launch_ipfs_daemon |
| 14 | |
| 15 | test_expect_success "pre-test setup" ' |
| 16 | printf "" > pins && |
| 17 | ipfs pin ls --type=recursive -q > rec_pins_before |
| 18 | ' |
| 19 | |
| 20 | |
| 21 | for i in `seq 9000` |
| 22 | do |
| 23 | test_expect_success "ipfs add (and pin) a file" ' |
| 24 | echo $i | ipfs add -q >> pins |
| 25 | ' |
| 26 | done |
| 27 | |
| 28 | test_expect_success "get pinset afterwards" ' |
| 29 | ipfs pin ls --type=recursive -q | sort > rec_pins_after && |
| 30 | cat pins rec_pins_before | sort | uniq > exp_pins_after && |
| 31 | test_cmp rec_pins_after exp_pins_after |
| 32 | ' |
| 33 | |
| 34 | test_kill_ipfs_daemon |
| 35 | |
| 36 | test_done |
| 37 |