[sheepdog] [PATCH 2/5] tests: avoid qemu-img snapshot warning

Wang dongxu wangdongxu at cmss.chinamobile.com
Wed Feb 11 16:26:19 CET 2015


"qemu-img snapshot" option will print warining message while probing a raw image, so
filter them using sed.

Signed-off-by: Wang dongxu <wangdongxu at cmss.chinamobile.com>
---
 tests/functional/013 |  2 +-
 tests/functional/017 | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/functional/013 b/tests/functional/013
index f724841..d19d8f8 100755
--- a/tests/functional/013
+++ b/tests/functional/013
@@ -15,7 +15,7 @@ _cluster_format -c 1
 _vdi_create test 4G
 for i in `seq 1 9`; do
     $QEMU_IO -f raw -c "write 0 512 -P $i" sheepdog:test | _filter_qemu_io
-    $QEMU_IMG snapshot -c tag$i sheepdog:test
+    $QEMU_IMG snapshot -c tag$i sheepdog:test 2>&1 | sed '/WARNING/, +2 d'
 done
 
 $QEMU_IO -f raw -c "read 0 512 -P 9" sheepdog:test | _filter_qemu_io
diff --git a/tests/functional/017 b/tests/functional/017
index 1c22c76..2c34a55 100755
--- a/tests/functional/017
+++ b/tests/functional/017
@@ -13,14 +13,14 @@ _wait_for_sheep 6
 _cluster_format -c 1
 
 _vdi_create test 4G
-$QEMU_IMG snapshot -c tag1 sheepdog:test
-$QEMU_IMG snapshot -c tag2 sheepdog:test
-$QEMU_IMG snapshot -c tag3 sheepdog:test
+$QEMU_IMG snapshot -c tag1 sheepdog:test 2>&1 | sed '/WARNING/, +2 d'
+$QEMU_IMG snapshot -c tag2 sheepdog:test 2>&1 | sed '/WARNING/, +2 d'
+$QEMU_IMG snapshot -c tag3 sheepdog:test 2>&1 | sed '/WARNING/, +2 d'
 
 _vdi_create test2 4G
-$QEMU_IMG snapshot -c tag1 sheepdog:test2
-$QEMU_IMG snapshot -c tag2 sheepdog:test2
+$QEMU_IMG snapshot -c tag1 sheepdog:test2 2>&1 | sed '/WARNING/, +2 d'
+$QEMU_IMG snapshot -c tag2 sheepdog:test2 2>&1 | sed '/WARNING/, +2 d'
 $QEMU_IO -f raw -c "write 0 512" sheepdog:test2:1 | _filter_qemu_io
-$QEMU_IMG snapshot -c tag3 sheepdog:test2
+$QEMU_IMG snapshot -c tag3 sheepdog:test2 2>&1 | sed '/WARNING/, +2 d'
 
 $DOG vdi tree | _filter_short_date
-- 
2.1.0






More information about the sheepdog mailing list