From 535d35e161db08b5c12c5243a8363206437b2679 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 18 Aug 2023 09:34:42 +0200 Subject: [PATCH] chore: restore exec perms for t0116-gateway-cache.sh and fixtures (#10085) --- test/sharness/t0116-gateway-cache.sh | 8 +++- test/sharness/t0116-gateway-cache/README.md | 39 ++++++++++++++++++ .../sharness/t0116-gateway-cache/fixtures.car | Bin 0 -> 468 bytes ...p32iwm9pdt9nq3y5rpn3ln9j12zfhe.ipns-record | Bin 0 -> 394 bytes 4 files changed, 46 insertions(+), 1 deletion(-) mode change 100644 => 100755 test/sharness/t0116-gateway-cache.sh create mode 100644 test/sharness/t0116-gateway-cache/README.md create mode 100644 test/sharness/t0116-gateway-cache/fixtures.car create mode 100644 test/sharness/t0116-gateway-cache/k51qzi5uqu5dlxdsdu5fpuu7h69wu4ohp32iwm9pdt9nq3y5rpn3ln9j12zfhe.ipns-record diff --git a/test/sharness/t0116-gateway-cache.sh b/test/sharness/t0116-gateway-cache.sh old mode 100644 new mode 100755 index 0986ffa419a..6dd81657c99 --- a/test/sharness/t0116-gateway-cache.sh +++ b/test/sharness/t0116-gateway-cache.sh @@ -39,8 +39,14 @@ test_expect_success "Add the test directory" ' ipfs routing put --allow-offline /ipns/${TEST_IPNS_ID} ../t0116-gateway-cache/${TEST_IPNS_ID}.ipns-record ' - # Etag + test_expect_success "GET for /ipfs/ unixfs dir listing succeeds" ' + curl -svX GET "http://127.0.0.1:$GWAY_PORT/ipfs/$ROOT1_CID/root2/root3/" >/dev/null 2>curl_ipfs_dir_listing_output + ' + + test_expect_success "GET for /ipns/ unixfs dir listing succeeds" ' + curl -svX GET "http://127.0.0.1:$GWAY_PORT/ipns/$TEST_IPNS_ID/root2/root3/" >/dev/null 2>curl_ipns_dir_listing_output + ' ## dir generated listing test_expect_success "GET /ipfs/ dir response has special Etag for generated dir listing" ' diff --git a/test/sharness/t0116-gateway-cache/README.md b/test/sharness/t0116-gateway-cache/README.md new file mode 100644 index 00000000000..1be92f45456 --- /dev/null +++ b/test/sharness/t0116-gateway-cache/README.md @@ -0,0 +1,39 @@ +# Dataset description/sources + +- fixtures.car + - raw CARv1 + +generated with: + +```sh +# using ipfs version 0.21.0-dev (03a98280e3e642774776cd3d0435ab53e5dfa867) + +mkdir -p root2/root3/root4 && +echo "hello" > root2/root3/root4/index.html && +ROOT1_CID=$(ipfs add -Qrw --cid-version 1 root2) +ROOT2_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2 | cut -d "/" -f3) +ROOT3_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3 | cut -d "/" -f3) +ROOT4_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3/root4 | cut -d "/" -f3) +FILE_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3/root4/index.html | cut -d "/" -f3) + +TEST_IPNS_ID=$(ipfs key gen --ipns-base=base36 --type=ed25519 cache_test_key | head -n1 | tr -d "\n") +# publish a record valid for a 100 years +ipfs name publish --key cache_test_key --allow-offline -Q --ttl=876600h --lifetime=876600h "/ipfs/$ROOT1_CID" +ipfs routing get /ipns/${TEST_IPNS_ID} > ${TEST_IPNS_ID}.ipns-record + +echo ROOT1_CID=${ROOT1_CID} # ./ +echo ROOT2_CID=${ROOT2_CID} # ./root2 +echo ROOT3_CID=${ROOT3_CID} # ./root2/root3 +echo ROOT4_CID=${ROOT4_CID} # ./root2/root3/root4 +echo FILE_CID=${FILE_CID} # ./root2/root3/root4/index.html +echo TEST_IPNS_ID=${TEST_IPNS_ID} + +ipfs dag export ${ROOT1_CID} > ./fixtures.car + +# ROOT1_CID=bafybeib3ffl2teiqdncv3mkz4r23b5ctrwkzrrhctdbne6iboayxuxk5ui # ./ +# ROOT2_CID=bafybeih2w7hjocxjg6g2ku25hvmd53zj7og4txpby3vsusfefw5rrg5sii # ./root2 +# ROOT3_CID=bafybeiawdvhmjcz65x5egzx4iukxc72hg4woks6v6fvgyupiyt3oczk5ja # ./root2/root3 +# ROOT4_CID=bafybeifq2rzpqnqrsdupncmkmhs3ckxxjhuvdcbvydkgvch3ms24k5lo7q # ./root2/root3/root4 +# FILE_CID=bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am # ./root2/root3/root4/index.html +# TEST_IPNS_ID=k51qzi5uqu5dlxdsdu5fpuu7h69wu4ohp32iwm9pdt9nq3y5rpn3ln9j12zfhe +``` diff --git a/test/sharness/t0116-gateway-cache/fixtures.car b/test/sharness/t0116-gateway-cache/fixtures.car new file mode 100644 index 0000000000000000000000000000000000000000..43e570e1d6acb0a03531b47feb540318f5027204 GIT binary patch literal 468 zcmcColvx?P5~W2SVzij7-;r*+x4)dz{ z2?vnLaUeGn)L{a2bEuF)#Kf&zm9F0B$mRdAQQ-H@OVV5Z6eh1XxzN*OUp4TNzE)w$xALX&dsheDKaunGEFWiD$lMeD#}PM zNlD5}HOoxOPpqsct;jYl%@lIj#Aa`PX!4XzpKmQY)6e$9U7<`kzNU$F%{D)#mwVMZ z{GZ-h%zgj3z3+a9thHt*l@~txHDQw3!_thyQ+_E$H*2s|5P0dSAWyk;;nVFJVQW=5IUpX*UA(aKG3;+eR BnWX># literal 0 HcmV?d00001