@@ -75,8 +75,10 @@ test_expect_success "ipfs daemon output looks good" '
75
75
test_expect_success " .ipfs/ has been created" '
76
76
test -d ".ipfs" &&
77
77
test -f ".ipfs/config" &&
78
- test -d ".ipfs/datastore" ||
79
- test_fsh ls .ipfs
78
+ test -f ".ipfs/api" &&
79
+ test -d ".ipfs/datastore" &&
80
+ test -d ".ipfs/blocks" ||
81
+ test_fsh ls -al .ipfs
80
82
'
81
83
82
84
# begin same as in t0010
@@ -102,13 +104,20 @@ test_expect_success "ipfs help output looks good" '
102
104
103
105
# check transport is encrypted
104
106
105
- test_expect_success ' transport should be encrypted' '
107
+ test_expect_success " transport should be encrypted" '
106
108
nc -w 5 localhost 4001 >swarmnc &&
107
109
grep -q "AES-256,AES-128" swarmnc &&
108
110
test_must_fail grep -q "/ipfs/identify" swarmnc ||
109
111
test_fsh cat swarmnc
110
112
'
111
113
114
+ test_expect_success " client should err if api is off but daemon is on" '
115
+ echo "Error: api not running" >expected &&
116
+ echo "off" > $IPFS_PATH/api &&
117
+ test_must_fail ipfs --api "/ip4/127.0.0.1/tcp/5001" id 2>actual &&
118
+ test_cmp expected actual
119
+ '
120
+
112
121
# end same as in t0010
113
122
114
123
test_expect_success " daemon is still running" '
@@ -119,6 +128,11 @@ test_expect_success "'ipfs daemon' can be killed" '
119
128
test_kill_repeat_10_sec $IPFS_PID
120
129
'
121
130
131
+ test_expect_success " client should work if api is on but daemon is off" '
132
+ echo "/ip4/127.0.0.1/tcp/5003" > $IPFS_PATH/api &&
133
+ ipfs --api "/ip4/127.0.0.1/tcp/5003" id
134
+ '
135
+
122
136
test_expect_success " 'ipfs daemon' should be able to run with a pipe attached to stdin (issue #861)" '
123
137
yes | ipfs daemon --init >stdin_daemon_out 2>stdin_daemon_err &
124
138
pollEndpoint -ep=/version -v -tout=1s -tries=10 >stdin_poll_apiout 2>stdin_poll_apierr &&
0 commit comments