diff --git a/test/sharness/t0123-gateway-json-cbor.sh b/test/sharness/t0123-gateway-json-cbor.sh index f94d977f3c4d..ec4b28f64603 100755 --- a/test/sharness/t0123-gateway-json-cbor.sh +++ b/test/sharness/t0123-gateway-json-cbor.sh @@ -22,55 +22,55 @@ test_expect_success "Add the test directory" ' echo "$FILE_CID / $FILE_SIZE" ' -test_codec () { +test_codec_unixfs () { name=$1 format=$2 - test_expect_success "GET $name with format=dag-$format has expected Content-Type" ' + test_expect_success "GET UnixFS $name with format=dag-$format has expected Content-Type" ' curl -sD - "http://127.0.0.1:$GWAY_PORT/ipfs/$FILE_CID?format=dag-$format" > curl_output 2>&1 && test_should_contain "Content-Type: application/vnd.ipld.dag-$format" curl_output && test_should_not_contain "Content-Type: application/$format" curl_output ' - test_expect_success "GET $name with 'Accept: application/vnd.ipld.dag-$format' has expected Content-Type" ' + test_expect_success "GET UnixFS $name with 'Accept: application/vnd.ipld.dag-$format' has expected Content-Type" ' curl -sD - -H "Accept: application/vnd.ipld.dag-$format" "http://127.0.0.1:$GWAY_PORT/ipfs/$FILE_CID" > curl_output 2>&1 && test_should_contain "Content-Type: application/vnd.ipld.dag-$format" curl_output && test_should_not_contain "Content-Type: application/$format" curl_output ' - test_expect_success "GET $name with format=$format has expected Content-Type" ' + test_expect_success "GET UnixFS $name with format=$format has expected Content-Type" ' curl -sD - "http://127.0.0.1:$GWAY_PORT/ipfs/$FILE_CID?format=$format" > curl_output 2>&1 && test_should_contain "Content-Type: application/$format" curl_output && test_should_not_contain "Content-Type: application/vnd.ipld.dag-$format" curl_output ' - test_expect_success "GET $name with 'Accept: application/$format' has expected Content-Type" ' + test_expect_success "GET UnixFS $name with 'Accept: application/$format' has expected Content-Type" ' curl -sD - -H "Accept: application/$format" "http://127.0.0.1:$GWAY_PORT/ipfs/$FILE_CID" > curl_output 2>&1 && test_should_contain "Content-Type: application/$format" curl_output && test_should_not_contain "Content-Type: application/vnd.ipld.dag-$format" curl_output ' - test_expect_success "GET $name has expected output for file" ' + test_expect_success "GET UnixFS $name has expected output for file" ' curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$FILE_CID?format=dag-$format" > curl_output 2>&1 && ipfs dag get --output-codec dag-$format $FILE_CID > ipfs_dag_get_output 2>&1 && test_cmp ipfs_dag_get_output curl_output ' - test_expect_success "GET $name has expected output for directory" ' + test_expect_success "GET UnixFS $name has expected output for directory" ' curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$DIR_CID?format=dag-$format" > curl_output 2>&1 && ipfs dag get --output-codec dag-$format $DIR_CID > ipfs_dag_get_output 2>&1 && test_cmp ipfs_dag_get_output curl_output ' - test_expect_success "GET $name with format=dag-$format and format=$format produce same output" ' + test_expect_success "GET UnixFS $name with format=dag-$format and format=$format produce same output" ' curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$DIR_CID?format=dag-$format" > curl_output_1 2>&1 && curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$DIR_CID?format=$format" > curl_output_2 2>&1 && test_cmp curl_output_1 curl_output_2 ' } -test_codec "DAG-JSON" "json" -test_codec "DAG-CBOR" "cbor" +test_codec_unixfs "DAG-JSON" "json" +test_codec_unixfs "DAG-CBOR" "cbor" test_kill_ipfs_daemon