This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
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 with default config"
8
+
9
+ . lib/test-lib.sh
10
+
11
+ cfg_key=" Addresses.API"
12
+ cfg_val=" /ip4/0.0.0.0/tcp/5001"
13
+
14
+ # test that init succeeds
15
+ test_expect_success " ipfs init succeeds" '
16
+ export IPFS_PATH="$(pwd)/.ipfs" &&
17
+ echo "IPFS_PATH: \"$IPFS_PATH\"" &&
18
+ BITS="2048" &&
19
+ ipfs init --bits="$BITS" >actual_init ||
20
+ test_fsh cat actual_init
21
+ '
22
+
23
+ test_expect_success " .ipfs/config has been created" '
24
+ test -f "$IPFS_PATH"/config ||
25
+ test_fsh ls -al .ipfs
26
+ '
27
+
28
+ test_expect_success " ipfs config succeeds" '
29
+ ipfs config $cfg_flags "$cfg_key" "$cfg_val"
30
+ '
31
+
32
+ test_expect_success " ipfs read config succeeds" '
33
+ IPFS_DEFAULT_CONFIG=$(cat "$IPFS_PATH"/config)
34
+ '
35
+
36
+ test_expect_success " clean up ipfs dir" '
37
+ rm -rf "$IPFS_PATH"
38
+ '
39
+
40
+ test_expect_success " ipfs init default config succeeds" '
41
+ echo $IPFS_DEFAULT_CONFIG | ipfs init - >actual_init ||
42
+ test_fsh cat actual_init
43
+ '
44
+
45
+ test_done
You can’t perform that action at this time.
0 commit comments