diff --git a/tests/common/plugins/tacacs.py b/tests/common/plugins/tacacs.py index 6f86912ec6b..4ccc5336b4d 100644 --- a/tests/common/plugins/tacacs.py +++ b/tests/common/plugins/tacacs.py @@ -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+") @@ -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")