Message ID | 45ba3fd15ba81f18136d9f6a7e10e7d6bc2422d5.1629322156.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: make check handle invalid bg items | expand |
On 2021/8/19 上午5:33, Josef Bacik wrote: > When I added the invalid super image I saw that the lowmem tests were > passing, despite not having the detection code yet. Turns out this is > because we weren't using a run command helper which does the proper > expansion and adds the --mode=lowmem option. Fix this to use the proper > handler, and now the lowmem test fails properly without my patch to add > this support to the lowmem mode. > > Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > tests/common | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tests/common b/tests/common > index 805a447c..5b255689 100644 > --- a/tests/common > +++ b/tests/common > @@ -425,9 +425,8 @@ check_image() > > image=$1 > echo "testing image $(basename $image)" >> "$RESULTS" > - "$TOP/btrfs" check "$image" >> "$RESULTS" 2>&1 > - [ $? -eq 0 ] && _fail "btrfs check should have detected corruption" > - > + run_mustfail "btrfs check should have detected corruption" \ > + "$TOP/btrfs" check "$image" > run_check "$TOP/btrfs" check --repair --force "$image" > run_check "$TOP/btrfs" check "$image" > } >
On Wed, Aug 18, 2021 at 05:33:13PM -0400, Josef Bacik wrote: > When I added the invalid super image I saw that the lowmem tests were > passing, despite not having the detection code yet. Turns out this is > because we weren't using a run command helper which does the proper > expansion and adds the --mode=lowmem option. Fix this to use the proper > handler, and now the lowmem test fails properly without my patch to add > this support to the lowmem mode. > > Signed-off-by: Josef Bacik <josef@toxicpanda.com> > --- > tests/common | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tests/common b/tests/common > index 805a447c..5b255689 100644 > --- a/tests/common > +++ b/tests/common > @@ -425,9 +425,8 @@ check_image() > > image=$1 > echo "testing image $(basename $image)" >> "$RESULTS" > - "$TOP/btrfs" check "$image" >> "$RESULTS" 2>&1 > - [ $? -eq 0 ] && _fail "btrfs check should have detected corruption" > - > + run_mustfail "btrfs check should have detected corruption" \ > + "$TOP/btrfs" check "$image" This seems correct but Qu sent a patch that processes the output looking for some specific error messages so I've applied his version ("btrfs-progs: tests: also check subpage warning for check_image cases") > run_check "$TOP/btrfs" check --repair --force "$image" > run_check "$TOP/btrfs" check "$image" > } > -- > 2.26.3
diff --git a/tests/common b/tests/common index 805a447c..5b255689 100644 --- a/tests/common +++ b/tests/common @@ -425,9 +425,8 @@ check_image() image=$1 echo "testing image $(basename $image)" >> "$RESULTS" - "$TOP/btrfs" check "$image" >> "$RESULTS" 2>&1 - [ $? -eq 0 ] && _fail "btrfs check should have detected corruption" - + run_mustfail "btrfs check should have detected corruption" \ + "$TOP/btrfs" check "$image" run_check "$TOP/btrfs" check --repair --force "$image" run_check "$TOP/btrfs" check "$image" }
When I added the invalid super image I saw that the lowmem tests were passing, despite not having the detection code yet. Turns out this is because we weren't using a run command helper which does the proper expansion and adds the --mode=lowmem option. Fix this to use the proper handler, and now the lowmem test fails properly without my patch to add this support to the lowmem mode. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- tests/common | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)