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

[consutil] Fix consule CLI and enhance unittest #3360

Merged
merged 2 commits into from
Jun 9, 2024

Conversation

lizhijianrd
Copy link
Contributor

@lizhijianrd lizhijianrd commented Jun 7, 2024

ADO: 28201174

What I did

  1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True #2725, * cannot be treated as wildcard correctly).
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
  1. Enhance UT to avoid regression mentioned in 1.
  2. Fix incorrect statement in UT.
  3. Fix critical Flake8 error.

How I did it

How to verify it

  1. Verified on Nokia-7215 MC0 device.
  2. Verified by UT:
tests/console_test.py::TestConfigConsoleCommands::test_enable_console_switch PASSED                                   [ 15%]
tests/console_test.py::TestConfigConsoleCommands::test_enable_console_switch_yang_validation PASSED                   [ 15%]
tests/console_test.py::TestConfigConsoleCommands::test_disable_console_switch PASSED                                  [ 15%]
tests/console_test.py::TestConfigConsoleCommands::test_disable_console_switch_yang_validation PASSED                  [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_add_exists PASSED                                      [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_add_no_baud PASSED                                     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_add_name_conflict PASSED                               [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_add_success PASSED                                     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_add_yang_validation PASSED                             [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_del_non_exists PASSED                                  [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_del_success PASSED                                     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_console_del_yang_validation PASSED                             [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_non_exists PASSED            [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_conflict PASSED              [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_existing_and_same PASSED     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_reset PASSED                 [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_reset_yang_validation PASSED [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_success PASSED               [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_remote_device_name_yang_validation PASSED       [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_baud_no_change PASSED                           [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_baud_non_exists PASSED                          [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_baud_success PASSED                             [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_baud_yang_validation PASSED                     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_flow_control_no_change PASSED                   [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_flow_control_non_exists PASSED                  [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_flow_control_success PASSED                     [ 16%]
tests/console_test.py::TestConfigConsoleCommands::test_update_console_flow_control_yang_validation PASSED             [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_all_configured_only_empty PASSED               [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_all_configured_only_nonempty PASSED            [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_all_with_ttys PASSED                           [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_line_success PASSED                            [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_line_not_found PASSED                          [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_line_by_device_success PASSED                  [ 16%]
tests/console_test.py::TestConsutilLib::test_console_port_provider_get_line_by_device_not_found PASSED                [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_refresh_without_session PASSED                         [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_refresh_without_session_idle PASSED                    [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_refresh_with_session PASSED                            [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_refresh_with_session_line_mismatch PASSED              [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_refresh_with_session_process_ended PASSED              [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_connect_state_busy PASSED                              [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_connect_invalid_config PASSED                          [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_connect_device_busy PASSED                             [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_connect_connection_fail PASSED                         [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_connect_success PASSED                                 [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_clear_session_line_not_busy PASSED                     [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_clear_session_with_state_db PASSED                     [ 17%]
tests/console_test.py::TestConsutilLib::test_console_port_info_clear_session_with_existing_session PASSED             [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_init_device_prefix_plugin_nonexists PASSED             [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_init_device_prefix_plugin PASSED                       [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_list_console_ttys PASSED                               [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_list_console_ttys_device_not_exists PASSED             [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_list_active_console_processes PASSED                   [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_get_active_console_process_info_exists PASSED          [ 17%]
tests/console_test.py::TestConsutilLib::test_sys_info_provider_get_active_console_process_info_nonexists PASSED       [ 17%]
tests/console_test.py::TestConsutil::test_consutil_feature_disabled_null_config PASSED                                [ 17%]
tests/console_test.py::TestConsutil::test_consutil_feature_disabled_config PASSED                                     [ 17%]
tests/console_test.py::TestConsutil::test_consutil_feature_enabled PASSED                                             [ 17%]
tests/console_test.py::TestConsutilShow::test_show PASSED                                                             [ 17%]
tests/console_test.py::TestConsutilShow::test_show_stale_idle_to_busy PASSED                                          [ 17%]
tests/console_test.py::TestConsutilShow::test_show_stale_busy_to_idle PASSED                                          [ 17%]
tests/console_test.py::TestConsutilConnect::test_connect_target_nonexists PASSED                                      [ 17%]
tests/console_test.py::TestConsutilConnect::test_connect_line_busy PASSED                                             [ 17%]
tests/console_test.py::TestConsutilConnect::test_connect_no_baud PASSED                                               [ 18%]
tests/console_test.py::TestConsutilConnect::test_connect_picocom_err PASSED                                           [ 18%]
tests/console_test.py::TestConsutilConnect::test_connect_success PASSED                                               [ 18%]
tests/console_test.py::TestConsutilClear::test_clear_without_root PASSED                                              [ 18%]
tests/console_test.py::TestConsutilClear::test_clear_line_not_found PASSED                                            [ 18%]
tests/console_test.py::TestConsutilClear::test_clear_idle PASSED                                                      [ 18%]
tests/console_test.py::TestConsutilClear::test_clear_success PASSED                                                   [ 18%]

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@lizhijianrd lizhijianrd changed the title Fix consule CLI and enhance unittest [consutil] Fix consule CLI and enhance unittest Jun 7, 2024
Copy link
Contributor

@yutongzhang-microsoft yutongzhang-microsoft left a comment

Choose a reason for hiding this comment

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

LGTM

@lizhijianrd lizhijianrd merged commit f96a132 into sonic-net:master Jun 9, 2024
7 checks passed
@lizhijianrd
Copy link
Contributor Author

This is a bugfix PR for SONiC MC0.
@StormLiangMS Can you please help add tag for 202305 backport?
@yxieca Can you please help add tag for 202311 backport?
@bingwang-ms Can you please help add tag for 202405 backport?
Thanks!

@lizhijianrd lizhijianrd deleted the fix-consutil branch June 9, 2024 03:00
@StormLiangMS
Copy link
Contributor

hi @lizhijianrd could you update the ADO in the PR?

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Jun 11, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True sonic-net#2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #3362

mssonicbld pushed a commit that referenced this pull request Jun 11, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True #2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
@lizhijianrd
Copy link
Contributor Author

hi @lizhijianrd could you update the ADO in the PR?

ADO: 28201174
Updated in PR description.

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Jun 11, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True sonic-net#2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3364

mssonicbld pushed a commit that referenced this pull request Jun 12, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True #2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
arfeigin pushed a commit to arfeigin/sonic-utilities that referenced this pull request Jun 16, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True sonic-net#2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Jun 20, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True sonic-net#2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

6 similar comments
@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

@mssonicbld
Copy link
Collaborator

@lizhijianrd cherry pick PR didn't pass PR checker. Please check!!!
#3376

mssonicbld pushed a commit that referenced this pull request Jul 12, 2024
**What I did?**
1. Bugfix for console CLI (This is introduced by [consutil] replace shell=True #2725, * cannot be treated as wildcard correctly).
```
admin@sonic:~$ show line
ls: cannot access '/dev/C0-*': No such file or directory
```
2. Enhance UT to avoid regression mentioned in 1.
3. Fix incorrect statement in UT.
4. Fix critical Flake8 error.

**How to verify it**
1. Verified on Nokia-7215 MC0 device.
2. Verified by UT

Sign-Off By: Zhijian Li <[email protected]>
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.

8 participants