Skip to content

Commit efdb18a

Browse files
Xichen96Xichen Lin
andauthored
[console] add printing err (#5535)
Signed-off-by: Xichen Lin <[email protected]> Co-authored-by: Xichen Lin <[email protected]>
1 parent 3212c2f commit efdb18a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/console/test_console_loopback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_console_loopback_echo(duthost, creds, target_line):
3838
client.sendline(text)
3939
assert_expect_text(client, text, target_line, timeout_sec)
4040
except Exception as e:
41-
pytest.fail("Not able to communicate DUT via reverse SSH")
41+
pytest.fail("Not able to communicate DUT via reverse SSH: {}".format(e))
4242

4343
@pytest.mark.parametrize("src_line,dst_line", [('17', '19'),
4444
('18', '20'),

tests/console/test_console_reversessh.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_console_reversessh_connectivity(duthost, creds, target_line):
3838
client.sendcontrol('a')
3939
client.sendcontrol('x')
4040
except Exception as e:
41-
pytest.fail("Not able to do reverse SSH to remote host via DUT")
41+
pytest.fail("Not able to do reverse SSH to remote host via DUT: {}".format(e))
4242

4343
pytest_assert(
4444
wait_until(10, 1, 0, check_target_line_status, duthost, target_line, "IDLE"),
@@ -69,13 +69,13 @@ def test_console_reversessh_force_interrupt(duthost, creds, target_line):
6969
check_target_line_status(duthost, target_line, "BUSY"),
7070
"Target line {} is idle while reverse SSH session is up".format(target_line))
7171
except Exception as e:
72-
pytest.fail("Not able to do reverse SSH to remote host via DUT")
72+
pytest.fail("Not able to do reverse SSH to remote host via DUT: {}".format(e))
7373

7474
try:
7575
# Force clear line from DUT
7676
duthost.shell('sudo sonic-clear line {}'.format(target_line))
7777
except Exception as e:
78-
pytest.fail("Not able to do clear line for DUT")
78+
pytest.fail("Not able to do clear line for DUT: {}".format(e))
7979

8080
# Check the session ended within 5s and the line state is idle
8181
pytest_assert(
@@ -85,7 +85,7 @@ def test_console_reversessh_force_interrupt(duthost, creds, target_line):
8585
try:
8686
client.expect("Picocom was killed")
8787
except Exception as e:
88-
pytest.fail("Console session not exit correctly: {}".format(str(e)))
88+
pytest.fail("Console session not exit correctly: {}".format(e))
8989

9090
def check_target_line_status(duthost, line, expect_status):
9191
console_facts = duthost.console_facts()['ansible_facts']['console_facts']

0 commit comments

Comments
 (0)