Re: [btrfs-progs PATCH 1/4] tests: common: Add check_dm_target_support helper

David Sterba
2019-12-18T15:58:17Z

On Wed, Dec 18, 2019 at 08:26:09AM +0800, Qu Wenruo wrote:
> > +# check if the targets passed as arguments are available, and if not just skip
> > +# the test
> > +check_dm_target_support()
> > +{
> > + for target in "$@"; do
> > + $SUDO_HELPER modprobe dm-$target >/dev/null 2>&1
>
> To utilize $SUDO_HELPER, we need to call setup_root_helper() in the
> first place, just like all the other $SUDO_HELPER users in `tests/common`.
>
> Although nowadays it feels a little unnecessary, since the functionality
> is introduced because I'm a lazybone who doesn't bother to startup a VM
> to do proper test, but uses current unprivileged user to utilize self tests.
>
> Maybe it's time to get rid of SUDO_HELPER ?

No, that should stay, my local testing relies on that heavily.