diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py index fbe8d8b99..e793e3531 100644 --- a/netmiko/juniper/juniper.py +++ b/netmiko/juniper/juniper.py @@ -84,10 +84,14 @@ def check_config_mode( def config_mode( self, config_command: str = "configure", - pattern: str = r"Entering configuration mode", + pattern: str = r"(?s)Entering configuration mode.*\].*#", re_flags: int = 0, ) -> str: - """Enter configuration mode.""" + """ + Enter configuration mode. + + (?s) enables re.DOTALL in regex pattern. + """ return super().config_mode( config_command=config_command, pattern=pattern, re_flags=re_flags ) diff --git a/tests/SLOG/netmiko.log b/tests/SLOG/netmiko.log index bf64a8446..a74094652 100644 --- a/tests/SLOG/netmiko.log +++ b/tests/SLOG/netmiko.log @@ -16,6 +16,7 @@ write_channel: b'********\n' read_channel: read_channel: read_channel: +read_channel: cisco1# Pattern found: (cisco1) : cisco1 @@ -28,9 +29,10 @@ cisco1# read_channel: write_channel: b'\n' read_channel: -cisco1# -read_channel: read_channel: +cisco1# +Pattern found: ([>#]) +cisco1# write_channel: b'exit\n' write_channel: b'terminal width 511\n' read_channel: @@ -117,7 +119,8 @@ Pattern found: (show\ ip\ interface\ brief) show ip interface brief read_channel: write_channel: b'\n' read_channel: -cisco1> -read_channel: read_channel: +cisco1> +Pattern found: ([>#]) +cisco1> write_channel: b'exit\n' diff --git a/tests/run_live_tests.sh b/tests/run_live_tests.sh index a83b5ad7c..8e889fff9 100755 --- a/tests/run_live_tests.sh +++ b/tests/run_live_tests.sh @@ -22,6 +22,6 @@ cd .. cd test_juniper_junos ./test_juniper_junos.sh > ../test_out/test_juniper_junos.out 2> ../test_out/test_juniper_junos.stderr & -cd .. -cd test_cisco_asa -./test_cisco_asa.sh > ../test_out/test_cisco_asa.out 2> ../test_out/test_cisco_asa.stderr & +# cd .. +# cd test_cisco_asa +# ./test_cisco_asa.sh > ../test_out/test_cisco_asa.out 2> ../test_out/test_cisco_asa.stderr & diff --git a/tests/test_timeout_send_command_timing.py b/tests/test_timeout_send_command_timing.py index 134a0ee09..513679b3e 100644 --- a/tests/test_timeout_send_command_timing.py +++ b/tests/test_timeout_send_command_timing.py @@ -18,7 +18,7 @@ def test_read_show_tech(net_connect_newconn): read_timeout = 0 output, exec_time = execute_cmd( - net_connect_newconn, read_timeout=read_timeout, last_read=4.0 + net_connect_newconn, read_timeout=read_timeout, last_read=8.0 ) assert "show interface" in output assert "cisco3#" in output