diff options
| author | KubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com> | 2020-05-29 21:21:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 21:21:51 +0800 |
| commit | e3f32c332383793283b83402679c83bd9bfe3293 (patch) | |
| tree | f98c8b62c1a2f7ac24d4e34d3b102a754dd256b0 | |
| parent | Merge pull request #1747 from fisherxu/automated-cherry-pick-of-#1663-upstrea... (diff) | |
| parent | fix E2E_UPDATE_DEVICE_3 failure (diff) | |
| download | kubeedge-e3f32c332383793283b83402679c83bd9bfe3293.tar.gz | |
Merge pull request #1755 from fisherxu/automated-cherry-pick-of-#1709-upstream-release-1.3
Automated cherry pick of #1709: fix E2E_UPDATE_DEVICE_3 failure
| -rw-r--r-- | tests/e2e/deployment/device_crd_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/e2e/deployment/device_crd_test.go b/tests/e2e/deployment/device_crd_test.go index ea6dde62f..41a031d86 100644 --- a/tests/e2e/deployment/device_crd_test.go +++ b/tests/e2e/deployment/device_crd_test.go @@ -336,6 +336,14 @@ var _ = Describe("Device Management test in E2E scenario", func() { IsDeviceCreated, statusCode := utils.HandleDeviceInstance(http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "", "led") Expect(IsDeviceCreated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusCreated)) + + newLedDevice := utils.NewLedDeviceInstance(nodeName) + time.Sleep(2 * time.Second) + Eventually(func() bool { + _, err := utils.GetDevice(&deviceList, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, &newLedDevice) + return err == nil + }, "20s", "2s").Should(Equal(true), "Device creation is not finished!!") + IsDeviceUpdated, statusCode := utils.HandleDeviceInstance(http.MethodPatch, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "/"+utils.UpdatedLedDeviceInstance(nodeName).Name, "led") Expect(IsDeviceUpdated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusOK)) @@ -369,6 +377,14 @@ var _ = Describe("Device Management test in E2E scenario", func() { IsDeviceCreated, statusCode := utils.HandleDeviceInstance(http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "", "bluetooth") Expect(IsDeviceCreated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusCreated)) + + newBluetoothDevice := utils.NewBluetoothDeviceInstance(nodeName) + time.Sleep(2 * time.Second) + Eventually(func() bool { + _, err := utils.GetDevice(&deviceList, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, &newBluetoothDevice) + return err == nil + }, "20s", "2s").Should(Equal(true), "Device creation is not finished!!") + IsDeviceUpdated, statusCode := utils.HandleDeviceInstance(http.MethodPatch, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "/"+utils.UpdatedBluetoothDeviceInstance(nodeName).Name, "bluetooth") Expect(IsDeviceUpdated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusOK)) @@ -402,6 +418,14 @@ var _ = Describe("Device Management test in E2E scenario", func() { IsDeviceCreated, statusCode := utils.HandleDeviceInstance(http.MethodPost, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "", "modbus") Expect(IsDeviceCreated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusCreated)) + + newModbusDevice := utils.NewModbusDeviceInstance(nodeName) + time.Sleep(2 * time.Second) + Eventually(func() bool { + _, err := utils.GetDevice(&deviceList, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, &newModbusDevice) + return err == nil + }, "20s", "2s").Should(Equal(true), "Device creation is not finished!!") + IsDeviceUpdated, statusCode := utils.HandleDeviceInstance(http.MethodPatch, ctx.Cfg.K8SMasterForKubeEdge+DeviceInstanceHandler, nodeName, "/"+utils.UpdatedModbusDeviceInstance(nodeName).Name, "modbus") Expect(IsDeviceUpdated).Should(BeTrue()) Expect(statusCode).Should(Equal(http.StatusOK)) |
