From 41a3acf6fe04573afa2c2851d63358f1fe8bbb80 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 13 Apr 2020 09:22:21 -0400 Subject: [PATCH] TT#47113 further loosen log files check We don't actually care whether the log files exists or not, we really only care about their permissions and ownerships. Change-Id: I094e9b262b4c4c775023beba79acd3787ec616ac --- templates/135_filesys-logfiles.yaml.tt2 | 119 +++--------------------- 1 file changed, 15 insertions(+), 104 deletions(-) diff --git a/templates/135_filesys-logfiles.yaml.tt2 b/templates/135_filesys-logfiles.yaml.tt2 index 8937dec..9b46863 100644 --- a/templates/135_filesys-logfiles.yaml.tt2 +++ b/templates/135_filesys-logfiles.yaml.tt2 @@ -57,100 +57,17 @@ file: filetype: file - - /var/log/ngcp/cdr.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/kamailio-lb.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/kamailio-options-proxy.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/kamailio-proxy.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/ngcpcfg.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/ntp.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/panel-fcgi.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/redis.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/rtp.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/sems.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/service.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/voicemail.log: - exists: true - mode: "0640" - owner: root - group: adm - filetype: file - - /var/log/ngcp/xmpp.log: - exists: true + /var/log/ngcp/api.log: + exists: + or: + - true + - false mode: "0640" owner: root - group: adm + group: _ngcp-li filetype: file -# catch-all for optionally existing log files command: @@ -175,31 +92,25 @@ command: stderr: - '!/./' - "find /var/log/ngcp/ -maxdepth 1 -size +0 -type f ! -group _ngcp-li -name api.log": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./' # optionally existing subdirectories [% FOR dir IN ['/var/log/ngcp/ngcp-rtcengine/', '/var/log/ngcp/ngcp-comx-fileshare-service/'] -%] - "test -e [% dir %] && find [% dir %] -maxdepth 1 -type f -size +0 -perm /o+rwx || true": + "if test -e [% dir %]; then find [% dir %] -maxdepth 1 -type f -size +0 -perm /o+rwx; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "test -e [% dir %] && find [% dir %] -maxdepth 1 -size +0 -type f ! -user root || true": + "if test -e [% dir %]; then find [% dir %] -maxdepth 1 -size +0 -type f ! -user root; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "test -e [% dir %] && find [% dir %] -maxdepth 1 -size +0 -type f ! -group adm || true": + "if test -e [% dir %]; then find [% dir %] -maxdepth 1 -size +0 -type f ! -group adm; fi": exit-status: 0 stdout: - '!/./' @@ -207,42 +118,42 @@ command: - '!/./' [% END -%] - "find /var/log/ngcp/nginx/ -type f -size +0 -perm /o+rwx": + "if test -e /var/log/ngcp/nginx/; then find /var/log/ngcp/nginx/ -type f -size +0 -perm /o+rwx; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "find /var/log/ngcp/nginx/ -size +0 -type f ! -user www-data": + "if test -e /var/log/ngcp/nginx/; then find /var/log/ngcp/nginx/ -size +0 -type f ! -user www-data; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "find /var/log/ngcp/nginx/ -size +0 -type f ! -group adm": + "if test -e /var/log/ngcp/nginx/; then find /var/log/ngcp/nginx/ -size +0 -type f ! -group adm; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "find /var/log/ngcp/kannel/ -type f -size +0 -perm /o+rwx": + "if test -e /var/log/ngcp/kannel/; then find /var/log/ngcp/kannel/ -type f -size +0 -perm /o+rwx; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "find /var/log/ngcp/kannel/ -size +0 -type f ! -user kannel": + "if test -e /var/log/ngcp/kannel/; then find /var/log/ngcp/kannel/ -size +0 -type f ! -user kannel; fi": exit-status: 0 stdout: - '!/./' stderr: - '!/./' - "find /var/log/ngcp/kannel/ -size +0 -type f ! -group adm": + "if test -e /var/log/ngcp/kannel/; then find /var/log/ngcp/kannel/ -size +0 -type f ! -group adm; fi": exit-status: 0 stdout: - '!/./'