@@ -27,7 +27,6 @@ import (
27
27
"k8s.io/kubernetes/test/e2e/framework"
28
28
29
29
"github.com/onsi/ginkgo"
30
- "github.com/onsi/gomega"
31
30
)
32
31
33
32
func resizeRC (c clientset.Interface , ns , name string , replicas int32 ) error {
@@ -51,7 +50,7 @@ var _ = SIGDescribe("Nodes [Disruptive]", func() {
51
50
c = f .ClientSet
52
51
ns = f .Namespace .Name
53
52
systemPods , err := framework .GetPodsInNamespace (c , ns , map [string ]string {})
54
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
53
+ framework . ExpectNoError (err )
55
54
systemPodsNo = int32 (len (systemPods ))
56
55
if strings .Index (framework .TestContext .CloudConfig .NodeInstanceGroup , "," ) >= 0 {
57
56
framework .Failf ("Test dose not support cluster setup with more than one MIG: %s" , framework .TestContext .CloudConfig .NodeInstanceGroup )
@@ -104,36 +103,36 @@ var _ = SIGDescribe("Nodes [Disruptive]", func() {
104
103
// the cluster is restored to health.
105
104
ginkgo .By ("waiting for system pods to successfully restart" )
106
105
err := framework .WaitForPodsRunningReady (c , metav1 .NamespaceSystem , systemPodsNo , 0 , framework .PodReadyBeforeTimeout , map [string ]string {})
107
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
106
+ framework . ExpectNoError (err )
108
107
})
109
108
110
109
ginkgo .It ("should be able to delete nodes" , func () {
111
110
// Create a replication controller for a service that serves its hostname.
112
111
// The source for the Docker container kubernetes/serve_hostname is in contrib/for-demos/serve_hostname
113
112
name := "my-hostname-delete-node"
114
113
numNodes , err := framework .NumberOfRegisteredNodes (c )
115
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
114
+ framework . ExpectNoError (err )
116
115
originalNodeCount = int32 (numNodes )
117
116
common .NewRCByName (c , ns , name , originalNodeCount , nil )
118
117
err = framework .VerifyPods (c , ns , name , true , originalNodeCount )
119
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
118
+ framework . ExpectNoError (err )
120
119
121
120
targetNumNodes := int32 (framework .TestContext .CloudConfig .NumNodes - 1 )
122
121
ginkgo .By (fmt .Sprintf ("decreasing cluster size to %d" , targetNumNodes ))
123
122
err = framework .ResizeGroup (group , targetNumNodes )
124
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
123
+ framework . ExpectNoError (err )
125
124
err = framework .WaitForGroupSize (group , targetNumNodes )
126
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
125
+ framework . ExpectNoError (err )
127
126
err = framework .WaitForReadyNodes (c , int (originalNodeCount - 1 ), 10 * time .Minute )
128
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
127
+ framework . ExpectNoError (err )
129
128
130
129
ginkgo .By ("waiting 1 minute for the watch in the podGC to catch up, remove any pods scheduled on " +
131
130
"the now non-existent node and the RC to recreate it" )
132
131
time .Sleep (time .Minute )
133
132
134
133
ginkgo .By ("verifying whether the pods from the removed node are recreated" )
135
134
err = framework .VerifyPods (c , ns , name , true , originalNodeCount )
136
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
135
+ framework . ExpectNoError (err )
137
136
})
138
137
139
138
// TODO: Bug here - testName is not correct
@@ -143,26 +142,26 @@ var _ = SIGDescribe("Nodes [Disruptive]", func() {
143
142
name := "my-hostname-add-node"
144
143
common .NewSVCByName (c , ns , name )
145
144
numNodes , err := framework .NumberOfRegisteredNodes (c )
146
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
145
+ framework . ExpectNoError (err )
147
146
originalNodeCount = int32 (numNodes )
148
147
common .NewRCByName (c , ns , name , originalNodeCount , nil )
149
148
err = framework .VerifyPods (c , ns , name , true , originalNodeCount )
150
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
149
+ framework . ExpectNoError (err )
151
150
152
151
targetNumNodes := int32 (framework .TestContext .CloudConfig .NumNodes + 1 )
153
152
ginkgo .By (fmt .Sprintf ("increasing cluster size to %d" , targetNumNodes ))
154
153
err = framework .ResizeGroup (group , targetNumNodes )
155
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
154
+ framework . ExpectNoError (err )
156
155
err = framework .WaitForGroupSize (group , targetNumNodes )
157
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
156
+ framework . ExpectNoError (err )
158
157
err = framework .WaitForReadyNodes (c , int (originalNodeCount + 1 ), 10 * time .Minute )
159
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
158
+ framework . ExpectNoError (err )
160
159
161
160
ginkgo .By (fmt .Sprintf ("increasing size of the replication controller to %d and verifying all pods are running" , originalNodeCount + 1 ))
162
161
err = resizeRC (c , ns , name , originalNodeCount + 1 )
163
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
162
+ framework . ExpectNoError (err )
164
163
err = framework .VerifyPods (c , ns , name , true , originalNodeCount + 1 )
165
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () )
164
+ framework . ExpectNoError (err )
166
165
})
167
166
})
168
167
})
0 commit comments