mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +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
|
||||
|
||||
BeforeEach(func() {
|
||||
// This test requires SSH, so the provider check should be identical to
|
||||
// those tests.
|
||||
if !providerIs("gce") {
|
||||
return
|
||||
}
|
||||
var err error
|
||||
c, err = loadClient()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
@ -211,6 +216,11 @@ var _ = Describe("Addon update", func() {
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
// This test requires SSH, so the provider check should be identical to
|
||||
// those tests.
|
||||
if !providerIs("gce") {
|
||||
return
|
||||
}
|
||||
if sshClient != nil {
|
||||
// restart addon_update with the default options
|
||||
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!
|
||||
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
|
||||
// those tests.
|
||||
if !providerIs("gce") {
|
||||
@ -237,6 +243,10 @@ var _ = Describe("Addon update", func() {
|
||||
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"
|
||||
temporaryRemotePath := temporaryRemotePathPrefix + "/" + dir // in home directory on kubernetes-master
|
||||
defer sshExec(sshClient, fmt.Sprintf("rm -rf %s", temporaryRemotePathPrefix)) // ignore the result in cleanup
|
||||
|
Loading…
Reference in New Issue
Block a user