test: test init output
Juan Batiz-Benet committed
Nov 17, 2014 at 21:56 UTC
493e5d3b3ea63ecb908c4f04b50a4d77ea219fd1
1 file changed
+17
-2
test/t0020-init.sh
+17
-2
@@ -10,7 +10,7 @@ test_description="Test init command"
10
11
test_expect_success "ipfs init succeeds" '
12
export IPFS_DIR="$(pwd)/.go-ipfs" &&
13
- ipfs init
13
+ ipfs init >actual_init
14
'
15
16
test_expect_success ".go-ipfs/ has been created" '
@@ -25,5 +25,20 @@ test_expect_success "ipfs config succeeds" '
25
test_cmp expected actual
26
'
27
28
-test_done
28
+test_expect_success "ipfs peer id looks good" '
29
+ PEERID=$(ipfs config Identity.PeerID) &&
30
+ echo $PEERID | tr -dC "[:alnum:]" | wc -c | tr -d " " >actual &&
31
+ echo "46" >expected &&
32
+ test_cmp expected actual
33
+'
34
35
+test_expect_success "ipfs init output looks good" '
36
+ STARTHASH="QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB" &&
37
+ echo "initializing ipfs node at $IPFS_DIR" >expected &&
38
+ echo "generating key pair...done" >>expected &&
39
+ echo "peer identity: $PEERID" >>expected &&
40
+ echo "\nto get started, enter: ipfs cat $STARTHASH" >>expected &&
41
+ test_cmp expected actual_init
42
+'
43
+
44
+test_done