Skip to content

Commit

Permalink
fixing UT r3
Browse files Browse the repository at this point in the history
  • Loading branch information
zoxpx committed Apr 15, 2024
1 parent 7c3f770 commit 5c9968f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vault/vault_cooldowns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ var (
func setupK8sTests(t *testing.T) {
tokFile := "/var/run/secrets/kubernetes.io/serviceaccount/token"
if _, err := os.Stat(tokFile); os.IsNotExist(err) {
if err := os.MkdirAll(path.Dir(tokFile), 0755); err != nil {
t.Skipf("Skipping test because - %s", err)
}
t.Logf("Creating dummy token file: %s", tokFile)
err := os.MkdirAll(path.Dir(tokFile), 0755)
require.NoError(t, err)
_, err = os.OpenFile(tokFile, os.O_RDONLY|os.O_CREATE, 0666) // "touch" the file
require.NoError(t, err)
}
Expand Down

0 comments on commit 5c9968f

Please sign in to comment.