e2e/node/:Use e2eskipper package

This commit is contained in:
tanjunchen 2020-01-10 16:21:12 +08:00
parent 9269b5d430
commit 8c481022c1
6 changed files with 17 additions and 11 deletions

View File

@ -47,6 +47,7 @@ go_library(
"//test/e2e/framework/pod:go_default_library", "//test/e2e/framework/pod:go_default_library",
"//test/e2e/framework/rc:go_default_library", "//test/e2e/framework/rc:go_default_library",
"//test/e2e/framework/security:go_default_library", "//test/e2e/framework/security:go_default_library",
"//test/e2e/framework/skipper:go_default_library",
"//test/e2e/framework/ssh:go_default_library", "//test/e2e/framework/ssh:go_default_library",
"//test/e2e/framework/volume:go_default_library", "//test/e2e/framework/volume:go_default_library",
"//test/e2e/perftype:go_default_library", "//test/e2e/perftype:go_default_library",

View File

@ -20,6 +20,7 @@ import (
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl" e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
e2esecurity "k8s.io/kubernetes/test/e2e/framework/security" e2esecurity "k8s.io/kubernetes/test/e2e/framework/security"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
"github.com/onsi/ginkgo" "github.com/onsi/ginkgo"
) )
@ -29,7 +30,7 @@ var _ = SIGDescribe("AppArmor", func() {
ginkgo.Context("load AppArmor profiles", func() { ginkgo.Context("load AppArmor profiles", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
framework.SkipIfAppArmorNotSupported() e2eskipper.SkipIfAppArmorNotSupported()
e2esecurity.LoadAppArmorProfiles(f.Namespace.Name, f.ClientSet) e2esecurity.LoadAppArmorProfiles(f.Namespace.Name, f.ClientSet)
}) })
ginkgo.AfterEach(func() { ginkgo.AfterEach(func() {

View File

@ -21,6 +21,7 @@ import (
"strings" "strings"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh" e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
"github.com/onsi/ginkgo" "github.com/onsi/ginkgo"
@ -31,9 +32,9 @@ var _ = SIGDescribe("crictl", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
// `crictl` is not available on all cloud providers. // `crictl` is not available on all cloud providers.
framework.SkipUnlessProviderIs("gce", "gke") e2eskipper.SkipUnlessProviderIs("gce", "gke")
// The test requires $HOME/.ssh/id_rsa key to be present. // The test requires $HOME/.ssh/id_rsa key to be present.
framework.SkipUnlessSSHKeyPresent() e2eskipper.SkipUnlessSSHKeyPresent()
}) })
ginkgo.It("should be able to run crictl on the node", func() { ginkgo.It("should be able to run crictl on the node", func() {

View File

@ -33,6 +33,7 @@ import (
e2enode "k8s.io/kubernetes/test/e2e/framework/node" e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod" e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2erc "k8s.io/kubernetes/test/e2e/framework/rc" e2erc "k8s.io/kubernetes/test/e2e/framework/rc"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh" e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
"k8s.io/kubernetes/test/e2e/framework/volume" "k8s.io/kubernetes/test/e2e/framework/volume"
testutils "k8s.io/kubernetes/test/utils" testutils "k8s.io/kubernetes/test/utils"
@ -415,7 +416,7 @@ var _ = SIGDescribe("kubelet", func() {
} }
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...)
_, nfsServerPod, nfsIP = volume.NewNFSServer(c, ns, []string{"-G", "777", "/exports"}) _, nfsServerPod, nfsIP = volume.NewNFSServer(c, ns, []string{"-G", "777", "/exports"})
}) })

View File

@ -30,6 +30,7 @@ import (
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet" e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
e2enode "k8s.io/kubernetes/test/e2e/framework/node" e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh" e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
testutils "k8s.io/kubernetes/test/utils" testutils "k8s.io/kubernetes/test/utils"
@ -47,15 +48,15 @@ var _ = SIGDescribe("NodeProblemDetector [DisabledForLargeClusters]", func() {
f := framework.NewDefaultFramework("node-problem-detector") f := framework.NewDefaultFramework("node-problem-detector")
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
framework.SkipUnlessSSHKeyPresent() e2eskipper.SkipUnlessSSHKeyPresent()
framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...)
framework.SkipUnlessProviderIs("gce", "gke") e2eskipper.SkipUnlessProviderIs("gce", "gke")
framework.SkipUnlessNodeOSDistroIs("gci", "ubuntu") e2eskipper.SkipUnlessNodeOSDistroIs("gci", "ubuntu")
e2enode.WaitForTotalHealthy(f.ClientSet, time.Minute) e2enode.WaitForTotalHealthy(f.ClientSet, time.Minute)
}) })
ginkgo.It("should run without error", func() { ginkgo.It("should run without error", func() {
framework.SkipUnlessSSHKeyPresent() e2eskipper.SkipUnlessSSHKeyPresent()
ginkgo.By("Getting all nodes and their SSH-able IP addresses") ginkgo.By("Getting all nodes and their SSH-able IP addresses")
nodes, err := e2enode.GetReadySchedulableNodes(f.ClientSet) nodes, err := e2enode.GetReadySchedulableNodes(f.ClientSet)

View File

@ -21,6 +21,7 @@ import (
"strings" "strings"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh" e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
"github.com/onsi/ginkgo" "github.com/onsi/ginkgo"
@ -34,11 +35,11 @@ var _ = SIGDescribe("SSH", func() {
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
// When adding more providers here, also implement their functionality in e2essh.GetSigner(...). // When adding more providers here, also implement their functionality in e2essh.GetSigner(...).
framework.SkipUnlessProviderIs(framework.ProvidersWithSSH...) e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...)
// This test SSH's into the node for which it needs the $HOME/.ssh/id_rsa key to be present. So // This test SSH's into the node for which it needs the $HOME/.ssh/id_rsa key to be present. So
// we should skip if the environment does not have the key (not all CI systems support this use case) // we should skip if the environment does not have the key (not all CI systems support this use case)
framework.SkipUnlessSSHKeyPresent() e2eskipper.SkipUnlessSSHKeyPresent()
}) })
ginkgo.It("should SSH to all nodes and run commands", func() { ginkgo.It("should SSH to all nodes and run commands", func() {