From 3e894ebcc570e7275a8d524976ebea16367c75e9 Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Mon, 28 Sep 2020 18:55:00 +0200 Subject: [PATCH] TT#47113 Change check of /var/log/debug Merge 3 tests into one which is basically equivalent and simpler. In this way we reduce noise, since it shortens the file and often the reported errors (when it fails it will often fail several of the constraints at once), and errors are more direct and clear, reporting this: File: /var/log/debug: mode: doesn't match, expect: ["0640"] found: ["0644"] instead of: Command: find /var/log/ -type f -name debug ! -group adm: stdout: patterns not found: [!/./] which tells you the current permissions deemed wrong or owner/group used, so it's a bit more info to investigate. Presumably this was done in a separate way because of thinking that the "exists-or" didn't work or because sometimes files were created empty without proper permissions, but this presumably solved now. Change-Id: I77252743f0a204dffb838d4f7841e05689036c01 --- templates/135_filesys-logfiles.yaml.tt2 | 35 +++++++------------------ 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/templates/135_filesys-logfiles.yaml.tt2 b/templates/135_filesys-logfiles.yaml.tt2 index f21121a..2cc4d9c 100644 --- a/templates/135_filesys-logfiles.yaml.tt2 +++ b/templates/135_filesys-logfiles.yaml.tt2 @@ -42,6 +42,16 @@ file: group: adm filetype: file + /var/log/debug: + exists: + or: + - true + - false + mode: "0640" + owner: root + group: adm + filetype: file + /var/log/cron.log: exists: true mode: "0640" @@ -152,28 +162,3 @@ command: - '!/./' stderr: - '!/./' - -# optionally existing files - - # /var/log/debug - - "find /var/log/ -type f -name debug ! -user root": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./' - - "find /var/log/ -type f -name debug ! -group adm": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./' - - "find /var/log/ -type f -name debug ! -perm 640": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./'