Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cloud2edge setup script for integration testing #127

Merged
merged 40 commits into from
Nov 29, 2022

Conversation

nzhechev-bosch
Copy link
Contributor

@nzhechev-bosch nzhechev-bosch commented Sep 13, 2022

[#126] Add cloud2edge setup script for integration testing

Signed-off-by: Nikola Zhechev [email protected]

@konstantina-gramatova konstantina-gramatova linked an issue Sep 13, 2022 that may be closed by this pull request
@e-grigorov e-grigorov changed the title [#126] Added cloud2edge setup script for integration testing Added cloud2edge setup script for integration testing Oct 28, 2022
integration/c2esetup/go.mod Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
integration/c2esetup/main.go Outdated Show resolved Hide resolved
nzhechev-bosch and others added 16 commits November 25, 2022 15:49
Generate a random device ID on setup
Read thing ID from MQTT on cleanup
Restart suite-connector on setup and cleanup
Keep a backup for suite-connector/config.json on setup and restore it on cleanup
Delete dependent things on clean-up

Signed-off-by: Dimiter Georgiev <[email protected]>
and instead get the policy ID on the command line

Signed-off-by: Dimiter Georgiev <[email protected]>
- Rename Hono environment variables to DeviceRegistryApi
- Rename Ditto environment variables to DigitalTwinApi
- Improved help output
- Improved debug output
- Changed command line flags - deviceID becomes device, policyID becomes policy - to match tenant. cleanup becomes clean
- Refactored code according to code review feedback
- Suite Connector's configuration is restored and the service restarted before deleting devices and things
- Devices and things are now properly deleted in reversed order of creation
- No longer requiring the tenant param on performing clean
- Improved automatic discovery of related things and devices by looking at Hono JSON data instead of checking a name prefix
Signed-off-by: Dimiter Georgiev <[email protected]>
- Preserve the file mode of suite-connector's configuration file
- Improve error handling on file saving
Signed-off-by: Dimiter Georgiev <[email protected]>
- Use the supplied deviceId and tenancyId, if both are present. Otherwise, if one is missing, read both of them from the local MQTT
- Abort the setup procedure if the device with the current deviceId already exists in the device registry (Hono)
- Check if the device was created in the registry, after creating all reasources
Signed-off-by: Dimiter Georgiev <[email protected]>
…ion backup parameters optional

Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
- corrected go module name to github.com/eclipse-kanto/kanto/integration/c2esetup
- corrected command line parameters to match suite-connector configuration names as per https://websites.eclipseprojects.io/kanto/docs/references/connectivity/suite-connector-config/
Signed-off-by: Dimiter Georgiev <[email protected]>
Dimiter Georgiev added 4 commits November 25, 2022 15:49
Dimiter Georgiev added 2 commits November 25, 2022 15:51
Signed-off-by: Dimiter Georgiev <[email protected]>
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
integration/c2e-setup/main.go Outdated Show resolved Hide resolved
Dimiter Georgiev added 2 commits November 28, 2022 13:27
- Rearrange the global variables to match the suite-connector configuration structure.
- Remove unused global variables.
- Remove empty string defaults for environment variables.
- Renamed certFile to caCert, to match the suite-connector configuration structure.
- Renamed devicePass to password, to match the suite-connector configuration structure.
- Disconnect the MQTT client when done with it.
- Improved error printing.
- Improved verification of created device in the device registry.
- Use bool ok instead of int code for passing success/failure between function calls.
- Don't exit the process from a function call outside of main().
- Delete the already created backup file when an error occurs, in all cases.
- Imrpoved handling of file mode on file copy.
- Stop using the deprecated ioutil package in favor of equivalent calls from the package os.
- Minor refactoring and vairable renaming based on code review comments.
Signed-off-by: Dimiter Georgiev <[email protected]>
- Only check if there's any response for the device existence safety check.
- Stop validating the device creation if the REST API is successful.
Signed-off-by: Dimiter Georgiev <[email protected]>
- Use cfg.MqttQuiesceMs instead of a hardcoded value.
Signed-off-by: Dimiter Georgiev <[email protected]>
Dimiter Georgiev added 2 commits November 29, 2022 10:20
- Change the initial capacity of a slice to 3, down from 4, because we're only appending 3 times to it.
Signed-off-by: Dimiter Georgiev <[email protected]>
- Remove a redundant if statement.
Signed-off-by: Dimiter Georgiev <[email protected]>
NOTICE.md Outdated Show resolved Hide resolved
Dimiter Georgiev added 8 commits November 29, 2022 13:01
- Add failure checks and propagation on cleanup.
- Add dependencies to NOTICE.md.
Signed-off-by: Dimiter Georgiev <[email protected]>
- Slight refactoring.
- Re-arrange and touch-up NOTICE.md.
Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
Signed-off-by: Dimiter Georgiev <[email protected]>
@e-grigorov e-grigorov merged commit fbcab1f into eclipse-kanto:main Nov 29, 2022
@e-grigorov e-grigorov deleted the c2esetup branch November 29, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cloud2edge setup script for integration testing
4 participants