]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: flush logs before grepping them 2412/head
authorLoic Dachary <loic-201408@dachary.org>
Sat, 6 Sep 2014 10:26:31 +0000 (12:26 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Sat, 6 Sep 2014 10:26:31 +0000 (12:26 +0200)
Otherwise the test races with the daemon writing the logs and can
sometime fail.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/test/mon/osd-erasure-code-profile.sh

index 66d1868119b64a43bf066c581a5fd4b157b58ef1..6464a14d3e2190f0e1f9f48addc9fc26c8909601 100755 (executable)
@@ -69,6 +69,7 @@ function SHARE_MON_TEST_set_pending() {
     result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"'$profile'"}' | nc -U $dir/$id/ceph-mon.$id.asok | cut --bytes=5-)
     test $result = true || return 1
     ./ceph osd erasure-code-profile set $profile --force || return 1
+    CEPH_ARGS='' ./ceph --admin-daemon $dir/$id/ceph-mon.$id.asok log flush || return 1
     grep "$profile try again" $dir/$id/log || return 1
 
     ./ceph osd erasure-code-profile rm $profile # cleanup
@@ -121,6 +122,7 @@ function SHARE_MON_TEST_rm_pending() {
     result=$(echo '{"prefix":"osdmonitor_prepare_command","prepare":"osd erasure-code-profile set","name":"'$profile'"}' | nc -U $dir/$id/ceph-mon.$id.asok | cut --bytes=5-)
     test $result = true || return 1
     ./ceph osd erasure-code-profile rm $profile || return 1
+    CEPH_ARGS='' ./ceph --admin-daemon $dir/$id/ceph-mon.$id.asok log flush || return 1
     grep "$profile: creation canceled" $dir/$id/log || return 1
 }