[console] route connect CLI through in-process console_connect helper part 2#4658
Merged
Merged
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
part 2 of 4531 Replace the last pexpect with os.execvp / bash session script to improve picocom performance Signed-off-by: hehuang <henry.1.huang@nokia.com>
hehuang-nokia
force-pushed
the
dev_c1_feature
branch
from
July 2, 2026 15:52
bff750f to
10756d0
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
hehuang-nokia
marked this pull request as ready for review
July 2, 2026 15:53
Collaborator
|
This PR has backport request for branch(es): 202603,202605. ---Powered by SONiC BuildBot
|
|
@lizhijianrd @yejianquan Please help review and merge |
lizhijianrd
approved these changes
Jul 16, 2026
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
lizhijianrd
enabled auto-merge (squash)
July 16, 2026 06:40
Collaborator
|
The label |
Collaborator
|
The label |
7 tasks
Collaborator
|
Cherry-pick PR to msft-202603: Azure/sonic-utilities.msft#412 |
nkanchi-nexthop
pushed a commit
to nexthop-ai/sonic-utilities
that referenced
this pull request
Jul 16, 2026
…sonic-net#4658) part 2 of 4531 Replace the last pexpect with os.execvp / bash session script to improve picocom performance Signed-off-by: hehuang <henry.1.huang@nokia.com> Signed-off-by: Nikhil Kanchi <nkanchi@nexthop.ai>
21 tasks
yejianquan
pushed a commit
to sonic-net/sonic-mgmt
that referenced
this pull request
Jul 24, 2026
### 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: Zhijian Li <zhijianli@microsoft.com>
Merged
21 tasks
mssonicbld
added a commit
to Azure/sonic-mgmt.msft
that referenced
this pull request
Jul 24, 2026
…age (#1330) ### 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
part 2 of 4531
Replace the last pexpect with os.execvp / bash session script to improve picocom performance
What I did
added the second part of the change to streamline the picocom launch process
How I did it
replaced the second pexpect call with execvp
How to verify it
first, launch console app just like before
then, use ps -ef to make sure "connect line" is no longer a standalone process
New command output (if the output of a command-line utility has changed)
connect line X or just reverse ssh
Which release branch to backport (provide reason below if selected)