Commit b367f33b authored by Aaron Crickenberger's avatar Aaron Crickenberger

Allow `make test-integration` to pass on OSX

`/var/run` is not world-writable on my OSX 10.11.x setup, so tests that standup a secure apiserver fail with the default cert dir. Use a tempdir instead.
parent 2be53cf0
......@@ -57,6 +57,10 @@ func TestRunServer(t *testing.T) {
defer os.Remove(kubeconfigFile.Name())
clientcmd.WriteToFile(*adminKubeConfig, kubeconfigFile.Name())
// Avoid default cert-dir of /var/run/kubernetes to allow this to run on darwin
certDir, _ := ioutil.TempDir("", "test-integration-apiserver")
defer os.Remove(certDir)
stopCh := make(chan struct{})
defer close(stopCh)
cmd := server.NewCommandStartWardleServer(os.Stdout, os.Stderr, stopCh)
......@@ -66,6 +70,7 @@ func TestRunServer(t *testing.T) {
"--authentication-kubeconfig", kubeconfigFile.Name(),
"--authorization-kubeconfig", kubeconfigFile.Name(),
"--etcd-servers", framework.GetEtcdURLFromEnv(),
"--cert-dir", certDir,
})
go cmd.Execute()
......
......@@ -18,7 +18,9 @@ package kubeaggregator
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"testing"
"time"
......@@ -50,6 +52,12 @@ func runAPIServer(t *testing.T, stopCh <-chan struct{}) string {
// Change the ports, because otherwise it will fail if examples/apiserver/apiserver_test and this are run in parallel.
serverRunOptions.SecureServing.ServingOptions.BindPort = 6443 + 3
serverRunOptions.InsecureServing.BindPort = 8080 + 3
// Avoid default cert-dir of /var/run/kubernetes to allow this to run on darwin
certDir, _ := ioutil.TempDir("", "test-integration-kubeaggregator")
defer os.Remove(certDir)
serverRunOptions.SecureServing.ServerCert.CertDirectory = certDir
go func() {
if err := serverRunOptions.Run(stopCh); err != nil {
t.Fatalf("Error in bringing up the example apiserver: %v", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment