openyurt icon indicating copy to clipboard operation
openyurt copied to clipboard

[feature request] Add device synchronization e2e test for yurt-iot-dock

Open LavenderQAQ opened this issue 1 year ago • 6 comments

What would you like to be added: After the completion of the e2e of the iot system, we need to write the e2e test case for the yurt-iot-dock. We hope to test whether the yurt-iot-dock can synchronize the device related information of edgex.

  1. First, the current e2e test already creates PlatformAdmin, so you need to add yurt-iot-dock component.
apiVersion: iot.openyurt.io/v1alpha2
kind: PlatformAdmin
metadata:
  name: edgex-sample
spec:
  version: minnesota
  poolName: hangzhou
  components:
  - name: yurt-iot-dock
  1. Then check whether PlatformAdmin is still ready after deploying yurt-iot-dock, and check whether Device, DeviceProfile, and DeviceService are empty.

  2. Update PlatformAdmin again to add virtual devices and virtual device services.

apiVersion: iot.openyurt.io/v1alpha2
kind: PlatformAdmin
metadata:
  name: edgex-sample
spec:
  version: minnesota
  poolName: hangzhou
  components:
  - name: yurt-iot-dock
  - name: edgex-device-virtual
  - name: edgex-device-rest
  1. Check that PlatformAdmin is ready again.

  2. Then check whether the corresponding Device, DeviceProfile, and DeviceService are deployed.

$ kubectl get deviceservice
NAME                      NODEPOOL   SYNCED   AGE
hangzhou-device-virtual   hangzhou   true     2d1h

$ kubectl get device
NAME                                     NODEPOOL   SYNCED   AGE
hangzhou-random-binary-device            hangzhou   true     2d1h
hangzhou-random-boolean-device           hangzhou   true     2d1h
hangzhou-random-float-device             hangzhou   true     2d1h
hangzhou-random-integer-device           hangzhou   true     2d1h
hangzhou-random-unsignedinteger-device   hangzhou   true     2d1h

$ kubectl get deviceprofile
NAME                                     NODEPOOL   SYNCED   AGE
hangzhou-random-binary-device            hangzhou   true     2d1h
hangzhou-random-boolean-device           hangzhou   true     2d1h
hangzhou-random-float-device             hangzhou   true     2d1h
hangzhou-random-integer-device           hangzhou   true     2d1h
hangzhou-random-unsignedinteger-device   hangzhou   true     2d1h

As an easy way, you can directly determine if none of the three CR quantities are zero.

Reference for more details on iot: https://openyurt.io/zh/docs/next/user-manuals/iot/edgex-foundry

Why is this needed: Improve e2e testing for iot.

others /kind feature

LavenderQAQ avatar Nov 15 '23 01:11 LavenderQAQ

I want to help with this issue

NewKeyTo avatar Nov 23 '23 07:11 NewKeyTo

/assign @NewKeyTo

LavenderQAQ avatar Nov 23 '23 07:11 LavenderQAQ

@NewKeyTo Please wait for pr #1750 to be merged.

LavenderQAQ avatar Nov 23 '23 07:11 LavenderQAQ

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 21 '24 23:02 stale[bot]

/reopen

LavenderQAQ avatar Feb 23 '24 03:02 LavenderQAQ

@NewKeyTo This issue can begin to be resolved, #1750 has been merged.

LavenderQAQ avatar Feb 23 '24 03:02 LavenderQAQ

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 23 '24 09:05 stale[bot]