From c1fe47bc3a6dc00f7f3360530d681b3ae08e9ac9 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Sun, 19 Jul 2026 06:11:48 +0300 Subject: [PATCH] test(tls): make keylog path test portable (#8311) Directory permission checks can be bypassed by privileged users and may behave differently on filesystems with nonstandard permission semantics. Make the bad-path case deterministic so TLS keylog tests remain portable across supported environments. Signed-off-by: Ville Vesilehto --- plugin/tls/tls_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugin/tls/tls_test.go b/plugin/tls/tls_test.go index c77e86aa1..a9141cc32 100644 --- a/plugin/tls/tls_test.go +++ b/plugin/tls/tls_test.go @@ -2,7 +2,6 @@ package tls import ( "crypto/tls" - "os" "path/filepath" "strings" "testing" @@ -102,8 +101,7 @@ func TestTLSKeyLog(t *testing.T) { t.Run("Bad Path", func(t *testing.T) { tmpDir := t.TempDir() - os.Chmod(tmpDir, 0000) - input := "tls test_cert.pem test_key.pem test_ca.pem {\nkeylog " + filepath.Join(tmpDir, "tls.log") + "\n}" + input := "tls test_cert.pem test_key.pem test_ca.pem {\nkeylog " + filepath.Join(tmpDir, "missing", "tls.log") + "\n}" c := caddy.NewTestController("dns", input) err := setup(c) if err == nil {