Merge pull request #10806 from prezha/fix-testlogfile
make sure path to logs directory existspull/10893/head
commit
ebb13e56ea
|
@ -20,12 +20,19 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/localpath"
|
||||
)
|
||||
|
||||
func TestLogFile(t *testing.T) {
|
||||
t.Run("SetLogFile", func(t *testing.T) {
|
||||
// make sure logs directory exists
|
||||
if err := os.MkdirAll(filepath.Dir(localpath.AuditLog()), 0755); err != nil {
|
||||
t.Fatalf("Error creating logs directory: %v", err)
|
||||
}
|
||||
if err := setLogFile(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue