Skip to content

[action] [PR:26522] [console] Accept updated picocom termination message#1330

Merged
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/26522
Jul 24, 2026
Merged

[action] [PR:26522] [console] Accept updated picocom termination message#1330
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/26522

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

Description of PR

Summary:

Update the reverse-SSH force-interrupt test for the console session behavior introduced by sonic-utilities PR 4658.

That change replaced the previous console session implementation and changed the successful termination output from Picocom was killed to Thanks for using picocom. The console line still returned to IDLE and the SSH process exited successfully, but the test failed because it only accepted the legacy message.

This PR accepts either termination message so the test remains compatible with images from before and after the sonic-utilities change. It also explicitly initializes the console client variable to satisfy static analysis.

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A
Failure type: compatibility with updated console termination output

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

  • Affected SONiC image on a physical c0 topology: 10 passed in the full console/test_console_reversessh.py module.
  • Static validation: Python syntax validation passed.

Approach

What is the motivation for this PR?

The force-interrupt test assumed one specific console termination message. After sonic-utilities PR 4658 changed the console session implementation, successful termination produced a different message and caused a false test failure.

How did you do it?

Use pexpect.expect_exact() with the legacy and current termination messages as alternatives. This preserves compatibility across image versions while still validating that the client observes a successful console-session termination message.

Explicitly initialize client before the session-creation block so static analysis can determine that the local variable is initialized.

How did you verify/test it?

Ran the complete console/test_console_reversessh.py module on a physical c0 topology with the affected SONiC image. All 10 cases passed, including test_console_reversessh_force_interrupt and all custom escape-character variants.

Any platform specific information?

None.

Supported testbed topology if it's a new test case?

N/A; this is not a new test case.

Documentation

N/A; test-only compatibility update.

Signed-off-by: Sonic Build Admin sonicbld@microsoft.com

### Description of PR

Summary:

Update the reverse-SSH force-interrupt test for the console session behavior introduced by [sonic-utilities PR 4658](sonic-net/sonic-utilities#4658).

That change replaced the previous console session implementation and changed the successful termination output from `Picocom was killed` to `Thanks for using picocom`. The console line still returned to `IDLE` and the SSH process exited successfully, but the test failed because it only accepted the legacy message.

This PR accepts either termination message so the test remains compatible with images from before and after the sonic-utilities change. It also explicitly initializes the console client variable to satisfy static analysis.

Fixes # (issue)

### Type of change

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request

- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A
Failure type: compatibility with updated console termination output

### Tested branch

- [ ] master
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605
- [x] N/A

### Test result

- Affected SONiC image on a physical `c0` topology: `10 passed` in the full `console/test_console_reversessh.py` module.
- Static validation: Python syntax validation passed.

### Approach
#### What is the motivation for this PR?

The force-interrupt test assumed one specific console termination message. After sonic-utilities PR 4658 changed the console session implementation, successful termination produced a different message and caused a false test failure.

#### How did you do it?

Use `pexpect.expect_exact()` with the legacy and current termination messages as alternatives. This preserves compatibility across image versions while still validating that the client observes a successful console-session termination message.

Explicitly initialize `client` before the session-creation block so static analysis can determine that the local variable is initialized.

#### How did you verify/test it?

Ran the complete `console/test_console_reversessh.py` module on a physical `c0` topology with the affected SONiC image. All 10 cases passed, including `test_console_reversessh_force_interrupt` and all custom escape-character variants.

#### Any platform specific information?

None.

#### Supported testbed topology if it's a new test case?

N/A; this is not a new test case.

### Documentation

N/A; test-only compatibility update.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-mgmt#26522

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@mssonicbld
mssonicbld merged commit 8cfd8e3 into Azure:202603 Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant