chore: restore exec perms for t0116-gateway-cache.sh and fixtures (#10085)
Henrique Dias committed
Aug 18, 2023 at 09:34 UTC
535d35e161db08b5c12c5243a8363206437b2679
4 files changed
+46
-1
test/sharness/t0116-gateway-cache.sh
+7
-1
@@ -39,8 +39,14 @@ test_expect_success "Add the test directory" '
39
ipfs routing put --allow-offline /ipns/${TEST_IPNS_ID} ../t0116-gateway-cache/${TEST_IPNS_ID}.ipns-record
40
'
41
42
-
42
# Etag
43
+ test_expect_success "GET for /ipfs/ unixfs dir listing succeeds" '
44
+ curl -svX GET "http://127.0.0.1:$GWAY_PORT/ipfs/$ROOT1_CID/root2/root3/" >/dev/null 2>curl_ipfs_dir_listing_output
45
+ '
46
+
47
+ test_expect_success "GET for /ipns/ unixfs dir listing succeeds" '
48
+ curl -svX GET "http://127.0.0.1:$GWAY_PORT/ipns/$TEST_IPNS_ID/root2/root3/" >/dev/null 2>curl_ipns_dir_listing_output
49
+ '
50
51
## dir generated listing
52
test_expect_success "GET /ipfs/ dir response has special Etag for generated dir listing" '
test/sharness/t0116-gateway-cache/README.md
new
+39
@@ -0,0 +1,39 @@
1
+# Dataset description/sources
2
+
3
+- fixtures.car
4
+ - raw CARv1
5
+
6
+generated with:
7
+
8
+```sh
9
+# using ipfs version 0.21.0-dev (03a98280e3e642774776cd3d0435ab53e5dfa867)
10
+
11
+mkdir -p root2/root3/root4 &&
12
+echo "hello" > root2/root3/root4/index.html &&
13
+ROOT1_CID=$(ipfs add -Qrw --cid-version 1 root2)
14
+ROOT2_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2 | cut -d "/" -f3)
15
+ROOT3_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3 | cut -d "/" -f3)
16
+ROOT4_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3/root4 | cut -d "/" -f3)
17
+FILE_CID=$(ipfs resolve -r /ipfs/$ROOT1_CID/root2/root3/root4/index.html | cut -d "/" -f3)
18
+
19
+TEST_IPNS_ID=$(ipfs key gen --ipns-base=base36 --type=ed25519 cache_test_key | head -n1 | tr -d "\n")
20
+# publish a record valid for a 100 years
21
+ipfs name publish --key cache_test_key --allow-offline -Q --ttl=876600h --lifetime=876600h "/ipfs/$ROOT1_CID"
22
+ipfs routing get /ipns/${TEST_IPNS_ID} > ${TEST_IPNS_ID}.ipns-record
23
+
24
+echo ROOT1_CID=${ROOT1_CID} # ./
25
+echo ROOT2_CID=${ROOT2_CID} # ./root2
26
+echo ROOT3_CID=${ROOT3_CID} # ./root2/root3
27
+echo ROOT4_CID=${ROOT4_CID} # ./root2/root3/root4
28
+echo FILE_CID=${FILE_CID} # ./root2/root3/root4/index.html
29
+echo TEST_IPNS_ID=${TEST_IPNS_ID}
30
+
31
+ipfs dag export ${ROOT1_CID} > ./fixtures.car
32
+
33
+# ROOT1_CID=bafybeib3ffl2teiqdncv3mkz4r23b5ctrwkzrrhctdbne6iboayxuxk5ui # ./
34
+# ROOT2_CID=bafybeih2w7hjocxjg6g2ku25hvmd53zj7og4txpby3vsusfefw5rrg5sii # ./root2
35
+# ROOT3_CID=bafybeiawdvhmjcz65x5egzx4iukxc72hg4woks6v6fvgyupiyt3oczk5ja # ./root2/root3
36
+# ROOT4_CID=bafybeifq2rzpqnqrsdupncmkmhs3ckxxjhuvdcbvydkgvch3ms24k5lo7q # ./root2/root3/root4
37
+# FILE_CID=bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am # ./root2/root3/root4/index.html
38
+# TEST_IPNS_ID=k51qzi5uqu5dlxdsdu5fpuu7h69wu4ohp32iwm9pdt9nq3y5rpn3ln9j12zfhe
39
+```
test/sharness/t0116-gateway-cache/fixtures.car
Binary files /dev/null and b/test/sharness/t0116-gateway-cache/fixtures.car differ
test/sharness/t0116-gateway-cache/k51qzi5uqu5dlxdsdu5fpuu7h69wu4ohp32iwm9pdt9nq3y5rpn3ln9j12zfhe.ipns-record
Binary files /dev/null and b/test/sharness/t0116-gateway-cache/k51qzi5uqu5dlxdsdu5fpuu7h69wu4ohp32iwm9pdt9nq3y5rpn3ln9j12zfhe.ipns-record differ