fix(tls): use temp dir for keylog test path (#8010)

This commit is contained in:
Ville Vesilehto
2026-04-04 21:37:51 +03:00
committed by GitHub
parent 61f4145506
commit 5643d41ba7

View File

@@ -12,6 +12,7 @@ import (
) )
func TestTLS(t *testing.T) { func TestTLS(t *testing.T) {
tmpDir := t.TempDir()
tests := []struct { tests := []struct {
input string input string
shouldErr bool shouldErr bool
@@ -25,7 +26,7 @@ func TestTLS(t *testing.T) {
{"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth require\n}", false, "", ""}, {"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth require\n}", false, "", ""},
{"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth verify_if_given\n}", false, "", ""}, {"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth verify_if_given\n}", false, "", ""},
{"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth require_and_verify\n}", false, "", ""}, {"tls test_cert.pem test_key.pem test_ca.pem {\nclient_auth require_and_verify\n}", false, "", ""},
{"tls test_cert.pem test_key.pem test_ca.pem {\nkeylog tls.log\n}", false, "", ""}, {"tls test_cert.pem test_key.pem test_ca.pem {\nkeylog " + filepath.Join(tmpDir, "tls.log") + "\n}", false, "", ""},
// negative // negative
{"tls test_cert.pem test_key.pem test_ca.pem {\nunknown\n}", true, "", "unknown option"}, {"tls test_cert.pem test_key.pem test_ca.pem {\nunknown\n}", true, "", "unknown option"},
// client_auth takes exactly one parameter, which must be one of known keywords. // client_auth takes exactly one parameter, which must be one of known keywords.