Skip to content
Closed
Changes from all commits
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
7 changes: 7 additions & 0 deletions tests/common/plugins/tacacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def configure_tacacs(ptfhost, duthost, creds, tacacs_server_ip):
duthost.shell("sudo config tacacs add %s" % tacacs_server_ip)
duthost.shell("sudo config tacacs authtype login")

if duthost.facts['asic_type'] == 'mellanox':
duthost.shell("sudo config tacacs add %s" % creds['tacacs_servers'][0])
duthost.shell("sudo config tacacs authtype pap")
duthost.shell("sudo useradd %s --password 123456" % creds['tacacs_ro_user'], module_ignore_errors=True)

# enable tacacs+
duthost.shell("sudo config aaa authentication login tacacs+")

Expand All @@ -40,6 +45,8 @@ def cleanup_tacacs(ptfhost, duthost, tacacs_server_ip):

# reset tacacs client configuration
duthost.shell("sudo config tacacs delete %s" % tacacs_server_ip)
if duthost.facts['asic_type'] == 'mellanox':
duthost.shell("sudo config tacacs delete %s" % creds['tacacs_servers'][0])
duthost.shell("sudo config tacacs default passkey")
duthost.shell("sudo config aaa authentication login default")
duthost.shell("sudo config aaa authentication failthrough default")
Expand Down