Re: [PATCH blktests] loop/010: drain udev events after test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul 14, 2025 / 09:12, Daniel Wagner wrote:
> On Mon, Jul 14, 2025 at 07:09:39AM +0000, Shinichiro Kawasaki wrote:
> > > --- a/tests/loop/010
> > > +++ b/tests/loop/010
> > > @@ -78,5 +78,12 @@ test() {
> > >  	if _dmesg_since_test_start | grep --quiet "$grep_str"; then
> > >  		echo "Fail"
> > >  	fi
> > > +
> > > +	# The repeated loop device creation and deletions generated so many udev
> > > +	# events. Drain the events to not influence following test cases.
> > > +	if systemctl is-active systemd-udevd.service >/dev/null; then
> > > +		systemctl restart systemd-udevd.service
> > > +	fi
> 
> Maybe adding a warning if udev or a 'udevadm settle --timeout 900' would
> good when they system is not using systemd.

That sounds a good idea to make the test case more robust. I will add the
helper function below to the v2 patch.

_drain_udev_events() {
        if command -v systemctl &>/dev/null && grep --quiet systemd-udevd < \
                                        <(systemctl list-unit-files); then
                systemctl restart systemd-udevd.serbice
        else
                udevadm settle --timeout=900
        fi
}




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux