Skip to content

Commit 19a8f06

Browse files
committed
fix unsharding sharness test
1 parent 5de7a7e commit 19a8f06

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/sharness/t0260-sharding.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ test_expect_success "set up test data" '
3030
done
3131
'
3232
# CID of big_dir/ which will be sharded.
33-
SHARDED="QmUj4SSHNz27z9t6DtZJiR56r17BWqwMrWCzBcR6hF2bq1"
33+
SHARDED="QmWfjnRWRvdvYezQWnfbvrvY7JjrpevsE9cato1x76UqGr"
3434
# CID of big_dir/ once we remove half its entries and trigger a switch
3535
# back to a basic directory (un-sharding).
36-
UNSHAREDED="QmbvMyr8D2GDwuBkyJhbVWkrrVaJfFQhwUKFYqWnhkEiwg"
36+
UNSHAREDED="QmbVxi5zDdzytrjdufUejM92JsWj8wGVmukk6tiPce3p1m"
3737
# CID of small_dir/ which will *not* be sharded.
3838
NOT_SHARDED="QmdBXmm4HRpUhyzzctbFvi2tLai3XFL1YjmE1qfpJe61NX"
3939

@@ -64,15 +64,17 @@ test_add_dir_with_sharding_enabled "$NOT_SHARDED" small_dir
6464

6565
test_kill_ipfs_daemon
6666

67-
test_expect_success "remove a few entries from big_dir/" '
68-
for i in `seq 5` # just to be sure
67+
test_expect_success "remove a few entries from big_dir/ to trigger unsharding" '
68+
ipfs files cp /ipfs/$SHARDED /big_dir &&
69+
for i in `seq 5`
6970
do
70-
rm big_dir/`printf "file%06d" $i`
71-
done
71+
ipfs files rm /big_dir/`printf "file%06d" $i`
72+
done &&
73+
ipfs files stat --hash /big_dir > unshard_dir_hash &&
74+
echo "$UNSHAREDED" > unshard_exp &&
75+
test_cmp unshard_exp unshard_dir_hash"
7276
'
7377

74-
test_add_dir_with_sharding_enabled "$UNSHAREDED" big_dir
75-
7678
test_expect_success "ipfs cat error output the same" '
7779
test_expect_code 1 ipfs cat "$SHARDED" 2> sharded_err &&
7880
test_expect_code 1 ipfs cat "$NOT_SHARDED" 2> unsharded_err &&

0 commit comments

Comments
 (0)