From: Kamoltat Date: Mon, 1 Jul 2024 18:22:48 +0000 (+0000) Subject: qa/standlone/mon/mon-cluster-log.sh: TEST_journald_cluster_log_level X-Git-Tag: v20.0.0~1537^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0c7686e17d1a6efab164fa58d3661a80bb5cb9a;p=ceph.git qa/standlone/mon/mon-cluster-log.sh: TEST_journald_cluster_log_level Problem: In TEST_journald_cluster_log_level: we are currently facing insufficient permissions issues with `journalctl` command Solution: `super user do` on journalctl commands Fixes: https://tracker.ceph.com/issues/63784 Signed-off-by: Kamoltat --- diff --git a/qa/standalone/mon/mon-cluster-log.sh b/qa/standalone/mon/mon-cluster-log.sh index 953410695732..863a97c7cab3 100755 --- a/qa/standalone/mon/mon-cluster-log.sh +++ b/qa/standalone/mon/mon-cluster-log.sh @@ -134,7 +134,7 @@ function TEST_journald_cluster_log_level() { search_str="1.0 deep-scrub" TIMEOUT=60 sleep $TIMEOUT - journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=7 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=7 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log grep -q "$search_str" $dir/journal.log return_code=$? if [ $return_code -ne 0 ]; then @@ -145,7 +145,7 @@ function TEST_journald_cluster_log_level() { ceph osd down 0 TIMEOUT=20 wait_for_osd up 0 || return 1 search_str="osd.0.*boot" - journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + 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=$? if [ $return_code -ne 0 ]; then @@ -158,7 +158,7 @@ function TEST_journald_cluster_log_level() { TIMEOUT=60 sleep $TIMEOUT search_str="1.1 deep-scrub" - journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=7 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=7 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log grep -q "$search_str" $dir/journal.log return_code=$? if [ $return_code -eq 0 ]; then @@ -172,7 +172,7 @@ function TEST_journald_cluster_log_level() { ceph osd unset noup TIMEOUT=60 wait_for_osd up 0 || return 1 search_str="Health check failed: noup flag(s) set (OSDMAP_FLAGS)" - journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=4 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + sudo journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=4 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log grep -q "$search_str" $dir/journal.log return_code=$? if [ $return_code -ne 0 ]; then @@ -185,7 +185,7 @@ function TEST_journald_cluster_log_level() { WAIT_FOR_CLEAN_TIMEOUT=60 wait_for_clean search_str="Client client.admin marked osd.0 out, while it was still marked up" ceph log last | grep -q "$search_str" || return 1 - journalctl _COMM=ceph-mon CEPH_CHANNEL=cluster PRIORITY=6 --output=json-pretty --since "60 seconds ago" |jq '.MESSAGE' > $dir/journal.log + 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=$? if [ $return_code -eq 0 ]; then