Skip to content

Commit f7c6529

Browse files
committed
t: test index output from fsck cmd
Problem: None of the tests in t2816-fsck-cmd.t ensure the correct index of a bad blobref is output. Adjust tests to also ensure the correct index is output in error messages.
1 parent 6420c7d commit f7c6529

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t2816-fsck-cmd.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test_expect_success 'load kvs' '
5656
# unfortunately we don't have a `flux content remove` command, so we'll corrupt
5757
# a valref by overwriting a treeobj with a bad reference
5858
test_expect_success 'make a reference invalid' '
59-
cat dirb.out | jq -c .data[2]=\"sha1-1234567890123456789012345678901234567890\" > dirbbad.out &&
59+
cat dirb.out | jq -c .data[1]=\"sha1-1234567890123456789012345678901234567890\" > dirbbad.out &&
6060
flux kvs put --treeobj dir.b="$(cat dirbbad.out)"
6161
'
6262
test_expect_success 'unload kvs' '
@@ -67,7 +67,7 @@ test_expect_success 'flux-fsck detects errors' '
6767
test_must_fail flux fsck 2> fsckerrors1.out &&
6868
count=$(cat fsckerrors1.out | wc -l) &&
6969
test $count -eq 3 &&
70-
grep "dir\.b" fsckerrors1.out | grep "missing blobref" &&
70+
grep "dir\.b" fsckerrors1.out | grep "missing blobref" | grep "index=1" &&
7171
grep "Total errors: 1" fsckerrors1.out
7272
'
7373
test_expect_success 'flux-fsck no output with --quiet' '
@@ -90,8 +90,8 @@ test_expect_success 'flux-fsck detects errors' '
9090
test_must_fail flux fsck 2> fsckerrors3.out &&
9191
count=$(cat fsckerrors3.out | wc -l) &&
9292
test $count -eq 4 &&
93-
grep "dir\.b" fsckerrors3.out | grep "missing blobref" &&
94-
grep "dir\.c" fsckerrors3.out | grep "missing blobref" &&
93+
grep "dir\.b" fsckerrors3.out | grep "missing blobref" | grep "index=1" &&
94+
grep "dir\.c" fsckerrors3.out | grep "missing blobref" | grep "index=2" &&
9595
grep "Total errors: 2" fsckerrors3.out
9696
'
9797
test_expect_success 'flux-fsck no output with --quiet' '

0 commit comments

Comments
 (0)