Skip to content

Commit f080158

Browse files
committedJan 21, 2016
Add SetAllowedOrigins race test case
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
1 parent b970681 commit f080158

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎test/sharness/t0060-daemon.sh

+13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ test_description="Test daemon command"
88

99
. lib/test-lib.sh
1010

11+
gwyport=8080
12+
apiport=5001
13+
1114
# TODO: randomize ports here once we add --config to ipfs daemon
1215

1316
# 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" '
4447
test_check_peerid "$PEERID"
4548
'
4649

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+
4760
# This is like t0020-init.sh "ipfs init output looks good"
4861
#
4962
# Unfortunately the line:

0 commit comments

Comments
 (0)
Please sign in to comment.