From fb56095683787744f6a2b86996fac0216d50a65f Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Wed, 15 Jun 2016 11:49:12 -0700 Subject: [PATCH 1/3] e2e: Add container runtime flag --- hack/ginkgo-e2e.sh | 1 + test/e2e/framework/test_context.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index 87fd77276b5..05bf48b5e78 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -119,6 +119,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}" --node-instance-group="${NODE_INSTANCE_GROUP:-}" \ --prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \ ${OS_DISTRIBUTION:+"--os-distro=${OS_DISTRIBUTION}"} \ + ${KUBE_CONTAINER_RUNTIME:+"--container-runtime=${KUBE_CONTAINER_RUNTIME}"} \ ${NUM_NODES:+"--num-nodes=${NUM_NODES}"} \ ${E2E_CLEAN_START:+"--clean-start=true"} \ ${E2E_MIN_STARTUP_PODS:+"--minStartupPods=${E2E_MIN_STARTUP_PODS}"} \ diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index a0790b3aaf7..28d653f493c 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -47,6 +47,7 @@ type TestContextType struct { UpgradeTarget string PrometheusPushGateway string OSDistro string + ContainerRuntime string VerifyServiceAccount bool DeleteNamespace bool CleanStart bool @@ -108,6 +109,7 @@ func RegisterFlags() { flag.StringVar(&TestContext.ReportPrefix, "report-prefix", "", "Optional prefix for JUnit XML reports. Default is empty, which doesn't prepend anything to the default name.") flag.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.") flag.StringVar(&TestContext.OSDistro, "os-distro", "debian", "The OS distribution of cluster VM instances (debian, trusty, or coreos).") + flag.StringVar(&TestContext.ContainerRuntime, "container-runtime", "docker", "The container runtime of cluster VM instances (docker or rkt).") // TODO: Flags per provider? Rename gce-project/gce-zone? cloudConfig := &TestContext.CloudConfig From d8d63be2ddfe663b28da07a49ef27adab3910a6e Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Tue, 24 May 2016 15:40:49 -0700 Subject: [PATCH 2/3] e2e: Skip init container tests under rkt runtime --- test/e2e/framework/util.go | 8 ++++++++ test/e2e/pods.go | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 206311a4c31..947d5dc6ba8 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -366,6 +366,14 @@ func SkipUnlessProviderIs(supportedProviders ...string) { } } +func SkipIfContainerRuntimeIs(runtimes ...string) { + for _, runtime := range runtimes { + if runtime == TestContext.ContainerRuntime { + Skipf("Not supported under container runtime %s", runtime) + } + } +} + func ProviderIs(providers ...string) bool { for _, provider := range providers { if strings.ToLower(provider) == strings.ToLower(TestContext.Provider) { diff --git a/test/e2e/pods.go b/test/e2e/pods.go index 7fb8249446e..94eec318b5f 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -664,6 +664,7 @@ var _ = framework.KubeDescribe("Pods", func() { }) It("should invoke init containers on a RestartNever pod", func() { + framework.SkipIfContainerRuntimeIs("rkt") // #25988 podClient := f.Client.Pods(f.Namespace.Name) By("creating the pod") @@ -729,6 +730,7 @@ var _ = framework.KubeDescribe("Pods", func() { }) It("should invoke init containers on a RestartAlways pod", func() { + framework.SkipIfContainerRuntimeIs("rkt") // #25988 podClient := f.Client.Pods(f.Namespace.Name) By("creating the pod") @@ -798,6 +800,7 @@ var _ = framework.KubeDescribe("Pods", func() { }) It("should not start app containers if init containers fail on a RestartAlways pod", func() { + framework.SkipIfContainerRuntimeIs("rkt") // #25988 podClient := f.Client.Pods(f.Namespace.Name) By("creating the pod") @@ -913,6 +916,7 @@ var _ = framework.KubeDescribe("Pods", func() { }) It("should not start app containers and fail the pod if init containers fail on a RestartNever pod", func() { + framework.SkipIfContainerRuntimeIs("rkt") // #25988 podClient := f.Client.Pods(f.Namespace.Name) By("creating the pod") From e50a821aa80f143b7379503a807af83f9b99d865 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Tue, 24 May 2016 16:55:56 -0700 Subject: [PATCH 3/3] e2e: Skip attach tests for rkt runtime --- test/e2e/kubectl.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index 754309fa4eb..91edf1ea5eb 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -348,6 +348,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() { }) It("should support inline execution and attach", func() { + framework.SkipIfContainerRuntimeIs("rkt") // #23335 framework.SkipUnlessServerVersionGTE(jobsVersion, c) nsFlag := fmt.Sprintf("--namespace=%v", ns) @@ -1044,6 +1045,8 @@ var _ = framework.KubeDescribe("Kubectl client", func() { jobName := "e2e-test-rm-busybox-job" It("should create a job from an image, then delete the job [Conformance]", func() { + // The rkt runtime doesn't support attach, see #23335 + framework.SkipIfContainerRuntimeIs("rkt") framework.SkipUnlessServerVersionGTE(jobsVersion, c) By("executing a command with run --rm and attach with stdin")