Don't use zgrep in check-config if apparmor porfile is enforced (#7939)

* Don't use zgrep if apparmor is enforced for it

* Bump e2e se timeouts for reencryption time

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola 2023-07-12 08:49:05 -07:00 committed by GitHub
parent 34617390d0
commit 3eb4e12c3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ if [ $# -gt 0 ]; then
CONFIG="$1" CONFIG="$1"
fi fi
if ! command -v zgrep >/dev/null 2>&1; then if ! command -v zgrep >/dev/null 2>&1 || eval "cat /sys/kernel/security/apparmor/profiles | grep -q 'zgrep (enforce)'"; then
zgrep() { zgrep() {
zcat "$2" | grep "$1" zcat "$2" | grep "$1"
} }

View File

@ -196,7 +196,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
cmd = "k3s secrets-encrypt status" cmd = "k3s secrets-encrypt status"
Eventually(func() (string, error) { Eventually(func() (string, error) {
return e2e.RunCmdOnNode(cmd, serverNodeNames[0]) return e2e.RunCmdOnNode(cmd, serverNodeNames[0])
}, "180s", "5s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished")) }, "240s", "10s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
for _, nodeName := range serverNodeNames[1:] { for _, nodeName := range serverNodeNames[1:] {
res, err := e2e.RunCmdOnNode(cmd, nodeName) res, err := e2e.RunCmdOnNode(cmd, nodeName)
@ -219,7 +219,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
g.Expect(res).Should(ContainSubstring("Encryption Status: Enabled")) g.Expect(res).Should(ContainSubstring("Encryption Status: Enabled"))
g.Expect(res).Should(ContainSubstring("Current Rotation Stage: reencrypt_finished")) g.Expect(res).Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
g.Expect(res).Should(ContainSubstring("Server Encryption Hashes: All hashes match")) g.Expect(res).Should(ContainSubstring("Server Encryption Hashes: All hashes match"))
}, "420s", "2s").Should(Succeed()) }, "420s", "5s").Should(Succeed())
} }
}) })
}) })
@ -237,7 +237,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() {
cmd = "k3s secrets-encrypt status" cmd = "k3s secrets-encrypt status"
Eventually(func() (string, error) { Eventually(func() (string, error) {
return e2e.RunCmdOnNode(cmd, serverNodeNames[0]) return e2e.RunCmdOnNode(cmd, serverNodeNames[0])
}, "180s", "5s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished")) }, "240s", "10s").Should(ContainSubstring("Current Rotation Stage: reencrypt_finished"))
for i, nodeName := range serverNodeNames { for i, nodeName := range serverNodeNames {
Eventually(func(g Gomega) { Eventually(func(g Gomega) {