github.com/midokura/kubeedge@v1.2.0-mido.0/tests/performance/loadtest/loadtest_test.go (about) 1 /* 2 Copyright 2019 The KubeEdge Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 package loadtest 17 18 import ( 19 "net/http" 20 "os/exec" 21 "strings" 22 "time" 23 24 . "github.com/onsi/ginkgo" 25 . "github.com/onsi/gomega" 26 "k8s.io/api/apps/v1" 27 metav1 "k8s.io/api/core/v1" 28 29 "github.com/kubeedge/kubeedge/tests/e2e/utils" 30 . "github.com/kubeedge/kubeedge/tests/performance/common" 31 ) 32 33 var DeploymentTestTimerGroup *utils.TestTimerGroup = utils.NewTestTimerGroup() 34 35 //RestartEdgeNodePodsToUseQuicProtocol function to switch the protocol and re-initialize the edgecore 36 func RestartEdgeNodePodsToUseQuicProtocol() error { 37 var EdgeNodePods []string 38 chconfigmapRet := make(chan error) 39 for nodeName, conf := range NodeInfo { 40 for range conf { 41 cmd := exec.Command("bash", "-x", "scripts/update_configmap.sh", "create_edge_config", nodeName, quiccloudHubURL, conf[0]) 42 err := utils.PrintCombinedOutput(cmd) 43 Expect(err).Should(BeNil()) 44 //Create ConfigMaps for Each EdgeNode created 45 go utils.HandleConfigmap(chconfigmapRet, http.MethodPatch, ctx.Cfg.K8SMasterForProvisionEdgeNodes+ConfigmapHandler+"/"+conf[0], true) 46 ret := <-chconfigmapRet 47 Expect(ret).To(BeNil()) 48 } 49 } 50 51 pods, err := utils.GetPods(ctx.Cfg.K8SMasterForProvisionEdgeNodes+AppHandler, "") 52 Expect(err).To(BeNil()) 53 for _, pod := range pods.Items { 54 if strings.Contains(pod.Name, "edgecore-deployment") { 55 //EdgeNodePodHost = pod.Spec.NodeName 56 EdgeNodePods = append(EdgeNodePods, pod.Name) 57 } 58 } 59 60 for i := range EdgeNodePods { 61 utils.DeletePods(ctx.Cfg.K8SMasterForProvisionEdgeNodes + AppHandler + "/" + EdgeNodePods[i]) 62 } 63 64 Eventually(func() int { 65 var count int 66 for i := range EdgeNodePods { 67 status, statusCode := utils.GetPodState(ctx.Cfg.K8SMasterForProvisionEdgeNodes + AppHandler + "/" + EdgeNodePods[i]) 68 utils.Infof("PodName: %s status: %s StatusCode: %d", EdgeNodePods[i], status, statusCode) 69 if statusCode == 404 { 70 count++ 71 } 72 } 73 return count 74 }, "1200s", "4s").Should(Equal(len(EdgeNodePods)), "Delete Application deployment is Unsuccessfull, Pods are not deleted within the time") 75 76 newpods, err := utils.GetPods(ctx.Cfg.K8SMasterForProvisionEdgeNodes+AppHandler, "") 77 Expect(err).To(BeNil()) 78 79 Eventually(func() int { 80 var count int 81 for _, pod := range newpods.Items { 82 state, _ := utils.GetPodState(ctx.Cfg.K8SMasterForProvisionEdgeNodes + AppHandler + "/" + pod.Name) 83 utils.Infof("PodName: %s PodStatus: %s", pod.Name, state) 84 if state == "Running" { 85 count++ 86 } 87 } 88 return count 89 }, "1200s", "2s").Should(Equal(ctx.Cfg.NumOfNodes), "New Pods has not come to Running State") 90 91 //Check All EdgeNode are in Running state 92 Eventually(func() int { 93 count := 0 94 for edgenodeName := range NodeInfo { 95 status := utils.CheckNodeReadyStatus(ctx.Cfg.K8SMasterForKubeEdge+NodeHandler, edgenodeName) 96 utils.Infof("Node Name: %v, Node Status: %v", edgenodeName, status) 97 if status == "Running" { 98 count++ 99 } 100 } 101 return count 102 }, "60s", "2s").Should(Equal(ctx.Cfg.NumOfNodes), "Nodes register to the k8s master is unsuccessfull !!") 103 104 return nil 105 } 106 107 func PullImageInAllEdgeNodes(appDeployments []string) { 108 var deploymentList v1.DeploymentList 109 var podlist metav1.PodList 110 for kubenode, val := range NodeInfo { 111 UID := "edgecore-app-" + utils.GetRandomString(5) 112 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], val[1], val[0], 1) 113 Expect(IsAppDeployed).Should(BeTrue()) 114 appDeployments = append(appDeployments, UID) 115 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 116 Expect(err).To(BeNil()) 117 for _, deployment := range deploymentList.Items { 118 if deployment.Name == UID { 119 label := kubenode 120 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, label) 121 Expect(err).To(BeNil()) 122 break 123 } 124 } 125 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 126 } 127 //after pulling image to all edgenodes, delete the deployments on respective edgenodes 128 for i := range appDeployments { 129 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodDelete, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler+"/"+appDeployments[i], "", ctx.Cfg.AppImageUrl[1], nodeSelector, "", 10) 130 Expect(IsAppDeployed).Should(BeTrue()) 131 } 132 podlist, err := utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 133 Expect(err).To(BeNil()) 134 utils.CheckPodDeleteState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 135 appDeployments = nil 136 } 137 138 //Run Test cases 139 var _ = Describe("Application deployment test in Perfronace test EdgeNodes", func() { 140 var UID string 141 var testTimer *utils.TestTimer 142 var testDescription GinkgoTestDescription 143 var podlist metav1.PodList 144 var appDeployments []string 145 146 Context("Pull images to all KubeEdge nodes", func() { 147 FIt("PULL_IMAGE_ALL_KUBEEDGE_NODES: Pull image to all KubeEdge edge nodes", func() { 148 PullImageInAllEdgeNodes(appDeployments) 149 }) 150 }) 151 152 Context("Test application deployment on Kubeedge EdgeNodes Through Websocket", func() { 153 BeforeEach(func() { 154 testDescription = CurrentGinkgoTestDescription() 155 testTimer = DeploymentTestTimerGroup.NewTestTimer(testDescription.TestText) 156 }) 157 AfterEach(func() { 158 // End test timer 159 testTimer.End() 160 // Print result 161 testTimer.PrintResult() 162 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodDelete, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler+"/"+UID, "", ctx.Cfg.AppImageUrl[1], nodeSelector, "", 10) 163 Expect(IsAppDeployed).Should(BeTrue()) 164 165 utils.CheckPodDeleteState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 166 podlist = metav1.PodList{} 167 }) 168 169 Measure("WSS_MEASURE_PERF_LOADTEST_NODES_10: Create 10 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 170 podlist = metav1.PodList{} 171 runtime := b.Time("runtime", func() { 172 var deploymentList v1.DeploymentList 173 podlist = metav1.PodList{} 174 replica := 10 175 //Generate the random string and assign as a UID 176 UID = "edgecore-app-" + utils.GetRandomString(5) 177 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 178 Expect(IsAppDeployed).Should(BeTrue()) 179 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 180 Expect(err).To(BeNil()) 181 for _, deployment := range deploymentList.Items { 182 if deployment.Name == UID { 183 //label := nodeName 184 time.Sleep(2 * time.Second) 185 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 186 Expect(err).To(BeNil()) 187 break 188 } 189 } 190 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 191 }) 192 193 utils.Infof("Runtime stats: %+v", runtime) 194 195 }, 5) 196 197 Measure("WSS_MEASURE_PERF_LOADTEST_NODES_20: Create 20 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 198 podlist = metav1.PodList{} 199 runtime := b.Time("runtime", func() { 200 var deploymentList v1.DeploymentList 201 podlist = metav1.PodList{} 202 replica := 20 203 //Generate the random string and assign as a UID 204 UID = "edgecore-app-" + utils.GetRandomString(5) 205 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 206 Expect(IsAppDeployed).Should(BeTrue()) 207 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 208 Expect(err).To(BeNil()) 209 for _, deployment := range deploymentList.Items { 210 if deployment.Name == UID { 211 //label := nodeName 212 time.Sleep(2 * time.Second) 213 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 214 Expect(err).To(BeNil()) 215 break 216 } 217 } 218 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 219 }) 220 221 utils.Infof("Runtime stats: %+v", runtime) 222 223 }, 5) 224 225 Measure("WSS_MEASURE_PERF_LOADTEST_NODES_50: Create 50 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 226 podlist = metav1.PodList{} 227 runtime := b.Time("runtime", func() { 228 var deploymentList v1.DeploymentList 229 podlist = metav1.PodList{} 230 replica := 50 231 //Generate the random string and assign as a UID 232 UID = "edgecore-app-" + utils.GetRandomString(5) 233 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 234 Expect(IsAppDeployed).Should(BeTrue()) 235 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 236 Expect(err).To(BeNil()) 237 for _, deployment := range deploymentList.Items { 238 if deployment.Name == UID { 239 //label := nodeName 240 time.Sleep(2 * time.Second) 241 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 242 Expect(err).To(BeNil()) 243 break 244 } 245 } 246 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 247 }) 248 249 utils.Infof("Runtime stats: %+v", runtime) 250 251 }, 5) 252 Measure("WSS_MEASURE_PERF_NODETEST_NODES_75: Create 75 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 253 podlist = metav1.PodList{} 254 runtime := b.Time("runtime", func() { 255 var deploymentList v1.DeploymentList 256 podlist = metav1.PodList{} 257 replica := 75 258 //Generate the random string and assign as a UID 259 UID = "edgecore-app-" + utils.GetRandomString(5) 260 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 261 Expect(IsAppDeployed).Should(BeTrue()) 262 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 263 Expect(err).To(BeNil()) 264 for _, deployment := range deploymentList.Items { 265 if deployment.Name == UID { 266 //label := nodeName 267 time.Sleep(2 * time.Second) 268 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 269 Expect(err).To(BeNil()) 270 break 271 } 272 } 273 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 274 }) 275 276 utils.Infof("Runtime stats: %+v", runtime) 277 278 }, 5) 279 Measure("WSS_MEASURE_PERF_NODETEST_NODES_100: Create 100 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 280 podlist = metav1.PodList{} 281 runtime := b.Time("runtime", func() { 282 var deploymentList v1.DeploymentList 283 podlist = metav1.PodList{} 284 replica := 100 285 //Generate the random string and assign as a UID 286 UID = "edgecore-app-" + utils.GetRandomString(5) 287 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 288 Expect(IsAppDeployed).Should(BeTrue()) 289 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 290 Expect(err).To(BeNil()) 291 for _, deployment := range deploymentList.Items { 292 if deployment.Name == UID { 293 //label := nodeName 294 time.Sleep(2 * time.Second) 295 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 296 Expect(err).To(BeNil()) 297 break 298 } 299 } 300 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 301 }) 302 303 utils.Infof("Runtime stats: %+v", runtime) 304 }, 5) 305 }) 306 307 Context("stress test on single Kubeedge EdgeNode", func() { 308 var appDeployments []string 309 BeforeEach(func() { 310 testDescription = CurrentGinkgoTestDescription() 311 testTimer = DeploymentTestTimerGroup.NewTestTimer(testDescription.TestText) 312 }) 313 AfterEach(func() { 314 // End test timer 315 testTimer.End() 316 // Print result 317 testTimer.PrintResult() 318 for i := range appDeployments { 319 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodDelete, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler+"/"+appDeployments[i], "", ctx.Cfg.AppImageUrl[1], nodeSelector, "", 10) 320 Expect(IsAppDeployed).Should(BeTrue()) 321 } 322 utils.CheckPodDeleteState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 323 podlist = metav1.PodList{} 324 appDeployments = nil 325 }) 326 327 It("QUIC_APP_DEPLOYMENT_1: Switch to Quic and pull the image in all KubeEdge nodes", func() { 328 err := RestartEdgeNodePodsToUseQuicProtocol() 329 Expect(err).To(BeNil()) 330 PullImageInAllEdgeNodes(appDeployments) 331 }) 332 333 FMeasure("MEASURE_PERF_NODETEST_SINGLE_NODE_1: Create 100 application Deployments, Measure Pod Running time", func(b Benchmarker) { 334 podlist = metav1.PodList{} 335 var err error 336 var nodeSelector string 337 var nodeName string 338 for key, val := range NodeInfo { 339 nodeSelector = val[1] 340 nodeName = key 341 break 342 } 343 b.Time("MEASURE_PERF_NODETEST_SINGLE_NODE_1", func() { 344 replica := 1 345 for i := 0; i < 100; i++ { 346 //Generate the random string and assign as a UID 347 UID = "edgecore-app-" + utils.GetRandomString(5) 348 appDeployments = append(appDeployments, UID) 349 go utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, 350 UID, ctx.Cfg.AppImageUrl[1], nodeSelector, "", replica) 351 } 352 time.Sleep(10 * time.Second) 353 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, nodeName) 354 Expect(err).To(BeNil()) 355 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 356 }) 357 }, 5) 358 359 Measure("MEASURE_PERF_NODETEST_SINGLE_NODE_1: Create 100 application Deployments while each deployment have 100 replica, Measure Pod Running time", func(b Benchmarker) { 360 podlist = metav1.PodList{} 361 var err error 362 var nodeSelector string 363 //var nodeName string 364 b.Time("MEASURE_PERF_NODETEST_SINGLE_NODE_1", func() { 365 replica := 10 366 for _, val := range NodeInfo { 367 nodeSelector = val[1] 368 //Generate the random string and assign as a UID 369 UID = "edgecore-app-" + utils.GetRandomString(5) 370 appDeployments = append(appDeployments, UID) 371 go utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, 372 UID, ctx.Cfg.AppImageUrl[1], nodeSelector, "", replica) 373 374 } 375 time.Sleep(10 * time.Second) 376 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 377 Expect(err).To(BeNil()) 378 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 379 }) 380 }, 1) 381 }) 382 383 Context("Test application deployment on Kubeedge EdgeNodes with Quic Protocol", func() { 384 var appDeployments []string 385 BeforeEach(func() { 386 testDescription = CurrentGinkgoTestDescription() 387 testTimer = DeploymentTestTimerGroup.NewTestTimer(testDescription.TestText) 388 }) 389 AfterEach(func() { 390 // End test timer 391 testTimer.End() 392 // Print result 393 testTimer.PrintResult() 394 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodDelete, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler+"/"+UID, "", ctx.Cfg.AppImageUrl[1], nodeSelector, "", 10) 395 Expect(IsAppDeployed).Should(BeTrue()) 396 397 utils.CheckPodDeleteState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 398 podlist = metav1.PodList{} 399 }) 400 401 It("QUIC_APP_DEPLOYMENT_1: Switch to Quic and pull the image in all KubeEdge nodes", func() { 402 err := RestartEdgeNodePodsToUseQuicProtocol() 403 Expect(err).To(BeNil()) 404 PullImageInAllEdgeNodes(appDeployments) 405 }) 406 407 Measure("QUIC_MEASURE_PERF_NODETEST_NODES_1: Create 1 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 408 409 runtime := b.Time("QUIC_MEASURE_PERF_NODETEST_NODES_1", func() { 410 var deploymentList v1.DeploymentList 411 podlist = metav1.PodList{} 412 replica := 1 413 //Generate the random string and assign as a UID 414 UID = "edgecore-app-" + utils.GetRandomString(5) 415 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 416 Expect(IsAppDeployed).Should(BeTrue()) 417 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 418 Expect(err).To(BeNil()) 419 for _, deployment := range deploymentList.Items { 420 if deployment.Name == UID { 421 //label := nodeName 422 time.Sleep(2 * time.Second) 423 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 424 Expect(err).To(BeNil()) 425 break 426 } 427 } 428 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 429 }) 430 utils.Infof("Runtime stats: %+v", runtime) 431 }, 5) 432 433 Measure("QUIC_MEASURE_PERF_NODETEST_NODES_10: Create 10 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 434 runtime := b.Time("QUIC_MEASURE_PERF_NODETEST_NODES_10", func() { 435 var deploymentList v1.DeploymentList 436 podlist = metav1.PodList{} 437 replica := 10 438 //Generate the random string and assign as a UID 439 UID = "edgecore-app-" + utils.GetRandomString(5) 440 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 441 Expect(IsAppDeployed).Should(BeTrue()) 442 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 443 Expect(err).To(BeNil()) 444 for _, deployment := range deploymentList.Items { 445 if deployment.Name == UID { 446 //label := nodeName 447 time.Sleep(2 * time.Second) 448 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 449 Expect(err).To(BeNil()) 450 break 451 } 452 } 453 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 454 }) 455 456 utils.Infof("Runtime stats: %+v", runtime) 457 458 }, 5) 459 460 Measure("QUIC_MEASURE_PERF_NODETEST_NODES_50: Create 50 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 461 runtime := b.Time("QUIC_MEASURE_PERF_NODETEST_NODES_50", func() { 462 var deploymentList v1.DeploymentList 463 podlist = metav1.PodList{} 464 replica := 50 465 //Generate the random string and assign as a UID 466 UID = "edgecore-app-" + utils.GetRandomString(5) 467 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 468 Expect(IsAppDeployed).Should(BeTrue()) 469 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 470 Expect(err).To(BeNil()) 471 for _, deployment := range deploymentList.Items { 472 if deployment.Name == UID { 473 //label := nodeName 474 time.Sleep(2 * time.Second) 475 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 476 Expect(err).To(BeNil()) 477 break 478 } 479 } 480 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 481 }) 482 483 utils.Infof("Runtime stats: %+v", runtime) 484 485 }, 5) 486 Measure("QUIC_MEASURE_PERF_NODETEST_NODES_75: Create 75 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 487 runtime := b.Time("QUIC_MEASURE_PERF_NODETEST_NODES_75", func() { 488 var deploymentList v1.DeploymentList 489 podlist = metav1.PodList{} 490 replica := 75 491 //Generate the random string and assign as a UID 492 UID = "edgecore-app-" + utils.GetRandomString(5) 493 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 494 Expect(IsAppDeployed).Should(BeTrue()) 495 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 496 Expect(err).To(BeNil()) 497 for _, deployment := range deploymentList.Items { 498 if deployment.Name == UID { 499 //label := nodeName 500 time.Sleep(2 * time.Second) 501 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 502 Expect(err).To(BeNil()) 503 break 504 } 505 } 506 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 507 }) 508 utils.Infof("Runtime stats: %+v", runtime) 509 510 }, 5) 511 Measure("QUIC_MEASURE_PERF_NODETEST_NODES_100: Create 100 KubeEdge Node Deployment, Measure time for application comes into Running state", func(b Benchmarker) { 512 runtime := b.Time("QUIC_MEASURE_PERF_NODETEST_NODES_100", func() { 513 var deploymentList v1.DeploymentList 514 podlist = metav1.PodList{} 515 replica := 100 516 //Generate the random string and assign as a UID 517 UID = "edgecore-app-" + utils.GetRandomString(5) 518 IsAppDeployed := utils.HandleDeployment(false, false, http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler, UID, ctx.Cfg.AppImageUrl[1], "", "", replica) 519 Expect(IsAppDeployed).Should(BeTrue()) 520 err := utils.GetDeployments(&deploymentList, ctx.Cfg.K8SMasterForKubeEdge+DeploymentHandler) 521 Expect(err).To(BeNil()) 522 for _, deployment := range deploymentList.Items { 523 if deployment.Name == UID { 524 //label := nodeName 525 time.Sleep(2 * time.Second) 526 podlist, err = utils.GetPods(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, "") 527 Expect(err).To(BeNil()) 528 break 529 } 530 } 531 utils.CheckPodRunningState(ctx.Cfg.K8SMasterForKubeEdge+AppHandler, podlist) 532 }) 533 utils.Infof("Runtime stats: %+v", runtime) 534 }, 5) 535 }) 536 })