@@ -75,27 +75,23 @@ func waitOvsQosForPod(f *framework.Framework, table string, pod *corev1.Pod, exp
75
75
var _ = framework .Describe ("[group:qos]" , func () {
76
76
f := framework .NewDefaultFramework ("qos" )
77
77
78
- var subnetName , namespaceName string
78
+ var podName , namespaceName string
79
79
var podClient * framework.PodClient
80
- var subnetClient * framework.SubnetClient
81
80
82
81
ginkgo .BeforeEach (func () {
83
82
podClient = f .PodClient ()
84
- subnetClient = f .SubnetClient ()
85
83
namespaceName = f .Namespace .Name
84
+ podName = "pod-" + framework .RandomSuffix ()
86
85
})
87
86
ginkgo .AfterEach (func () {
88
- if subnetName != "" {
89
- ginkgo .By ("Deleting subnet " + subnetName )
90
- subnetClient .DeleteSync (subnetName )
91
- }
87
+ ginkgo .By ("Deleting pod " + podName )
88
+ podClient .DeleteSync (podName )
92
89
})
93
90
94
91
framework .ConformanceIt ("should support netem QoS" , func () {
95
92
f .SkipVersionPriorTo (1 , 9 , "Support for netem QoS was introduced in v1.9" )
96
93
97
- name := "pod-" + framework .RandomSuffix ()
98
- ginkgo .By ("Creating pod " + name )
94
+ ginkgo .By ("Creating pod " + podName )
99
95
latency , jitter , limit , loss := 600 , 400 , 2000 , 10
100
96
annotations := map [string ]string {
101
97
util .NetemQosLatencyAnnotation : strconv .Itoa (latency ),
@@ -105,7 +101,7 @@ var _ = framework.Describe("[group:qos]", func() {
105
101
if ! f .VersionPriorTo (1 , 12 ) {
106
102
annotations [util .NetemQosJitterAnnotation ] = strconv .Itoa (jitter )
107
103
}
108
- pod := framework .MakePod (namespaceName , name , nil , annotations , "" , nil , nil )
104
+ pod := framework .MakePod (namespaceName , podName , nil , annotations , "" , nil , nil )
109
105
pod = podClient .CreateSync (pod )
110
106
111
107
ginkgo .By ("Validating pod annotations" )
@@ -126,17 +122,13 @@ var _ = framework.Describe("[group:qos]", func() {
126
122
}
127
123
framework .ExpectHaveKeyWithValue (qos , "limit" , strconv .Itoa (limit ))
128
124
framework .ExpectHaveKeyWithValue (qos , "loss" , strconv .Itoa (loss ))
129
-
130
- ginkgo .By ("Deleting pod " + name )
131
- podClient .DeleteSync (pod .Name )
132
125
})
133
126
134
127
framework .ConformanceIt ("should be able to update netem QoS" , func () {
135
128
f .SkipVersionPriorTo (1 , 9 , "Support for netem QoS was introduced in v1.9" )
136
129
137
- name := "pod-" + framework .RandomSuffix ()
138
- ginkgo .By ("Creating pod " + name + " without QoS" )
139
- pod := framework .MakePod (namespaceName , name , nil , nil , "" , nil , nil )
130
+ ginkgo .By ("Creating pod " + podName + " without QoS" )
131
+ pod := framework .MakePod (namespaceName , podName , nil , nil , "" , nil , nil )
140
132
pod = podClient .CreateSync (pod )
141
133
142
134
ginkgo .By ("Validating pod annotations" )
@@ -176,21 +168,17 @@ var _ = framework.Describe("[group:qos]", func() {
176
168
}
177
169
framework .ExpectHaveKeyWithValue (qos , "limit" , strconv .Itoa (limit ))
178
170
framework .ExpectHaveKeyWithValue (qos , "loss" , strconv .Itoa (loss ))
179
-
180
- ginkgo .By ("Deleting pod " + name )
181
- podClient .DeleteSync (pod .Name )
182
171
})
183
172
184
173
framework .ConformanceIt ("should support htb QoS" , func () {
185
174
f .SkipVersionPriorTo (1 , 9 , "Support for htb QoS with priority was introduced in v1.9" )
186
175
187
- name := "pod-" + framework .RandomSuffix ()
188
- ginkgo .By ("Creating pod " + name )
176
+ ginkgo .By ("Creating pod " + podName )
189
177
ingressRate := 300
190
178
annotations := map [string ]string {
191
179
util .IngressRateAnnotation : strconv .Itoa (ingressRate ),
192
180
}
193
- pod := framework .MakePod (namespaceName , name , nil , annotations , "" , nil , nil )
181
+ pod := framework .MakePod (namespaceName , podName , nil , annotations , "" , nil , nil )
194
182
pod = podClient .CreateSync (pod )
195
183
196
184
ginkgo .By ("Validating pod annotations" )
@@ -201,8 +189,5 @@ var _ = framework.Describe("[group:qos]", func() {
201
189
ginkgo .By ("Validating OVS Queue" )
202
190
queue := getOvsQosForPod (f , "queue" , pod )
203
191
framework .ExpectHaveKeyWithValue (queue , "max-rate" , strconv .Itoa (ingressRate * 1000 * 1000 ))
204
-
205
- ginkgo .By ("Deleting pod " + name )
206
- podClient .DeleteSync (pod .Name )
207
192
})
208
193
})
0 commit comments