@cryptotaxi247 / kubo / commits / 5b9442cfe

Revert "chore: add hamt directory sharding test"

This reverts commit d23702bbf8513094ca445bea52742d952e80a8dc.

Henrique Dias committed Mar 14, 2023 at 13:53 UTC 5b9442cfed8b668c1f2c9f968c1a4c86c82af201
3 files changed +3 -44
test/sharness/t0115-gateway-dir-listing.sh
+2 -22
@@ -13,34 +13,14 @@ test_description="Test directory listing (dir-index-html) on the HTTP gateway"
13
14 test_expect_success "ipfs init" '
15 export IPFS_PATH="$(pwd)/.ipfs" &&
16 - ipfs init --empty-repo --profile=test > /dev/null
16 + ipfs init --profile=test > /dev/null
17 '
18
19 test_launch_ipfs_daemon_without_network
20
21 -# HAMT-sharded directory test. We must execute this test first as we want to
22 -# start from an empty repository and count the exact number of refs we want.
23 -HAMT_CID=bafybeiggvykl7skb2ndlmacg2k5modvudocffxjesexlod2pfvg5yhwrqm
24 -HAMT_REFS_CID=bafybeicv4utmj46mgbpamvw2k6zg4qjs5yvspfnlxz2y6iuey5smjfcn4a
25 -HAMT_REFS_COUNT=963
26 -
27 -test_expect_success "hamt: import fixture with necessary refs" '
28 - ipfs dag import ../t0115-gateway-dir-listing/hamt-refs.car &&
29 - ipfs refs local | wc -l | tr -d " " > refs_count_actual &&
30 - echo $HAMT_REFS_COUNT > refs_count_expected &&
31 - test_cmp refs_count_expected refs_count_actual
32 -'
33 -
34 -test_expect_success "hamt: fetch directory from gateway in offline mode" '
35 - curl --max-time 1 -sD - http://127.0.0.1:$GWAY_PORT/ipfs/$HAMT_CID/ > hamt_list_response &&
36 - ipfs refs local | wc -l | tr -d " " > refs_count_actual &&
37 - echo $HAMT_REFS_COUNT > refs_count_expected &&
38 - test_cmp refs_count_expected refs_count_actual
39 -'
40 -
21 # Import test case
22 # See the static fixtures in ./t0115-gateway-dir-listing/
43 -test_expect_success "add remaining test fixtures" '
23 +test_expect_success "Add the test directory" '
24 ipfs dag import ../t0115-gateway-dir-listing/fixtures.car
25 '
26 DIR_CID=bafybeig6ka5mlwkl4subqhaiatalkcleo4jgnr3hqwvpmsqfca27cijp3i # ./rootDir/
test/sharness/t0115-gateway-dir-listing/README.md
+1 -22
@@ -2,12 +2,8 @@
2
3 - fixtures.car
4 - raw CARv1
5 -- hamt-refs.car
6 - - raw CARv1 containing all the necessary blocks to present a directory listing
7 - for `bafybeiggvykl7skb2ndlmacg2k5modvudocffxjesexlod2pfvg5yhwrqm`, which is
8 - a directory containing over 10k items.
5
10 -fixutres.car generated with:
6 +generated with:
7
8 ```sh
9 # using ipfs version 0.18.1
@@ -34,20 +30,3 @@ ipfs dag export ${DIR_CID} > ./fixtures.car
30 # FILE_CID=bafkreialihlqnf5uwo4byh4n3cmwlntwqzxxs2fg5vanqdi3d7tb2l5xkm # ./rootDir/ą/ę/file-źł.txt
31 # FILE_SIZE=34
32 ```
37 -
38 -hamt-refs.car generated with:
39 -
40 -```sh
41 -# using ipfs version 0.18.1
42 -export IPFS_PATH=$(mktemp -d)
43 -ipfs init --empty-repo
44 -ipfs daemon &
45 -curl http://127.0.0.1:8080/ipfs/bafybeiggvykl7skb2ndlmacg2k5modvudocffxjesexlod2pfvg5yhwrqm/
46 -killall ipfs
47 -ipfs refs local >> refs
48 -ipfs files mkdir --cid-version 1 /Test
49 -cat refs | xargs -I {} ipfs files cp /ipfs/{} /Test/{}
50 -ipfs files stat /Test
51 -# Grab CID: bafybeicv4utmj46mgbpamvw2k6zg4qjs5yvspfnlxz2y6iuey5smjfcn4a
52 -ipfs dag export bafybeicv4utmj46mgbpamvw2k6zg4qjs5yvspfnlxz2y6iuey5smjfcn4a > ./refs.car
53 -```
test/sharness/t0115-gateway-dir-listing/hamt-refs.car
Binary files a/test/sharness/t0115-gateway-dir-listing/hamt-refs.car and /dev/null differ