File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ function TEST_cluster_log_level() {
6262 ceph config set mon.a mon_cluster_log_level info
6363 ceph osd down 0
6464 TIMEOUT=20 wait_for_osd up 0 || return 1
65- grep -q " cluster [[]INF[]] osd.0.*boot" $dir /log
65+ TIMEOUT=60 wait_for_string $dir /log " cluster [[]INF[]] osd.0.*boot"
6666 return_code=$?
6767 if [ $return_code -ne 0 ]; then
6868 echo " Failed : Could not find INF log in the cluster log file"
@@ -145,9 +145,17 @@ function TEST_journald_cluster_log_level() {
145145 ceph osd down 0
146146 TIMEOUT=20 wait_for_osd up 0 || return 1
147147 search_str=" osd.0.*boot"
148- sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since " 60 seconds ago" | jq ' .MESSAGE' > $dir /journal.log
149- grep -q " $search_str " $dir /journal.log
150- return_code=$?
148+ return_code=1
149+ RETRY_DURATION=60
150+ for (( i= 0 ; i < $RETRY_DURATION ; i++ )) ; do
151+ sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since " 60 seconds ago" | jq ' .MESSAGE' > $dir /journal.log
152+ if ! grep " $search_str " $dir /journal.log; then
153+ sleep 1
154+ else
155+ return_code=0
156+ break
157+ fi
158+ done
151159 if [ $return_code -ne 0 ]; then
152160 echo " Failed : Could not find INF log in the journalctl log file"
153161 ERRORS=$(( $ERRORS + 1 ))
You can’t perform that action at this time.
0 commit comments