On Wed, Aug 24, 2022 at 03:32:10PM -0400, Josef Bacik wrote: > While trying to do > > ./check -s <some section> > > I was failing because I had a section defined higher than <some section> > that had TEST_DEV=/some/nonexistent/device, since I was using the other > section to test an experimental drive. This appears to be because we > run through all of the sections, and when getting the section config we > check to see if it's valid, and in this case the section wasn't valid. > > The section I was actually trying to use was valid however. Fix check > to see if the section we're trying to run is in our list of sections to > run first, and then if it is get the config at that point. > > Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx> > --- This patch looks good to me, and I did a little testing on it, for example[1]. But I know other people might use section config in many different ways, so I keep this patch here for several weeks, and no any objection for now. So I'd like to merge this patch now, please feel free to tell me if anyone get problems after having this change. Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx> Thanks, Zorro [1] # cat local.config [default] export TEST_DEV=/dev/sda5 export TEST_DIR=/mnt/test export SCRATCH_MNT=/mnt/scratch [simpledev] SCRATCH_DEV_POOL="" export SCRATCH_DEV=/dev/sda3 [pooldev] SCRATCH_DEV="" export SCRATCH_DEV_POOL="/dev/mapper/testvg-scratchdev1 /dev/mapper/testvg-scratchdev2 /dev/mapper/testvg-scratchdev3 /dev/mapper/testvg-scratchdev4 /dev/mapper/testvg-scratchdev5" [logdev] SCRATCH_DEV_POOL="" export SCRATCH_DEV=/dev/sda3 export USE_EXTERNAL=yes export SCRATCH_LOGDEV=/dev/loop0 # ./check -s logdev xfs/001 SECTION -- logdev FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 hp-dl380pg8-01 5.18.0-rc2+ #2 SMP PREEMPT_DYNAMIC Mon May 16 16:36:31 CST 2022 MKFS_OPTIONS -- -f -llogdev=/dev/loop0 /dev/sda3 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 -ologdev=/dev/loop0 /dev/sda3 /mnt/scratch xfs/001 9s ... 8s Ran: xfs/001 Passed all 1 tests # ./check -s simpledev -s pooldev -s logdev xfs/001 SECTION -- simpledev FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 hp-dl380pg8-01 5.18.0-rc2+ #2 SMP PREEMPT_DYNAMIC Mon May 16 16:36:31 CST 2022 MKFS_OPTIONS -- -f /dev/sda3 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/sda3 /mnt/scratch xfs/001 7s ... 7s Ran: xfs/001 Passed all 1 tests SECTION -- pooldev FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 hp-dl380pg8-01 5.18.0-rc2+ #2 SMP PREEMPT_DYNAMIC Mon May 16 16:36:31 CST 2022 MKFS_OPTIONS -- -f /dev/mapper/testvg-scratchdev1 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/mapper/testvg-scratchdev1 /mnt/scratch xfs/001 7s ... 6s Ran: xfs/001 Passed all 1 tests SECTION -- logdev FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 hp-dl380pg8-01 5.18.0-rc2+ #2 SMP PREEMPT_DYNAMIC Mon May 16 16:36:31 CST 2022 MKFS_OPTIONS -- -f -llogdev=/dev/loop0 /dev/sda3 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 -ologdev=/dev/loop0 /dev/sda3 /mnt/scratch xfs/001 6s ... 9s Ran: xfs/001 Passed all 1 tests xfs/001 6s ... 9s Ran: xfs/001 Passed all 1 tests SECTION -- simpledev ========================= Ran: xfs/001 Passed all 1 tests SECTION -- pooldev ========================= Ran: xfs/001 Passed all 1 tests SECTION -- logdev ========================= Ran: xfs/001 Passed all 1 tests > check | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/check b/check > index 0b2f10ed..ad0ab3cf 100755 > --- a/check > +++ b/check > @@ -678,7 +678,6 @@ function run_section() > > OLD_FSTYP=$FSTYP > OLD_TEST_FS_MOUNT_OPTS=$TEST_FS_MOUNT_OPTS > - get_next_config $section > > # Do we need to run only some sections ? > if [ ! -z "$RUN_SECTION" ]; then > @@ -708,6 +707,8 @@ function run_section() > fi > fi > > + get_next_config $section > + > mkdir -p $RESULT_BASE > if [ ! -d $RESULT_BASE ]; then > echo "failed to create results directory $RESULT_BASE" > -- > 2.26.3 >