From 8a338016077bcda7ca330944b974f8924f762b1f Mon Sep 17 00:00:00 2001 From: Jeromy <why@ipfs.io> Date: Wed, 12 Oct 2016 09:29:09 -0700 Subject: [PATCH] add test to be run to detect future regressions in pinsets License: MIT Signed-off-by: Jeromy <why@ipfs.io> --- test/sharness/x0601-pin-fail-test.sh | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 test/sharness/x0601-pin-fail-test.sh diff --git a/test/sharness/x0601-pin-fail-test.sh b/test/sharness/x0601-pin-fail-test.sh new file mode 100755 index 000000000..decdd34b5 --- /dev/null +++ b/test/sharness/x0601-pin-fail-test.sh @@ -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 + -- GitLab