From: Loic Dachary Date: Sat, 6 Sep 2014 10:26:31 +0000 (+0200) Subject: tests: flush logs before grepping them X-Git-Tag: v0.86~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0a4a2fc9c9a94e0834b4ca2875843b56373b719;p=ceph.git tests: flush logs before grepping them Otherwise the test races with the daemon writing the logs and can sometime fail. Signed-off-by: Loic Dachary --- diff --git a/src/test/mon/osd-erasure-code-profile.sh b/src/test/mon/osd-erasure-code-profile.sh index 66d1868119b6..6464a14d3e21 100755 --- a/src/test/mon/osd-erasure-code-profile.sh +++ b/src/test/mon/osd-erasure-code-profile.sh @@ -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 }