Add SetAllowedOrigins race test case
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
rht committed
Dec 17, 2015 at 00:07 UTC
f0801589b46bbd7c96ddba0168376f3443222f16
1 file changed
+13
test/sharness/t0060-daemon.sh
+13
@@ -8,6 +8,9 @@ test_description="Test daemon command"
8
9
. lib/test-lib.sh
10
11
+gwyport=8080
12
+apiport=5001
13
+
14
# TODO: randomize ports here once we add --config to ipfs daemon
15
16
# this needs to be in a different test than "ipfs daemon --init" below
@@ -44,6 +47,16 @@ test_expect_success "ipfs peer id looks good" '
47
test_check_peerid "$PEERID"
48
'
49
50
+# this is for checking SetAllowedOrigins race condition for the api and gateway
51
+# See https://github.com/ipfs/go-ipfs/pull/1966
52
+test_expect_success "ipfs API works with the correct allowed origin port" '
53
+ curl -s -X GET -H "Origin:http://localhost:$apiport" -I "http://localhost:$apiport/api/v0/version"
54
+'
55
+
56
+test_expect_success "ipfs gateway works with the correct allowed origin port" '
57
+ curl -s -X GET -H "Origin:http://localhost:$gwyport" -I "http://localhost:$gwyport/api/v0/version"
58
+'
59
+
60
# This is like t0020-init.sh "ipfs init output looks good"
61
#
62
# Unfortunately the line: