Commit f300e97c authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

added sharness/t0061-daemon-opts

Test odd daemon options, like:
- unrestricted-api
- disable-transport-encryption (known breakage atm)

License: MIT
Signed-off-by: default avatarJuan Batiz-Benet <juan@benet.ai>
parent e37fefdf
......@@ -193,8 +193,10 @@ test_config_ipfs_gateway_writable() {
test_launch_ipfs_daemon() {
args=$1
test_expect_success "'ipfs daemon' succeeds" '
ipfs daemon >actual_daemon 2>daemon_err &
ipfs daemon $args >actual_daemon 2>daemon_err &
'
# we say the daemon is ready when the API server is ready.
......
#!/bin/sh
#
# Copyright (c) 2014 Juan Batiz-Benet
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="Test daemon command"
. lib/test-lib.sh
test_init_ipfs
test_launch_ipfs_daemon '--unrestricted-api --disable-transport-encryption'
gwyport=$PORT_GWAY
apiport=$PORT_API
test_expect_success 'api gateway should be unrestricted' '
echo "hello mars :$gwyport :$apiport" >expected &&
HASH=$(ipfs add -q expected) &&
curl -sfo actual1 "http://127.0.0.1:$gwyport/ipfs/$HASH" &&
curl -sfo actual2 "http://127.0.0.1:$apiport/ipfs/$HASH" &&
test_cmp expected actual1 &&
test_cmp expected actual2
'
# Odd. this fails here, but the inverse works on t0060-daemon.
test_expect_failure 'transport should be unencrypted' '
nc 127.0.0.1 "$PORT_SWARM" >swarmnc &
go-sleep 0.1s &&
! grep -q "AES-256,AES-128" swarmnc &&
grep -q "/ipfs/identify" swarmnc ||
test_fsh cat swarmnc
'
test_kill_ipfs_daemon
test_done
......@@ -33,6 +33,10 @@ test_expect_success "GET IPFS path output looks good" '
rm actual
'
test_expect_success "GET IPFS path on API forbidden" '
test_curl_resp_http_code "http://127.0.0.1:$apiport/ipfs/$HASH" "HTTP/1.1 403 Forbidden"
'
test_expect_success "GET IPFS directory path succeeds" '
mkdir dir &&
echo "12345" >dir/test &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment