mkswap01.sh: Add "udevadm trigger" before swap verification
diff mbox series

Message ID 20191112035237.39839-1-yongxin.liu@windriver.com
State Accepted
Headers show
Series
  • mkswap01.sh: Add "udevadm trigger" before swap verification
Related show

Commit Message

Yongxin Liu Nov. 12, 2019, 3:52 a.m. UTC
Fix: https://github.com/linux-test-project/ltp/issues/458

Sometimes the swap device cannot show up in /dev/disk/by-uuid/
or /dev/disk/by-lable/ due to the issue #458. When this issue
happens, "blkid -c /dev/null" and "ls /dev/disk/by-uuid/" show
different UUID of the device.

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
---
 testcases/commands/mkswap/mkswap01.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

Li Wang Nov. 13, 2019, 9:25 a.m. UTC | #1
Merged, thanks!
Jan Stancek Nov. 13, 2019, 4:22 p.m. UTC | #2
----- Original Message -----
> diff --git a/testcases/commands/mkswap/mkswap01.sh
> b/testcases/commands/mkswap/mkswap01.sh
> index 3a348c6e6..9437c4a4e 100755
> --- a/testcases/commands/mkswap/mkswap01.sh
> +++ b/testcases/commands/mkswap/mkswap01.sh
> @@ -129,6 +129,8 @@ mkswap_test()
>  		return
>  	fi
>  
> +	udevadm trigger --name-match=$TST_DEVICE

It's been many months since I looked at this,..
Can you explain why this fixes it?

Don't we need "udevadm settle" as well to make sure udev caught up
before we check result?

Regards,
Jan
Jan Stancek Nov. 13, 2019, 4:27 p.m. UTC | #3
----- Original Message -----
> 
> 
> ----- Original Message -----
> > diff --git a/testcases/commands/mkswap/mkswap01.sh
> > b/testcases/commands/mkswap/mkswap01.sh
> > index 3a348c6e6..9437c4a4e 100755
> > --- a/testcases/commands/mkswap/mkswap01.sh
> > +++ b/testcases/commands/mkswap/mkswap01.sh
> > @@ -129,6 +129,8 @@ mkswap_test()
> >  		return
> >  	fi
> >  
> > +	udevadm trigger --name-match=$TST_DEVICE
> 
> It's been many months since I looked at this,..
> Can you explain why this fixes it?
> 
> Don't we need "udevadm settle" as well to make sure udev caught up
> before we check result?

Ah, test is using TST_RETRY_FUNC, so udev should have time
to catch up. Please ignore my query.

Thanks,
Jan

Patch
diff mbox series

diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
index 3a348c6e6..9437c4a4e 100755
--- a/testcases/commands/mkswap/mkswap01.sh
+++ b/testcases/commands/mkswap/mkswap01.sh
@@ -129,6 +129,8 @@  mkswap_test()
 		return
 	fi
 
+	udevadm trigger --name-match=$TST_DEVICE
+
 	if [ -n "$device" ]; then
 		mkswap_verify "$mkswap_op" "$op_arg" "$device" "$size" "$dev_file"
 		if [ $? -ne 0 ]; then