From 53dee3c64d099fe5eeac83577e4db9a6b703f0ad Mon Sep 17 00:00:00 2001 From: Jeromy Date: Thu, 25 Jun 2015 09:33:47 -0700 Subject: [PATCH] add test for only-hash to ensure no blocks are added to datastore License: MIT Signed-off-by: Jeromy --- test/sharness/t0041-add-cat-offline.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/sharness/t0041-add-cat-offline.sh b/test/sharness/t0041-add-cat-offline.sh index a8c0e36a6..68f632267 100755 --- a/test/sharness/t0041-add-cat-offline.sh +++ b/test/sharness/t0041-add-cat-offline.sh @@ -45,4 +45,12 @@ test_expect_success "output looks good" ' test_cmp afile out_2 ' +test_expect_success "ipfs add --only-hash succeeds" ' + echo "unknown content for only-hash" | ipfs add --only-hash -q > oh_hash +' + +test_expect_success "ipfs cat file fails" ' + test_must_fail ipfs cat $(cat oh_hash) +' + test_done