Skip to content

Conversation

inaba-vdom-0
Copy link
Contributor

This pull request includes the following updates:

test unit result

(netmiko-py3.12) user@host:~/xxxx/netmiko$ py.test tests/unit/
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0
rootdir: /xxxx/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1, cov-4.1.0
collected 89 items                                                             

tests/unit/test_base_connection.py ................................      [ 35%]
tests/unit/test_clitools_helpers.py ..........                           [ 47%]
tests/unit/test_clitools_outputters.py ...                               [ 50%]
tests/unit/test_connection.py ....                                       [ 55%]
tests/unit/test_encryption_hanlding.py ....                              [ 59%]
tests/unit/test_entry_points.py .                                        [ 60%]
tests/unit/test_ssh_autodetect.py .                                      [ 61%]
tests/unit/test_utilities.py ..................................          [100%]

=============================== warnings summary ===============================
tests/unit/test_utilities.py::test_ntc_templates_discovery
tests/unit/test_utilities.py::test_ntc_templates_discovery
  /xxxx/netmiko/netmiko/utilities.py:323: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with pkg_resources.path(

tests/unit/test_utilities.py: 80 warnings
  /xxxx/netmiko/.venv/lib/python3.12/site-packages/ttp/ttp.py:152: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
    key.s: assignment.value.values[index].s

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================= 89 passed, 82 warnings in 20.13s =======================

test_netmiko result

vthunder-1

  • test_devices.yml
a10_ssh:
  device_type: a10_ssh
  ip: 192.168.1.121
  username: admin
  password: admin
  • commands.yml
a10_ssh:
  version: "show version"
  config_mode_command: "configure terminal"
  basic: "show ip interfaces"
  wide_command: "show domain-list aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  extended_output: "show version"
  config:
    - "logging buffered 10000"
    - "logging console disable"
    - "logging buffered 20000"
  config_verification: "show running-config"
  config_file: "./etc/a10_ssh_commands1.txt"
  • responses.yml
a10_ssh:
  base_prompt: vthunder-1
  router_prompt : vthunder-1>
  enable_prompt: vthunder-1#
  interface_ip: 192.168.1.121
  version_banner: "Thunder Series"
  multiple_line_output: "64-bit Advanced Core OS (ACOS) version"
  file_check_cmd: "10.0.0.1 255.255.255.0"
  save_config: '[OK]'
  • a10_ssh_commands1.txt
interface ethernet 2
  ip address 10.0.0.1 255.255.255.0
(netmiko-py3.12) user@host:~/xxxx/netmiko/tests$ py.test -v test_netmiko_show.py --test_device a10_ssh
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0 -- /xxxx/netmiko/.venv/bin/python
cachedir: .pytest_cache
rootdir: /xxxx/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1, cov-4.1.0
collected 25 items                                                             

test_netmiko_show.py::test_failed_key SKIPPED (Not using SSH-keys)       [  4%]
test_netmiko_show.py::test_disable_paging PASSED                         [  8%]
test_netmiko_show.py::test_terminal_width PASSED                         [ 12%]
test_netmiko_show.py::test_ssh_connect PASSED                            [ 16%]
test_netmiko_show.py::test_ssh_connect_cm PASSED                         [ 20%]
test_netmiko_show.py::test_send_command_timing PASSED                    [ 24%]
test_netmiko_show.py::test_send_command_timing_no_cmd_verify SKIPPED     [ 28%]
test_netmiko_show.py::test_send_command PASSED                           [ 32%]
test_netmiko_show.py::test_send_command_no_cmd_verify SKIPPED            [ 36%]
test_netmiko_show.py::test_complete_on_space_disabled SKIPPED            [ 40%]
test_netmiko_show.py::test_send_command_textfsm SKIPPED (TextFSM/ntc...) [ 44%]
test_netmiko_show.py::test_send_command_ttp SKIPPED (TTP template no...) [ 48%]
test_netmiko_show.py::test_send_command_genie SKIPPED (Genie not sup...) [ 52%]
test_netmiko_show.py::test_send_multiline_timing SKIPPED                 [ 56%]
test_netmiko_show.py::test_send_multiline SKIPPED                        [ 60%]
test_netmiko_show.py::test_send_multiline_prompt SKIPPED                 [ 64%]
test_netmiko_show.py::test_send_multiline_simple SKIPPED                 [ 68%]
test_netmiko_show.py::test_base_prompt PASSED                            [ 72%]
test_netmiko_show.py::test_strip_prompt PASSED                           [ 76%]
test_netmiko_show.py::test_strip_command PASSED                          [ 80%]
test_netmiko_show.py::test_normalize_linefeeds PASSED                    [ 84%]
test_netmiko_show.py::test_clear_buffer PASSED                           [ 88%]
test_netmiko_show.py::test_enable_mode PASSED                            [ 92%]
test_netmiko_show.py::test_disconnect PASSED                             [ 96%]
test_netmiko_show.py::test_disconnect_no_enable SKIPPED                  [100%]

=========================== short test summary info ============================
SKIPPED [1] test_netmiko_show.py:25: Not using SSH-keys
SKIPPED [1] test_netmiko_show.py:87: Skipped
SKIPPED [1] test_netmiko_show.py:105: Skipped
SKIPPED [1] test_netmiko_show.py:127: Skipped
SKIPPED [1] test_netmiko_show.py:148: TextFSM/ntc-templates not supported on this platform
SKIPPED [1] test_netmiko_show.py:170: TTP template not existing for this platform
SKIPPED [1] test_netmiko_show.py:210: Genie not supported on this platform
SKIPPED [1] test_netmiko_show.py:230: Skipped
SKIPPED [1] test_netmiko_show.py:246: Skipped
SKIPPED [1] test_netmiko_show.py:271: Skipped
SKIPPED [1] test_netmiko_show.py:295: Skipped
SKIPPED [1] test_netmiko_show.py:400: Skipped
======================= 13 passed, 12 skipped in 27.65s ========================
(netmiko-py3.12) user@host:~/xxxx/netmiko/tests$ py.test -v test_netmiko_config.py --test_device a10_ssh
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0 -- /xxxx/netmiko/.venv/bin/python
cachedir: .pytest_cache
rootdir: /xxxx/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1, cov-4.1.0
collected 13 items                                                             

test_netmiko_config.py::test_ssh_connect PASSED                          [  7%]
test_netmiko_config.py::test_enable_mode PASSED                          [ 15%]
test_netmiko_config.py::test_config_mode PASSED                          [ 23%]
test_netmiko_config.py::test_exit_config_mode PASSED                     [ 30%]
test_netmiko_config.py::test_config_set PASSED                           [ 38%]
test_netmiko_config.py::test_config_set_generator PASSED                 [ 46%]
test_netmiko_config.py::test_config_set_longcommand PASSED               [ 53%]
test_netmiko_config.py::test_config_hostname PASSED                      [ 61%]
test_netmiko_config.py::test_config_from_file PASSED                     [ 69%]
test_netmiko_config.py::test_config_error_pattern SKIPPED (No error_...) [ 76%]
test_netmiko_config.py::test_banner SKIPPED (No banner defined.)         [ 84%]
test_netmiko_config.py::test_global_cmd_verify SKIPPED (No banner de...) [ 92%]
test_netmiko_config.py::test_disconnect PASSED                           [100%]

=========================== short test summary info ============================
SKIPPED [1] test_netmiko_config.py:175: No error_pattern defined.
SKIPPED [1] test_netmiko_config.py:209: No banner defined.
SKIPPED [1] test_netmiko_config.py:242: No banner defined.
=================== 10 passed, 3 skipped in 62.70s (0:01:02) ===================

vthunder-2(no licese, configured enable password)

  • test_devices.yml
a10_ssh:
  device_type: a10_ssh
  ip: 192.168.1.122
  username: admin
  password: admin
  secret: admin
  • commands.yml
a10_ssh:
  version: "show version"
  config_mode_command: "configure terminal"
  basic: "show ip interfaces"
  wide_command: "show domain-list aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  extended_output: "show version"
  config:
    - "logging buffered 10000"
    - "logging console disable"
    - "logging buffered 20000"
  config_verification: "show running-config"
  config_file: "./etc/a10_ssh_commands2.txt"
  • responses.yml
a10_ssh:
  base_prompt: vthunder-2
  router_prompt : vthunder-2(NOLICENSE)>
  enable_prompt: vthunder-2(NOLICENSE)#
  interface_ip: 192.168.1.122
  version_banner: "Thunder Series"
  multiple_line_output: "64-bit Advanced Core OS (ACOS) version"
  file_check_cmd: "10.0.0.2 255.255.255.0"
  save_config: '[OK]'
  • a10_ssh_commands2.txt
interface ethernet 2
  ip address 10.0.0.2 255.255.255.0
(netmiko-py3.12) user@host:~/xxxx/netmiko/tests$ py.test -v test_netmiko_show.py --test_device a10_ssh
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0 -- /xxxx/netmiko/.venv/bin/python
cachedir: .pytest_cache
rootdir: /xxxx/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1, cov-4.1.0
collected 25 items                                                             

test_netmiko_show.py::test_failed_key SKIPPED (Not using SSH-keys)       [  4%]
test_netmiko_show.py::test_disable_paging PASSED                         [  8%]
test_netmiko_show.py::test_terminal_width PASSED                         [ 12%]
test_netmiko_show.py::test_ssh_connect PASSED                            [ 16%]
test_netmiko_show.py::test_ssh_connect_cm PASSED                         [ 20%]
test_netmiko_show.py::test_send_command_timing PASSED                    [ 24%]
test_netmiko_show.py::test_send_command_timing_no_cmd_verify SKIPPED     [ 28%]
test_netmiko_show.py::test_send_command PASSED                           [ 32%]
test_netmiko_show.py::test_send_command_no_cmd_verify SKIPPED            [ 36%]
test_netmiko_show.py::test_complete_on_space_disabled SKIPPED            [ 40%]
test_netmiko_show.py::test_send_command_textfsm SKIPPED (TextFSM/ntc...) [ 44%]
test_netmiko_show.py::test_send_command_ttp SKIPPED (TTP template no...) [ 48%]
test_netmiko_show.py::test_send_command_genie SKIPPED (Genie not sup...) [ 52%]
test_netmiko_show.py::test_send_multiline_timing SKIPPED                 [ 56%]
test_netmiko_show.py::test_send_multiline SKIPPED                        [ 60%]
test_netmiko_show.py::test_send_multiline_prompt SKIPPED                 [ 64%]
test_netmiko_show.py::test_send_multiline_simple SKIPPED                 [ 68%]
test_netmiko_show.py::test_base_prompt PASSED                            [ 72%]
test_netmiko_show.py::test_strip_prompt PASSED                           [ 76%]
test_netmiko_show.py::test_strip_command PASSED                          [ 80%]
test_netmiko_show.py::test_normalize_linefeeds PASSED                    [ 84%]
test_netmiko_show.py::test_clear_buffer PASSED                           [ 88%]
test_netmiko_show.py::test_enable_mode PASSED                            [ 92%]
test_netmiko_show.py::test_disconnect PASSED                             [ 96%]
test_netmiko_show.py::test_disconnect_no_enable SKIPPED                  [100%]

=========================== short test summary info ============================
SKIPPED [1] test_netmiko_show.py:25: Not using SSH-keys
SKIPPED [1] test_netmiko_show.py:87: Skipped
SKIPPED [1] test_netmiko_show.py:105: Skipped
SKIPPED [1] test_netmiko_show.py:127: Skipped
SKIPPED [1] test_netmiko_show.py:148: TextFSM/ntc-templates not supported on this platform
SKIPPED [1] test_netmiko_show.py:170: TTP template not existing for this platform
SKIPPED [1] test_netmiko_show.py:210: Genie not supported on this platform
SKIPPED [1] test_netmiko_show.py:230: Skipped
SKIPPED [1] test_netmiko_show.py:246: Skipped
SKIPPED [1] test_netmiko_show.py:271: Skipped
SKIPPED [1] test_netmiko_show.py:295: Skipped
SKIPPED [1] test_netmiko_show.py:400: Skipped
======================= 13 passed, 12 skipped in 27.52s ========================
(netmiko-py3.12) user@host:~/xxxx/netmiko/tests$ py.test -v test_netmiko_config.py --test_device a10_ssh
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0 -- /xxxx/netmiko/.venv/bin/python
cachedir: .pytest_cache
rootdir: /xxxx/netmiko
configfile: setup.cfg
plugins: pylama-8.4.1, cov-4.1.0
collected 13 items                                                             

test_netmiko_config.py::test_ssh_connect PASSED                          [  7%]
test_netmiko_config.py::test_enable_mode PASSED                          [ 15%]
test_netmiko_config.py::test_config_mode PASSED                          [ 23%]
test_netmiko_config.py::test_exit_config_mode PASSED                     [ 30%]
test_netmiko_config.py::test_config_set PASSED                           [ 38%]
test_netmiko_config.py::test_config_set_generator PASSED                 [ 46%]
test_netmiko_config.py::test_config_set_longcommand PASSED               [ 53%]
test_netmiko_config.py::test_config_hostname PASSED                      [ 61%]
test_netmiko_config.py::test_config_from_file PASSED                     [ 69%]
test_netmiko_config.py::test_config_error_pattern SKIPPED (No error_...) [ 76%]
test_netmiko_config.py::test_banner SKIPPED (No banner defined.)         [ 84%]
test_netmiko_config.py::test_global_cmd_verify SKIPPED (No banner de...) [ 92%]
test_netmiko_config.py::test_disconnect PASSED                           [100%]

=========================== short test summary info ============================
SKIPPED [1] test_netmiko_config.py:175: No error_pattern defined.
SKIPPED [1] test_netmiko_config.py:209: No banner defined.
SKIPPED [1] test_netmiko_config.py:242: No banner defined.
=================== 10 passed, 3 skipped in 62.61s (0:01:02) ===================

@ktbyers
Copy link
Owner

ktbyers commented Jul 21, 2025

@inaba-vdom-0 I will try to review this some time this week.

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.

A10 driver cannot go to config mode due to check_config_mode()

2 participants