mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Update the addons test so it doesn't try to create clients on providers that aren't gce.
This commit is contained in:
parent
9a725333b1
commit
8690724443
@ -196,6 +196,11 @@ var _ = Describe("Addon update", func() {
|
|||||||
var namespace *api.Namespace
|
var namespace *api.Namespace
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
|
// This test requires SSH, so the provider check should be identical to
|
||||||
|
// those tests.
|
||||||
|
if !providerIs("gce") {
|
||||||
|
return
|
||||||
|
}
|
||||||
var err error
|
var err error
|
||||||
c, err = loadClient()
|
c, err = loadClient()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
@ -211,6 +216,11 @@ var _ = Describe("Addon update", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
|
// This test requires SSH, so the provider check should be identical to
|
||||||
|
// those tests.
|
||||||
|
if !providerIs("gce") {
|
||||||
|
return
|
||||||
|
}
|
||||||
if sshClient != nil {
|
if sshClient != nil {
|
||||||
// restart addon_update with the default options
|
// restart addon_update with the default options
|
||||||
sshExec(sshClient, "sudo /etc/init.d/kube-addons restart")
|
sshExec(sshClient, "sudo /etc/init.d/kube-addons restart")
|
||||||
@ -226,10 +236,6 @@ var _ = Describe("Addon update", func() {
|
|||||||
|
|
||||||
// WARNING: the test is not parallel-friendly!
|
// WARNING: the test is not parallel-friendly!
|
||||||
It("should propagate add-on file changes", func() {
|
It("should propagate add-on file changes", func() {
|
||||||
//these tests are long, so I squeezed several cases in one scenario
|
|
||||||
Expect(sshClient).NotTo(BeNil())
|
|
||||||
dir = namespace.Name // we use it only to give a unique string for each test execution
|
|
||||||
|
|
||||||
// This test requires SSH, so the provider check should be identical to
|
// This test requires SSH, so the provider check should be identical to
|
||||||
// those tests.
|
// those tests.
|
||||||
if !providerIs("gce") {
|
if !providerIs("gce") {
|
||||||
@ -237,6 +243,10 @@ var _ = Describe("Addon update", func() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//these tests are long, so I squeezed several cases in one scenario
|
||||||
|
Expect(sshClient).NotTo(BeNil())
|
||||||
|
dir = namespace.Name // we use it only to give a unique string for each test execution
|
||||||
|
|
||||||
temporaryRemotePathPrefix := "addon-test-dir"
|
temporaryRemotePathPrefix := "addon-test-dir"
|
||||||
temporaryRemotePath := temporaryRemotePathPrefix + "/" + dir // in home directory on kubernetes-master
|
temporaryRemotePath := temporaryRemotePathPrefix + "/" + dir // in home directory on kubernetes-master
|
||||||
defer sshExec(sshClient, fmt.Sprintf("rm -rf %s", temporaryRemotePathPrefix)) // ignore the result in cleanup
|
defer sshExec(sshClient, fmt.Sprintf("rm -rf %s", temporaryRemotePathPrefix)) // ignore the result in cleanup
|
||||||
|
Loading…
Reference in New Issue
Block a user