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

tedge reconnect command #1656

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

cmosd
Copy link
Contributor

@cmosd cmosd commented Dec 20, 2022

Proposed changes

Added a new command to tedge - tedge reconnect {cloud}. This command
simply combines tedge disconnect and tedge connect.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@reubenmiller
Copy link
Contributor

How to test

*** Test Cases ***

Reconnect when not already connected
    ${DEVICE_SN}           Setup
    Device Should Exist    ${DEVICE_SN}
    Execute Command        tedge discconnect c8y
    Execute Command        tedge connect c8y --test    exp_exit_code=1
    Execute Command        tedge reconnect c8y
    Execute Command        tedge reconnect c8y        # Try reconnect after already connected
    Execute Command        tedge connect c8y --test


Reconnect unknown mapper
    Setup              skip_bootstrap=True
    Execute Command    tedge reconnect test    exp_exit_code=2


Reconnect unconfigured azure mapper
    Setup              skip_bootstrap=True
    Execute Command    tedge reconnect az    exp_exit_code=1

@reubenmiller
Copy link
Contributor

LGTM but I will let a rust person approve it

crates/core/tedge/src/cli/reconnect/cli.rs Outdated Show resolved Hide resolved
crates/core/tedge/src/cli/reconnect/cli.rs Outdated Show resolved Hide resolved
@cmosd cmosd force-pushed the feature/1638/tedge-reconnect-command branch from 9e7c9a6 to afae1c9 Compare December 21, 2022 12:31
alexandru solomes and others added 2 commits December 21, 2022 12:44
The same implementation of the `Cloud` enum was found across commands.
This commit puts this code in a common place.

Signed-off-by: alexandru solomes <solo@softwareag.com>
Added a new command to tedge - `tedge reconnect {cloud}`. This command
simply combines `tedge disconnect` and `tedge connect`.

Signed-off-by: alexandru solomes <solo@softwareag.com>
@cmosd cmosd force-pushed the feature/1638/tedge-reconnect-command branch from afae1c9 to 92896d0 Compare December 21, 2022 12:48
@cmosd cmosd merged commit d7d4290 into thin-edge:main Dec 21, 2022
@cmosd cmosd deleted the feature/1638/tedge-reconnect-command branch December 21, 2022 13:08
Copy link
Contributor

@PradeepKiruvale PradeepKiruvale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

None yet

4 participants