From 229682094f737626ffd835d87277b68476009909 Mon Sep 17 00:00:00 2001 From: xumia Date: Fri, 14 Jan 2022 12:39:37 +0000 Subject: [PATCH 1/2] Add the show ip/ipv6 bgp test ro user commands --- tests/tacacs/test_ro_user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tacacs/test_ro_user.py b/tests/tacacs/test_ro_user.py index 32814ca8eb..b4afeee62e 100644 --- a/tests/tacacs/test_ro_user.py +++ b/tests/tacacs/test_ro_user.py @@ -121,8 +121,12 @@ def test_ro_user_allowed_command(localhost, duthosts, enum_rand_one_per_hwsku_ho "show interface status", "show interface portchannel", "show ip bgp summary", + "show ip bgp neighbors", + "show ip bgp network", "show ip interface", "show ipv6 interface", + "show ipv6 bgp neighbors", + "show ipv6 bgp network", "show lldp table", ], } From eeb66719be06cd2b74d0ebc4d41497303f5bd069 Mon Sep 17 00:00:00 2001 From: xumia Date: Sun, 16 Jan 2022 05:10:43 +0000 Subject: [PATCH 2/2] Fix rw permission failure not detected issue --- tests/tacacs/test_ro_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tacacs/test_ro_user.py b/tests/tacacs/test_ro_user.py index b4afeee62e..66fd66f56f 100644 --- a/tests/tacacs/test_ro_user.py +++ b/tests/tacacs/test_ro_user.py @@ -41,7 +41,7 @@ def ssh_remote_allow_run(localhost, remote_ip, username, password, cmd): res = ssh_remote_run(localhost, remote_ip, username, password, cmd) # Verify that the command is allowed logger.info("check command \"{}\" rc={}".format(cmd, res['rc'])) - expected = res['rc'] == 0 or (res['rc'] != 0 and "Make sure your account has RW permission to current device" not in res['stderr']) + expected = "Make sure your account has RW permission to current device" not in res['stderr'] if not expected: logger.error("error output=\"{}\"".format(res["stderr"])) return expected