Add test script for ipfs init
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Oct 26, 2014 at 09:43 UTC
8357c7b13df39ddd63f65499d62b938b9e0a23fc
1 file changed
+29
test/t0020-init.sh
new
+29
@@ -0,0 +1,29 @@
1
+#!/bin/sh
2
+#
3
+# Copyright (c) 2014 Christian Couder
4
+# MIT Licensed; see the LICENSE file in this repository.
5
+#
6
+
7
+test_description="Test init command"
8
+
9
+. ./test-lib.sh
10
+
11
+test_expect_success "ipfs init succeeds" '
12
+ export IPFS_DIR="$(pwd)/.go-ipfs" &&
13
+ ipfs init
14
+'
15
+
16
+test_expect_success ".go-ipfs/ has been created" '
17
+ test -d ".go-ipfs" &&
18
+ test -f ".go-ipfs/config" &&
19
+ test -d ".go-ipfs/datastore"
20
+'
21
+
22
+test_expect_success "ipfs config succeeds" '
23
+ echo leveldb >expected &&
24
+ ipfs config Datastore.Type >actual &&
25
+ test_cmp expected actual
26
+'
27
+
28
+test_done
29
+