]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone/mon/mon-handle-forward: fix grep path and check return results 25902/head
authorSage Weil <sage@redhat.com>
Thu, 10 Jan 2019 23:18:24 +0000 (17:18 -0600)
committerSage Weil <sage@redhat.com>
Thu, 10 Jan 2019 23:18:38 +0000 (17:18 -0600)
This makes the test more strict and less confusing.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/standalone/mon/mon-handle-forward.sh

index 097c27c4d6afb1f5798b0bfad7f35178ddde4b8d..f067f46d9d7eb2457a0de93e1f924153b0223ce6 100755 (executable)
@@ -40,19 +40,19 @@ function run() {
     # when the leader ( MONA ) is used, there is no message forwarding
     ceph --mon-host $MONA osd pool create POOL1 12
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.a) log flush || return 1
-    grep 'mon_command(.*"POOL1"' $dir/a/mon.a.log
+    grep 'mon_command(.*"POOL1"' $dir/mon.a.log || return 1
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.b) log flush || return 1
     grep 'mon_command(.*"POOL1"' $dir/mon.b.log && return 1
     # when the peon ( MONB ) is used, the message is forwarded to the leader
     ceph --mon-host $MONB osd pool create POOL2 12
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.b) log flush || return 1
-    grep 'forward_request.*mon_command(.*"POOL2"' $dir/mon.b.log
+    grep 'forward_request.*mon_command(.*"POOL2"' $dir/mon.b.log || return 1
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.a) log flush || return 1
-    grep ' forward(mon_command(.*"POOL2"' $dir/mon.a.log
+    grep ' forward(mon_command(.*"POOL2"' $dir/mon.a.log || return 1
     # forwarded messages must retain features from the original connection
     features=$(sed -n -e 's|.*127.0.0.1:0.*accept features \([0-9][0-9]*\)|\1|p' < \
         $dir/mon.b.log)
-    grep ' forward(mon_command(.*"POOL2".*con_features '$features $dir/mon.a.log
+    grep ' forward(mon_command(.*"POOL2".*con_features '$features $dir/mon.a.log || return 1
 
     teardown $dir || return 1
 }