thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
221 stars 54 forks source link

Create an integration test for c8y-remote-access-plugin #2201

Closed Bravo555 closed 3 months ago

Bravo555 commented 1 year ago

When making a change to c8y-remote-access-plugin to remove webpki dependency in #2185, a regression was manually caught. To reproduce:

  1. feature tokio-rustls-native-certs was disabled which resulted in TLS support being disabled
  2. Modified c8y-remote-access-plugin replaced the original binary in /usr/bin/c8y-remote-access-plugin
  3. Initiate a remote connection from Cumulocity. Any parameters should trigger the error, but what I used was:
    • Protocol: SSH
    • Sign-in method: Username and password
    • Host: 127.0.0.1
    • Port: 22

Expected: Remote connection is successfully created, prompt is displayed and one can invoke commands.

Observed:

[c8y/s/us] 502,c8y_RemoteAccessConnect,"

Error:   × Connecting to Websocket
  ├─▶ URL error: TLS support not compiled in
  ╰─▶ TLS support not compiled in

"

This seems like it could be easily caught by an automated integration test, but no such test existed for c8y-remote-access-plugin, so it should be created.

The challenging portion is that remote connections are initiated by Cumulocity and the plugin needs to verify Cumulocity's TLS certificate.

reubenmiller commented 3 months ago

Add system tests has been added in https://github.com/thin-edge/thin-edge.io/pull/3006 to verify a successful connection to a device via the Cumulocity IoT Cloud Remote Access feature

gligorisaev commented 3 months ago

QA has thoroughly checked the feature and here are the results: