From 872daf8357ced1dbb4f019619dec25deef06a6b9 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Tue, 25 Aug 2015 20:15:48 +0200 Subject: [PATCH] t0020: add test for --empty-repo License: MIT Signed-off-by: Christian Couder --- test/sharness/t0020-init.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 53141286f..2a855ec88 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -75,6 +75,37 @@ test_expect_success "ipfs init output looks good" ' test_cmp expected actual_init ' +test_expect_success "Welcome readme exists" ' + ipfs cat /ipfs/$HASH_WELCOME_DOCS/readme +' + +test_expect_success "clean up ipfs dir" ' + rm -rf "$IPFS_PATH" +' + +test_expect_success "'ipfs init --empty-repo' succeeds" ' + BITS="1024" && + ipfs init --bits="$BITS" --empty-repo >actual_init +' + +test_expect_success "ipfs peer id looks good" ' + PEERID=$(ipfs config Identity.PeerID) && + echo $PEERID | tr -dC "[:alnum:]" | wc -c | tr -d " " >actual_peerid && + echo "46" >expected_peerid && + test_cmp expected_peerid actual_peerid +' + +test_expect_success "'ipfs init --empty-repo' output looks good" ' + echo "initializing ipfs node at $IPFS_PATH" >expected && + echo "generating $BITS-bit RSA keypair...done" >>expected && + echo "peer identity: $PEERID" >>expected && + test_cmp expected actual_init +' + +test_expect_success "Welcome readme doesn't exists" ' + test_must_fail ipfs cat /ipfs/$HASH_WELCOME_DOCS/readme +' + test_expect_success "clean up ipfs dir" ' rm -rf "$IPFS_PATH" '