sharness/lib: fixing gateway addr check
seems that the previous way isnt liked by all platforms
Juan Batiz-Benet committed
Feb 1, 2015 at 20:35 UTC
7ce3c7951917ff5737d0a06f5076e3bdc150ada7
1 file changed
+8
-6
test/sharness/lib/test-lib.sh
+8
-6
@@ -142,16 +142,18 @@ test_init_ipfs() {
142
}
143
144
test_config_ipfs_gateway_readonly() {
145
- if test "$1" == ""; then
146
- echo "must call with an address, for example:"
147
- echo 'test_config_ipfs_gateway_readonly "/ip4/0.0.0.0/tcp/5002"'
148
- return 1 # todo: find a better way to exit here.
149
- fi
150
-
145
GWAY_ADDR=$1
146
test_expect_success "prepare config -- gateway address" '
147
+ test "$GWAY_ADDR" != "" &&
148
test_config_set "Addresses.Gateway" "$GWAY_ADDR"
149
'
150
+
151
+ # tell the user what's going on if they messed up the call.
152
+ if test "$#" = 0; then
153
+ echo "# Error: must call with an address, for example:"
154
+ echo '# test_config_ipfs_gateway_readonly "/ip4/0.0.0.0/tcp/5002"'
155
+ echo '#'
156
+ fi
157
}
158
159
test_config_ipfs_gateway_writable() {