-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3302 from ipfs/test/pin-fail-stress
add test to be run to detect future regressions in pinsets
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2016 Jeromy Johnson | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="Test very large number of pins" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
test_launch_ipfs_daemon | ||
|
||
test_expect_success "pre-test setup" ' | ||
printf "" > pins && | ||
ipfs pin ls --type=recursive -q > rec_pins_before | ||
' | ||
|
||
|
||
for i in `seq 9000` | ||
do | ||
test_expect_success "ipfs add (and pin) a file" ' | ||
echo $i | ipfs add -q >> pins | ||
' | ||
done | ||
|
||
test_expect_success "get pinset afterwards" ' | ||
ipfs pin ls --type=recursive -q | sort > rec_pins_after && | ||
cat pins rec_pins_before | sort | uniq > exp_pins_after && | ||
test_cmp rec_pins_after exp_pins_after | ||
' | ||
|
||
test_kill_ipfs_daemon | ||
|
||
test_done | ||
|