Skip to content

Commit

Permalink
test: add tar file tests with accept header
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Oct 3, 2022
1 parent e44423c commit 54fbf94
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/sharness/t0110-gateway.sh
Expand Up @@ -301,16 +301,26 @@ test_expect_success "Verify gateway file" '
test_cmp gateway_daemon_actual gateway_file_actual
'

test_expect_success "GET TAR file from gateway and extract" '
test_expect_success "GET TAR with format=tar and extract" '
curl "http://127.0.0.1:$port/ipfs/$FOO2_HASH?format=tar" | tar -x
'

test_expect_success "GET TAR file has expected Content-Type" '
test_expect_success "GET TAR with 'Accept: application/x-tar' and extract" '
curl -H "Accept: application/x-tar" "http://127.0.0.1:$port/ipfs/$FOO2_HASH" | tar -x
'

test_expect_success "GET TAR with format=tar has expected Content-Type" '
curl -svX GET "http://127.0.0.1:$port/ipfs/$FOO2_HASH?format=tar" > curl_output_filename 2>&1 &&
cat curl_output_filename &&
grep "< Content-Type: application/x-tar" curl_output_filename
'

test_expect_success "GET TAR with 'Accept: application/x-tar' has expected Content-Type" '
curl -svX GET -H "Accept: application/x-tar" "http://127.0.0.1:$port/ipfs/$FOO2_HASH" > curl_output_filename 2>&1 &&
cat curl_output_filename &&
grep "< Content-Type: application/x-tar" curl_output_filename
'

test_kill_ipfs_daemon

GWPORT=32563
Expand Down

0 comments on commit 54fbf94

Please sign in to comment.