<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 9, 2020 at 3:50 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Problem with runltp creating and using single loop device for all tests<br>
is that if one test fails/gets stuck or fails to umount loop device<br>
for any reason, then all subsequent tests also fail, because<br>
they try to use mounted device.<br>
<br>
Don't force same loop device on all tests (unless it is chosen via<br>
env. variable DEVICE) and let LTP library try to acquire and release<br>
first usable loop device for each test.<br>
<br>
Fixes #703<br>
Signed-off-by: Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>><br>
---<br>
runltp | 12 +-----------<br>
1 file changed, 1 insertion(+), 11 deletions(-)<br>
<br>
diff --git a/runltp b/runltp<br>
index ec0811834862..94e290d6dbb9 100755<br>
--- a/runltp<br>
+++ b/runltp<br>
@@ -963,17 +963,7 @@ create_block()<br>
<br>
set_block_device()<br>
{<br>
- if [ -z "$DEVICE" ]; then<br>
- create_block<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">This is the only place to use create_block function, if we don't need it anymore why not removing the function definition together?</div></div><div><div class="gmail_default" style="font-size:small"><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- if [ $? -ne 0 ]; then<br>
- echo "no block device was specified on commandline."<br>
- echo "Block device could not be created using loopback device"<br>
- echo "Tests which require block device are disabled."<br>
- echo "You can specify it with option -b"<br>
- else<br>
- export LTP_DEV=$DEVICE<br>
- fi<br>
- else<br>
+ if [ -n "$DEVICE" ]; then<br>
export LTP_DEV=$DEVICE<br>
fi<br>
}<br>
-- <br>
2.18.1<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>