test: test ls incomplete sharded directory
Adin Schmahmann committed
Oct 25, 2021 at 11:54 UTC
a18b51b9eaca7d2ba2aefdfad482e8128a3c1bdf
1 file changed
+20
test/sharness/t0260-sharding.sh
+20
@@ -117,4 +117,24 @@ test_add_large_dir_v1 "$SHARDEDV1"
117
118
test_kill_ipfs_daemon
119
120
+test_list_incomplete_dir() {
121
+ test_expect_success "ipfs add (CIDv1) on very large directory with sha3 succeeds" '
122
+ ipfs add -r -q --cid-version=1 --hash=sha3-256 --pin=false testdata | tail -n1 > sharddir_out &&
123
+ largeSHA3dir=$(cat sharddir_out)
124
+ '
125
+
126
+ test_expect_success "delete intermediate node from DAG" '
127
+ ipfs block rm "/ipld/$largeSHA3dir/Links/0/Hash"
128
+ '
129
+
130
+ test_expect_success "can list part of the directory" '
131
+ ipfs ls "$largeSHA3dir" 2> ls_err_out
132
+ echo "Error: merkledag: not found" > exp_err_out &&
133
+ cat ls_err_out &&
134
+ test_cmp exp_err_out ls_err_out
135
+ '
136
+}
137
+
138
+test_list_incomplete_dir
139
+
140
test_done