Skip to contentSkip to conversation

discard rbd error output when not relevant in qemu-iotests

PATCH Superseded Loic Dachary 5 participants 12 messages Dec 30, 2013 – Feb 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 discard rbd error output when not relevant in qemu-iotests

Stash the rbd stderr and stdout because it also contains human readable progress messages : Removing image: 3% complete... in addition to potential error messages.

Display the stashed output if rbd exits on error.

---
 tests/qemu-iotests/common.rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +5 -1
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
+            if ! rbd rm "$TEST_DIR/t.$IMGFMT" > $TEST_DIR/rbd.out 2>&1
+            then
+                cat $TEST_DIR/rbd.out
+            fi
+            rm $TEST_DIR/rbd.out
             ;;
 
         sheepdog)
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 18 lines · Loic Dachary

Stash the rbd stderr and stdout because it also contains human readable progress messages : Removing image: 3% complete... in addition to potential error messages.

Display the stashed output if rbd exits on error.

---
 tests/qemu-iotests/common.rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +0 -0
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 

tests/qemu-iotests/common.rc _cleanup_test_img() · line 199

Quoted 10 lines
tests/qemu-iotests/common.rc +5 -1
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
+            if ! rbd rm "$TEST_DIR/t.$IMGFMT" > $TEST_DIR/rbd.out 2>&1
+            then
+                cat $TEST_DIR/rbd.out
+            fi
+            rm $TEST_DIR/rbd.out
             ;;
 
         sheepdog)

Hi Loïc,

Maybe you could filter by modifying _filter_qemu_io.

Best regards

Benoît

Quoted 4 lines
Signature · 1 line
1.8.3.2
#2 lore raw

Hi Benoît,

If I understand correctly common.filter is designed to transform the output and remove variance. In the case of rbd displaying the progress of removal, it is something we probably want to get rid of entirely. Please let me know if I'm missing something and I'll update the patch according to your suggestion.

Cheers

Quoted 44 lines · Benoît Canet
Quoted 18 lines · Loic Dachary

Stash the rbd stderr and stdout because it also contains human readable progress messages : Removing image: 3% complete... in addition to potential error messages.

Display the stashed output if rbd exits on error.

---
 tests/qemu-iotests/common.rc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +0 -0
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 

tests/qemu-iotests/common.rc _cleanup_test_img() · line 199

Quoted 10 lines
tests/qemu-iotests/common.rc +5 -1
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
+            if ! rbd rm "$TEST_DIR/t.$IMGFMT" > $TEST_DIR/rbd.out 2>&1
+            then
+                cat $TEST_DIR/rbd.out
+            fi
+            rm $TEST_DIR/rbd.out
             ;;
 
         sheepdog)

Hi Loïc,

Maybe you could filter by modifying _filter_qemu_io.

Best regards

Benoît

Quoted 4 lines
Signature · 1 line
1.8.3.2
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#3 lore raw
In reply to Loic Dachary

tests/qemu-iotests/common.rc _cleanup_test_img() · line 192

Quoted 9 lines · Loic Dachary
tests/qemu-iotests/common.rc +0 -1
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null

stderr will be displayed. Why isn't this enough?

#4 lore raw
Quoted 8 lines · Stefan Hajnoczi
Quoted 7 lines · Loic Dachary
tests/qemu-iotests/common.rc +0 -0
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 
Quoted 5 lines

tests/qemu-iotests/common.rc _cleanup_test_img() · line 192

Quoted 2 lines
tests/qemu-iotests/common.rc +0 -1
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null

stderr will be displayed. Why isn't this enough?

Because the progress of the removal operation will be displayed on stderr. rbd outputs on stderr even when there is no error.

Happy new year !

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#5 lore raw
Quoted 11 lines · Loic Dachary
Quoted 8 lines · Stefan Hajnoczi
Quoted 7 lines · Loic Dachary
tests/qemu-iotests/common.rc +0 -0
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 
Quoted 7 lines
Quoted 5 lines

tests/qemu-iotests/common.rc _cleanup_test_img() · line 192

Quoted 2 lines
tests/qemu-iotests/common.rc +0 -1
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null

stderr will be displayed. Why isn't this enough?

Because the progress of the removal operation will be displayed on stderr. rbd outputs on stderr even when there is no error.

Is that a bug in the rbd tool which should be fixed? Either by printing progress to stdout or by adding a --quiet option?

#6 lore raw
Quoted 18 lines · Stefan Hajnoczi
Quoted 17 lines · Loic Dachary
Quoted 13 lines · Stefan Hajnoczi

tests/qemu-iotests/common.rc _cleanup_test_img() · line 192

Quoted 9 lines · Loic Dachary
tests/qemu-iotests/common.rc +0 -1
index 28ba0d9..af66bbd 100644
@@ -189,7 +189,11 @@ _cleanup_test_img()
             ;;
 
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null

stderr will be displayed. Why isn't this enough?

Quoted 4 lines
Quoted 1 line

Because the progress of the removal operation will be displayed on stderr. rbd outputs on stderr even when there is no error.

Is that a bug in the rbd tool which should be fixed? Either by printing progress to stdout or by adding a --quiet option?

In my opinion, yes. But Josh may disagree ;-)

Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
#7 lore raw

PATCH v2 1/1 discard rbd error output when not relevant in qemu-iotests

In reply to Loic Dachary

Suppress rbd progress messages with --no-progress so they are not confused with an error output when comparing test results ( progress is displayed on stderr ).

---
 tests/qemu-iotests/common.rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/common.rc +1 -1
index 28ba0d9..7442bad 100644
@@ -189,7 +189,7 @@ _cleanup_test_img()
             ;;
 
         rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
+            rbd --no-progress rm "$TEST_DIR/t.$IMGFMT" > /dev/null
             ;;
 
         sheepdog)
Signature · 1 line
1.8.3.2
Reviewed-by on v2 1/1
#8 lore raw
Quoted 15 lines · Loic Dachary

Suppress rbd progress messages with --no-progress so they are not confused with an error output when comparing test results ( progress is displayed on stderr ).

---
  tests/qemu-iotests/common.rc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/common.rc +0 -0
index 28ba0d9..7442bad 100644

tests/qemu-iotests/common.rc _cleanup_test_img() · line 195

Quoted 8 lines
tests/qemu-iotests/common.rc +1 -1
@@ -189,7 +189,7 @@ _cleanup_test_img()
              ;;
 
          rbd)
-            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
+            rbd --no-progress rm "$TEST_DIR/t.$IMGFMT" > /dev/null
              ;;
 
          sheepdog)

This flag was added in ceph 0.61. I doubt anyone is interested in running these tests against earlier versions of ceph (the current stable releases are 0.67 and 0.72).

#10 lore raw
Quoted 5 lines · Stefan Hajnoczi
Quoted 4 lines · Loic Dachary

Suppress rbd progress messages with --no-progress so they are not confused with an error output when comparing test results ( progress is displayed on stderr ).

Quoted 9 lines
Quoted 4 lines
---
 tests/qemu-iotests/common.rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

Should this be merged before 2.0 ?

Best regards

Benoît