Minor e2e cleanups. (#1425)
parent
4b7a59425b
commit
dd5b303a35
|
@ -35,26 +35,30 @@ func testClusterDNS(t *testing.T) {
|
|||
kubectlRunner := util.NewKubectlRunner(t)
|
||||
podName := "busybox"
|
||||
podPath, _ := filepath.Abs("testdata/busybox.yaml")
|
||||
defer kubectlRunner.RunCommand([]string{"delete", "-f", podPath})
|
||||
|
||||
dnsTest := func() error {
|
||||
podNamespace := kubectlRunner.CreateRandomNamespace()
|
||||
defer kubectlRunner.DeleteNamespace(podNamespace)
|
||||
|
||||
if _, err := kubectlRunner.RunCommand([]string{"create", "-f", podPath, "--namespace=" + podNamespace}); err != nil {
|
||||
setupTest := func() error {
|
||||
if _, err := kubectlRunner.RunCommand([]string{"create", "-f", podPath}); err != nil {
|
||||
return err
|
||||
}
|
||||
defer kubectlRunner.RunCommand([]string{"delete", "-f", podPath, "--namespace=" + podNamespace})
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := commonutil.RetryAfter(20, setupTest, 2*time.Second); err != nil {
|
||||
t.Fatal("Error setting up DNS test.")
|
||||
}
|
||||
|
||||
dnsTest := func() error {
|
||||
p := &api.Pod{}
|
||||
for p.Status.Phase != "Running" {
|
||||
var err error
|
||||
p, err = kubectlRunner.GetPod(podName, podNamespace)
|
||||
p, err = kubectlRunner.GetPod(podName, "default")
|
||||
if err != nil {
|
||||
return &commonutil.RetriableError{Err: err}
|
||||
}
|
||||
}
|
||||
|
||||
dnsByteArr, err := kubectlRunner.RunCommand([]string{"exec", podName, "--namespace=" + podNamespace,
|
||||
dnsByteArr, err := kubectlRunner.RunCommand([]string{"exec", podName,
|
||||
"nslookup", "kubernetes.default"})
|
||||
dnsOutput := string(dnsByteArr)
|
||||
if err != nil {
|
||||
|
|
|
@ -29,7 +29,6 @@ import (
|
|||
)
|
||||
|
||||
func testClusterStatus(t *testing.T) {
|
||||
t.Parallel()
|
||||
kubectlRunner := util.NewKubectlRunner(t)
|
||||
cs := api.ComponentStatusList{}
|
||||
|
||||
|
|
|
@ -31,12 +31,15 @@ func TestFunctional(t *testing.T) {
|
|||
T: t}
|
||||
minikubeRunner.EnsureRunning()
|
||||
|
||||
// This one is not parallel, and ensures the cluster comes up
|
||||
// before we run any other tests.
|
||||
t.Run("Status", testClusterStatus)
|
||||
|
||||
t.Run("DNS", testClusterDNS)
|
||||
t.Run("EnvVars", testClusterEnv)
|
||||
t.Run("Logs", testClusterLogs)
|
||||
t.Run("SSH", testClusterSSH)
|
||||
t.Run("Systemd", testVMSystemd)
|
||||
t.Run("Status", testClusterStatus)
|
||||
t.Run("Addons", testAddons)
|
||||
t.Run("Dashboard", testDashboard)
|
||||
t.Run("ServicesList", testServicesList)
|
||||
|
|
Loading…
Reference in New Issue