add test to be run to detect future regressions in pinsets
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
Jeromy committed
Oct 12, 2016 at 09:29 UTC
8a338016077bcda7ca330944b974f8924f762b1f
1 file changed
+37
test/sharness/x0601-pin-fail-test.sh
new
+37
@@ -0,0 +1,37 @@
1
+#!/bin/sh
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
+