@cryptotaxi247 / kubo / commits / e1d8200ff

test-lib: use all the test_launch_ipfs_daemon() arguments

It is simpler and less error prone to just pass to `ipfs daemon` all the arguments that are passed to test_launch_ipfs_daemon(). Maybe the arguments should be shell quoted too, but that's another issue. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Aug 28, 2015 at 05:17 UTC e1d8200ffb83a863142419ce796de948d7cd34c0
3 files changed +3 -16
test/sharness/lib/test-lib.sh
+1 -1
@@ -193,7 +193,7 @@ test_config_ipfs_gateway_writable() {
193
194 test_launch_ipfs_daemon() {
195
196 - args=$1
196 + args="$@"
197
198 test_expect_success "'ipfs daemon' succeeds" '
199 ipfs daemon $args >actual_daemon 2>daemon_err &
test/sharness/t0061-daemon-opts.sh
+1 -1
@@ -11,7 +11,7 @@ test_description="Test daemon command"
11
12 test_init_ipfs
13
14 -test_launch_ipfs_daemon '--unrestricted-api --disable-transport-encryption'
14 +test_launch_ipfs_daemon --unrestricted-api --disable-transport-encryption
15
16 gwyport=$PORT_GWAY
17 apiport=$PORT_API
test/sharness/t0062-daemon-api.sh
+1 -14
@@ -39,20 +39,7 @@ test_expect_success "client should err if client api != api file while daemon is
39 PORT_API=$differentport
40 ADDR_API=$differentapi
41
42 -# test_launch_ipfs_daemon '--api "$ADDR_API"'
43 -
44 -#pasted from test_launch_ipfs_daemon because the above line doesn't work
45 -test_expect_success "'ipfs daemon' succeeds" '
46 - ipfs daemon --api $ADDR_API >actual_daemon 2>daemon_err &
47 -'
48 -
49 -# we say the daemon is ready when the API server is ready.
50 -test_expect_success "'ipfs daemon' is ready" '
51 - IPFS_PID=$! &&
52 - pollEndpoint -ep=/version -host=$ADDR_API -v -tout=1s -tries=60 2>poll_apierr > poll_apiout ||
53 - test_fsh cat actual_daemon || test_fsh cat daemon_err || test_fsh cat poll_apierr || test_fsh cat poll_apiout
54 -'
55 -#end of "test_launch_ipfs_daemon
42 +test_launch_ipfs_daemon --api "$ADDR_API"
43
44 test_expect_success "'ipfs daemon' api option works" '
45 printf "$differentapi" > expected &&