Skip to content

Commit

Permalink
Modify test_ro_user_allowed_command and `test_ro_user_banned_command …
Browse files Browse the repository at this point in the history
…to check common SONiC CLI commands (#3016)

Add the most commonly used CLI commands in the tests test_ro_user_allowed_command and test_ro_user_banned_command

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
  • Loading branch information
arlakshm authored Feb 24, 2021
1 parent 0e97bba commit 7e92609
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/tacacs/test_ro_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,20 @@ def test_ro_user_allowed_command(localhost, duthosts, rand_one_dut_hostname, cre
# 'sudo psuutil *',
# 'sudo sfputil show *',
'sudo ip netns identify 1',
'sudo ipintutil',
'sudo ipintutil -a ipv6',
'sudo ipintutil -n asic0 -d all',
'sudo ipintutil -n asic0 -d all -a ipv6'
]
# Run as readonly use the commands allowed indirectly based on sudoers file
commands_indirect = [
'show version',
'show interface status',
'show interface portchannel',
'show ip bgp summary',
'show ip interface',
'show ipv6 interface',
'show lldp table'
]

for command in commands_direct + commands_indirect:
Expand All @@ -105,6 +115,8 @@ def test_ro_user_banned_command(localhost, duthosts, rand_one_dut_hostname, cred
# Run as readonly use the commands allowed by sudoers file
commands = [
'sudo shutdown',
# all commands under the config tree
'sudo config'
]

for command in commands:
Expand Down

0 comments on commit 7e92609

Please sign in to comment.