test/e2e/kubectl test/e2e_kubeadm:Use e2eskipper package

This commit is contained in:
tanjunchen 2020-01-11 14:32:19 +08:00
parent ace98e1382
commit 3d34a814d6
5 changed files with 19 additions and 14 deletions

View File

@ -46,6 +46,7 @@ go_library(
"//test/e2e/framework/kubectl:go_default_library",
"//test/e2e/framework/pod:go_default_library",
"//test/e2e/framework/service:go_default_library",
"//test/e2e/framework/skipper:go_default_library",
"//test/e2e/framework/testfiles:go_default_library",
"//test/e2e/scheduling:go_default_library",
"//test/integration/etcd:go_default_library",

View File

@ -74,6 +74,7 @@ import (
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
"k8s.io/kubernetes/test/e2e/framework/testfiles"
"k8s.io/kubernetes/test/e2e/scheduling"
"k8s.io/kubernetes/test/integration/etcd"
@ -234,7 +235,7 @@ var _ = SIGDescribe("Kubectl alpha client", func() {
})
ginkgo.It("should create a CronJob", func() {
framework.SkipIfMissingResource(f.DynamicClient, cronJobGroupVersionResourceAlpha, f.Namespace.Name)
e2eskipper.SkipIfMissingResource(f.DynamicClient, cronJobGroupVersionResourceAlpha, f.Namespace.Name)
schedule := "*/5 * * * ?"
framework.RunKubectlOrDie(ns, "run", cjName, "--restart=OnFailure", "--generator=cronjob/v2alpha1",
@ -1832,7 +1833,7 @@ metadata:
})
ginkgo.It("should create a CronJob", func() {
framework.SkipIfMissingResource(f.DynamicClient, cronJobGroupVersionResourceBeta, f.Namespace.Name)
e2eskipper.SkipIfMissingResource(f.DynamicClient, cronJobGroupVersionResourceBeta, f.Namespace.Name)
schedule := "*/5 * * * ?"
framework.RunKubectlOrDie(ns, "run", cjName, "--restart=OnFailure", "--generator=cronjob/v1beta1",

View File

@ -35,6 +35,7 @@ go_test(
"//staging/src/k8s.io/cluster-bootstrap/token/api:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/framework/config:go_default_library",
"//test/e2e/framework/skipper:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/ginkgo/config:go_default_library",
"//vendor/github.com/onsi/ginkgo/reporters:go_default_library",

View File

@ -18,6 +18,7 @@ package kubeadm
import (
"k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
@ -77,7 +78,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.Context("kube-dns ServiceAccount", func() {
ginkgo.It("should exist", func() {
if dnsType != "kube-dns" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
ExpectServiceAccount(f.ClientSet, kubeSystemNamespace, kubeDNSServiceAccountName)
@ -87,7 +88,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.Context("kube-dns Deployment", func() {
ginkgo.It("should exist and be properly configured", func() {
if dnsType != "kube-dns" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
d := GetDeployment(f.ClientSet, kubeSystemNamespace, kubeDNSDeploymentName)
@ -101,7 +102,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.Context("CoreDNS ServiceAccount", func() {
ginkgo.It("should exist", func() {
if dnsType != "CoreDNS" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
ExpectServiceAccount(f.ClientSet, kubeSystemNamespace, coreDNSServiceAccountName)
@ -109,7 +110,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.It("should have related ClusterRole and ClusterRoleBinding", func() {
if dnsType != "CoreDNS" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
ExpectClusterRole(f.ClientSet, coreDNSRoleName)
@ -120,7 +121,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.Context("CoreDNS ConfigMap", func() {
ginkgo.It("should exist and be properly configured", func() {
if dnsType != "CoreDNS" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
cm := GetConfigMap(f.ClientSet, kubeSystemNamespace, coreDNSConfigMap)
@ -132,7 +133,7 @@ var _ = Describe("DNS addon", func() {
ginkgo.Context("CoreDNS Deployment", func() {
ginkgo.It("should exist and be properly configured", func() {
if dnsType != "CoreDNS" {
framework.Skipf("Skipping because DNS type is %s", dnsType)
e2eskipper.Skipf("Skipping because DNS type is %s", dnsType)
}
d := GetDeployment(f.ClientSet, kubeSystemNamespace, coreDNSDeploymentName)

View File

@ -22,6 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
"github.com/onsi/ginkgo"
)
@ -75,10 +76,10 @@ var _ = Describe("networking [setup-networking]", func() {
ginkgo.Context("podSubnet", func() {
ginkgo.It("should be properly configured if specified in kubeadm-config", func() {
if dualStack {
framework.Skipf("Skipping because cluster is dual-stack")
e2eskipper.Skipf("Skipping because cluster is dual-stack")
}
if !podSubnetInKubeadmConfig {
framework.Skipf("Skipping because podSubnet was not specified in kubeadm-config")
e2eskipper.Skipf("Skipping because podSubnet was not specified in kubeadm-config")
}
cc := getClusterConfiguration(f.ClientSet)
if _, ok := cc["networking"]; ok {
@ -99,10 +100,10 @@ var _ = Describe("networking [setup-networking]", func() {
ginkgo.Context("serviceSubnet", func() {
ginkgo.It("should be properly configured if specified in kubeadm-config", func() {
if dualStack {
framework.Skipf("Skipping because cluster is dual-stack")
e2eskipper.Skipf("Skipping because cluster is dual-stack")
}
if !serviceSubnetInKubeadmConfig {
framework.Skipf("Skipping because serviceSubnet was not specified in kubeadm-config")
e2eskipper.Skipf("Skipping because serviceSubnet was not specified in kubeadm-config")
}
cc := getClusterConfiguration(f.ClientSet)
if _, ok := cc["networking"]; ok {
@ -124,10 +125,10 @@ var _ = Describe("networking [setup-networking]", func() {
ginkgo.Context("podSubnet", func() {
ginkgo.It("should be properly configured if specified in kubeadm-config", func() {
if !dualStack {
framework.Skipf("Skipping because cluster is not dual-stack")
e2eskipper.Skipf("Skipping because cluster is not dual-stack")
}
if !podSubnetInKubeadmConfig {
framework.Skipf("Skipping because podSubnet was not specified in kubeadm-config")
e2eskipper.Skipf("Skipping because podSubnet was not specified in kubeadm-config")
}
cc := getClusterConfiguration(f.ClientSet)
if _, ok := cc["networking"]; ok {