diff options
author | Yuri Weinstein <yweinste@redhat.com> | 2024-11-06 16:34:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-06 16:34:58 +0100 |
commit | 29df6b129ea5188e092e6f135926e8a7a1e64efe (patch) | |
tree | 2abd104db320b16860195581a507e42a42394667 /qa | |
parent | Merge pull request #59855 from NitzanMordhai/wip-nitzan-expected-failure-wait... (diff) | |
parent | qa/standalone/mon/mon_cluster_log.sh: retry check for log line (diff) | |
download | ceph-29df6b129ea5188e092e6f135926e8a7a1e64efe.tar.xz ceph-29df6b129ea5188e092e6f135926e8a7a1e64efe.zip |
Merge pull request #60071 from shraddhaag/fix-mon-cluster-log-test
qa/standalone/mon/mon_cluster_log.sh: retry check for log line
Reviewed-by: Nitzan Mordechai <nmordech@redhat.com>
Diffstat (limited to 'qa')
-rwxr-xr-x | qa/standalone/mon/mon-cluster-log.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qa/standalone/mon/mon-cluster-log.sh b/qa/standalone/mon/mon-cluster-log.sh index 863a97c7cab..7b9adda0af6 100755 --- a/qa/standalone/mon/mon-cluster-log.sh +++ b/qa/standalone/mon/mon-cluster-log.sh @@ -62,7 +62,7 @@ function TEST_cluster_log_level() { ceph config set mon.a mon_cluster_log_level info ceph osd down 0 TIMEOUT=20 wait_for_osd up 0 || return 1 - grep -q "cluster [[]INF[]] osd.0.*boot" $dir/log + TIMEOUT=60 wait_for_string $dir/log "cluster [[]INF[]] osd.0.*boot" return_code=$? if [ $return_code -ne 0 ]; then echo "Failed : Could not find INF log in the cluster log file" @@ -145,9 +145,17 @@ function TEST_journald_cluster_log_level() { ceph osd down 0 TIMEOUT=20 wait_for_osd up 0 || return 1 search_str="osd.0.*boot" - sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log - grep -q "$search_str" $dir/journal.log - return_code=$? + return_code=1 + RETRY_DURATION=60 + for ((i=0; i < $RETRY_DURATION; i++)); do + sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + if ! grep "$search_str" $dir/journal.log; then + sleep 1 + else + return_code=0 + break + fi + done if [ $return_code -ne 0 ]; then echo "Failed : Could not find INF log in the journalctl log file" ERRORS=$(($ERRORS + 1)) |