From 421950eecb8fb2506f7d22a4a53cb51465477bc5 Mon Sep 17 00:00:00 2001 From: Matt Liggett Date: Tue, 7 Jun 2016 18:01:29 -0700 Subject: [PATCH] Avoid pathname collisions in TestNewOICAuthProvider. May fix #26815 --- plugin/pkg/client/auth/oidc/oidc_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin/pkg/client/auth/oidc/oidc_test.go b/plugin/pkg/client/auth/oidc/oidc_test.go index 30d8e4ab208..6c05886df45 100644 --- a/plugin/pkg/client/auth/oidc/oidc_test.go +++ b/plugin/pkg/client/auth/oidc/oidc_test.go @@ -39,11 +39,16 @@ import ( ) func TestNewOIDCAuthProvider(t *testing.T) { - cert := path.Join(os.TempDir(), "oidc-cert") - key := path.Join(os.TempDir(), "oidc-key") + tempDir, err := ioutil.TempDir(os.TempDir(), "oidc_test") + if err != nil { + t.Fatalf("Cannot make temp dir %v", err) + } + cert := path.Join(tempDir, "oidc-cert") + key := path.Join(tempDir, "oidc-key") defer os.Remove(cert) defer os.Remove(key) + defer os.Remove(tempDir) oidctesting.GenerateSelfSignedCert(t, "127.0.0.1", cert, key) op := oidctesting.NewOIDCProvider(t)