All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] runltp: let each test acquire/release device
@ 2020-07-09  7:49 Jan Stancek
  2020-07-09  9:22 ` Cyril Hrubis
  2020-07-09  9:22 ` Li Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Stancek @ 2020-07-09  7:49 UTC (permalink / raw)
  To: ltp

Problem with runltp creating and using single loop device for all tests
is that if one test fails/gets stuck or fails to umount loop device
for any reason, then all subsequent tests also fail, because
they try to use mounted device.

Don't force same loop device on all tests (unless it is chosen via
env. variable DEVICE) and let LTP library try to acquire and release
first usable loop device for each test.

Fixes #703
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 runltp | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/runltp b/runltp
index ec0811834862..94e290d6dbb9 100755
--- a/runltp
+++ b/runltp
@@ -963,17 +963,7 @@ create_block()
 
 set_block_device()
 {
-    if [ -z "$DEVICE" ]; then
-        create_block
-        if [ $? -ne 0 ]; then
-            echo "no block device was specified on commandline."
-            echo "Block device could not be created using loopback device"
-            echo "Tests which require block device are disabled."
-            echo "You can specify it with option -b"
-	else
-            export LTP_DEV=$DEVICE
-        fi
-    else
+    if [ -n "$DEVICE" ]; then
         export LTP_DEV=$DEVICE
     fi
 }
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] runltp: let each test acquire/release device
  2020-07-09  7:49 [LTP] [PATCH] runltp: let each test acquire/release device Jan Stancek
@ 2020-07-09  9:22 ` Cyril Hrubis
  2020-07-09 11:12   ` Jan Stancek
  2020-07-09  9:22 ` Li Wang
  1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2020-07-09  9:22 UTC (permalink / raw)
  To: ltp

Hi!
> Problem with runltp creating and using single loop device for all tests
> is that if one test fails/gets stuck or fails to umount loop device
> for any reason, then all subsequent tests also fail, because
> they try to use mounted device.
> 
> Don't force same loop device on all tests (unless it is chosen via
> env. variable DEVICE) and let LTP library try to acquire and release
> first usable loop device for each test.
> 
> Fixes #703
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  runltp | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/runltp b/runltp
> index ec0811834862..94e290d6dbb9 100755
> --- a/runltp
> +++ b/runltp
> @@ -963,17 +963,7 @@ create_block()
>  
>  set_block_device()
>  {
> -    if [ -z "$DEVICE" ]; then
> -        create_block
> -        if [ $? -ne 0 ]; then
> -            echo "no block device was specified on commandline."
> -            echo "Block device could not be created using loopback device"
> -            echo "Tests which require block device are disabled."
> -            echo "You can specify it with option -b"
> -	else
> -            export LTP_DEV=$DEVICE
> -        fi
> -    else
> +    if [ -n "$DEVICE" ]; then
>          export LTP_DEV=$DEVICE
>      fi
>  }

Shouldn't we remove the create_block() function as well?

Other than that, acked.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] runltp: let each test acquire/release device
  2020-07-09  7:49 [LTP] [PATCH] runltp: let each test acquire/release device Jan Stancek
  2020-07-09  9:22 ` Cyril Hrubis
@ 2020-07-09  9:22 ` Li Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Li Wang @ 2020-07-09  9:22 UTC (permalink / raw)
  To: ltp

On Thu, Jul 9, 2020 at 3:50 PM Jan Stancek <jstancek@redhat.com> wrote:

> Problem with runltp creating and using single loop device for all tests
> is that if one test fails/gets stuck or fails to umount loop device
> for any reason, then all subsequent tests also fail, because
> they try to use mounted device.
>
> Don't force same loop device on all tests (unless it is chosen via
> env. variable DEVICE) and let LTP library try to acquire and release
> first usable loop device for each test.
>
> Fixes #703
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  runltp | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/runltp b/runltp
> index ec0811834862..94e290d6dbb9 100755
> --- a/runltp
> +++ b/runltp
> @@ -963,17 +963,7 @@ create_block()
>
>  set_block_device()
>  {
> -    if [ -z "$DEVICE" ]; then
> -        create_block
>

This is the only place to use create_block function, if we don't need it
anymore why not removing the function definition together?



> -        if [ $? -ne 0 ]; then
> -            echo "no block device was specified on commandline."
> -            echo "Block device could not be created using loopback device"
> -            echo "Tests which require block device are disabled."
> -            echo "You can specify it with option -b"
> -       else
> -            export LTP_DEV=$DEVICE
> -        fi
> -    else
> +    if [ -n "$DEVICE" ]; then
>          export LTP_DEV=$DEVICE
>      fi
>  }
> --
> 2.18.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200709/aa9b56e3/attachment.htm>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] runltp: let each test acquire/release device
  2020-07-09  9:22 ` Cyril Hrubis
@ 2020-07-09 11:12   ` Jan Stancek
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Stancek @ 2020-07-09 11:12 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Shouldn't we remove the create_block() function as well?
> 
> Other than that, acked.

Pushed with create_block() removed as well.

Thanks,
Jan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-09 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09  7:49 [LTP] [PATCH] runltp: let each test acquire/release device Jan Stancek
2020-07-09  9:22 ` Cyril Hrubis
2020-07-09 11:12   ` Jan Stancek
2020-07-09  9:22 ` Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.