Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify test_ro_user_allowed_command and `test_ro_user_banned_command to check common SONiC CLI commands #3016

Merged
merged 2 commits into from
Feb 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/tacacs/test_ro_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ 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'
]
# 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 lldp table'
]

for command in commands_direct + commands_indirect:
Expand All @@ -105,6 +111,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'
arlakshm marked this conversation as resolved.
Show resolved Hide resolved
]

for command in commands:
Expand Down