From bc2e325e5cbcf25b708c84e87fa91e4fe00b5c56 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Wed, 12 Sep 2018 14:12:38 +0800 Subject: [PATCH 1/4] add rabin min error test License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- test/sharness/t0040-add-and-cat.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index bd60140f5..2e83f767a 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -156,6 +156,15 @@ test_add_cat_file() { test_cmp expected actual ' + test_expect_success "ipfs add --chunker rabin-36-512-1024 succeeds" ' + ipfs add --chunker rabin-36-512-1024 mountdir/hello.txt >actual + ' + + test_expect_failure "ipfs add --chunker rabin-12-512-1024 failed" ' + ipfs add --chunker rabin-12-512-1024 mountdir/hello.txt >actual + ' + + test_expect_success "ipfs add on hidden file succeeds" ' echo "Hello Worlds!" >mountdir/.hello.txt && ipfs add mountdir/.hello.txt >actual From 0c56ac104bca7df8e0d2b592fb809cfdff9dcaa0 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Thu, 13 Sep 2018 10:44:16 +0800 Subject: [PATCH 2/4] update rabin min error test License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- test/sharness/t0040-add-and-cat.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 2e83f767a..1c4dab081 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -157,11 +157,11 @@ test_add_cat_file() { ' test_expect_success "ipfs add --chunker rabin-36-512-1024 succeeds" ' - ipfs add --chunker rabin-36-512-1024 mountdir/hello.txt >actual + ipfs add -Q --chunker rabin-36-512-1024 mountdir/hello.txt ' - test_expect_failure "ipfs add --chunker rabin-12-512-1024 failed" ' - ipfs add --chunker rabin-12-512-1024 mountdir/hello.txt >actual + test_expect_code 127 "ipfs add --chunker rabin-12-512-1024 failed" ' + ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt ' From 18781fb2e789042f71f80cf70adfea0f2b19585b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 13 Sep 2018 21:39:54 +0000 Subject: [PATCH 3/4] fix sharness test_expect_code location in add-and-cat License: MIT Signed-off-by: Steven Allen --- test/sharness/t0040-add-and-cat.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 1c4dab081..88d6e1989 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -160,8 +160,8 @@ test_add_cat_file() { ipfs add -Q --chunker rabin-36-512-1024 mountdir/hello.txt ' - test_expect_code 127 "ipfs add --chunker rabin-12-512-1024 failed" ' - ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt + test_expect_success "ipfs add --chunker rabin-12-512-1024 failed" ' + test_expect_code 127 ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt ' From 984ae1f406f54ada708ea6f614610aa0a83264c2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 13 Sep 2018 17:53:24 -0700 Subject: [PATCH 4/4] fix expected error code for add-and-cat test License: MIT Signed-off-by: Steven Allen --- test/sharness/t0040-add-and-cat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 88d6e1989..f51152861 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -161,7 +161,7 @@ test_add_cat_file() { ' test_expect_success "ipfs add --chunker rabin-12-512-1024 failed" ' - test_expect_code 127 ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt + test_expect_code 1 ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt '