@@ -14,19 +14,14 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package test
17
+ package e2e
18
18
19
19
import (
20
- "fmt"
21
-
22
20
. "github.com/onsi/ginkgo"
23
21
. "github.com/onsi/gomega"
24
-
25
- "k8s.io/api/core/v1"
26
- "k8s.io/kubernetes/pkg/scheduler/algorithm"
27
22
)
28
23
29
- var _ = Describe ("E2E Test" , func () {
24
+ var _ = Describe ("Job E2E Test" , func () {
30
25
It ("Schedule Job" , func () {
31
26
context := initTestContext ()
32
27
defer cleanupTestContext (context )
@@ -138,90 +133,6 @@ var _ = Describe("E2E Test", func() {
138
133
err = waitTasksReady (context , job3 .Name , int (rep )/ 3 )
139
134
Expect (err ).NotTo (HaveOccurred ())
140
135
})
141
-
142
- It ("NodeAffinity" , func () {
143
- context := initTestContext ()
144
- defer cleanupTestContext (context )
145
-
146
- slot := oneCPU
147
- nodeName , rep := computeNode (context , oneCPU )
148
- Expect (rep ).NotTo (Equal (0 ))
149
-
150
- affinity := & v1.Affinity {
151
- NodeAffinity : & v1.NodeAffinity {
152
- RequiredDuringSchedulingIgnoredDuringExecution : & v1.NodeSelector {
153
- NodeSelectorTerms : []v1.NodeSelectorTerm {
154
- {
155
- MatchFields : []v1.NodeSelectorRequirement {
156
- {
157
- Key : algorithm .NodeFieldSelectorKeyNodeName ,
158
- Operator : v1 .NodeSelectorOpIn ,
159
- Values : []string {nodeName },
160
- },
161
- },
162
- },
163
- },
164
- },
165
- },
166
- }
167
-
168
- job := createJob (context , "na-job" , 1 , 1 , "nginx" , slot , affinity )
169
- err := waitJobReady (context , job .Name )
170
- Expect (err ).NotTo (HaveOccurred ())
171
-
172
- pods := getPodOfJob (context , "na-job" )
173
- for _ , pod := range pods {
174
- Expect (pod .Spec .NodeName ).To (Equal (nodeName ))
175
- }
176
- })
177
-
178
- It ("Reclaim" , func () {
179
- context := initTestContext ()
180
- defer cleanupTestContext (context )
181
-
182
- jobName1 := "n1/qj-1"
183
- jobName2 := "n2/qj-2"
184
-
185
- slot := oneCPU
186
- rep := clusterSize (context , slot )
187
-
188
- createJob (context , jobName1 , 1 , rep , "nginx" , slot , nil )
189
- err := waitJobReady (context , jobName1 )
190
- Expect (err ).NotTo (HaveOccurred ())
191
-
192
- expected := int (rep ) / 2
193
- // Reduce one pod to tolerate decimal fraction.
194
- if expected > 1 {
195
- expected --
196
- } else {
197
- err := fmt .Errorf ("expected replica <%d> is too small" , expected )
198
- Expect (err ).NotTo (HaveOccurred ())
199
- }
200
-
201
- createJob (context , jobName2 , 1 , rep , "nginx" , slot , nil )
202
- err = waitTasksReady (context , jobName2 , expected )
203
- Expect (err ).NotTo (HaveOccurred ())
204
-
205
- err = waitTasksReady (context , jobName1 , expected )
206
- Expect (err ).NotTo (HaveOccurred ())
207
- })
208
-
209
- It ("Hostport" , func () {
210
- context := initTestContext ()
211
- defer cleanupTestContext (context )
212
-
213
- nn := clusterNodeNumber (context )
214
-
215
- containers := createContainers ("nginx" , oneCPU , 28080 )
216
- job := createJobWithOptions (context , "kube-batch" , "qj-1" , int32 (nn ), int32 (nn * 2 ), nil , containers )
217
-
218
- err := waitTasksReady (context , job .Name , nn )
219
- Expect (err ).NotTo (HaveOccurred ())
220
-
221
- err = waitTasksNotReady (context , job .Name , nn )
222
- Expect (err ).NotTo (HaveOccurred ())
223
- })
224
-
225
136
It ("Schedule BestEffort Job" , func () {
226
137
context := initTestContext ()
227
138
defer cleanupTestContext (context )
0 commit comments