Skip to content

Commit

Permalink
Updated tacacs test (#123)
Browse files Browse the repository at this point in the history
Fixed #80 rebase failing newly introduced test from #106
  • Loading branch information
ycoheNvidia authored May 12, 2024
1 parent 9e6404c commit aa84129
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/hostcfgd/hostcfgd_tacacs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def mock_hostcfgd(self, test_data, config_name, op_path, sop_path):
hostcfgd.NSS_RADIUS_CONF_TEMPLATE = t_path + "/radius_nss.conf.j2"
hostcfgd.PAM_RADIUS_AUTH_CONF_TEMPLATE = t_path + "/pam_radius_auth.conf.j2"
hostcfgd.PAM_AUTH_CONF = op_path + "/common-auth-sonic"
hostcfgd.PAM_COMMON_SESS = op_path + "/common-session"
hostcfgd.NSS_TACPLUS_CONF = op_path + "/tacplus_nss.conf"
hostcfgd.NSS_RADIUS_CONF = op_path + "/radius_nss.conf"
hostcfgd.NSS_CONF = op_path + "/nsswitch.conf"
Expand All @@ -59,10 +60,6 @@ def mock_hostcfgd(self, test_data, config_name, op_path, sop_path):
hostcfgd.RADIUS_PAM_AUTH_CONF_DIR = op_path + "/"
hostcfgd.LDAP_CONF_TEMPLATE = t_path + "/ldap.conf.j2"
hostcfgd.LDAP_CONF = op_path + "/ldap.conf"
# hostcfgd.PAM_LDAP_CONF_TEMPLATE = t_path + "/pam_ldap.conf.j2"
# hostcfgd.PAM_LDAP_CONF = op_path + "/pam_ldap.conf"
# hostcfgd.NSS_LDAP_CONF_TEMPLATE = t_path + "/libnss-ldap.conf.j2"
# hostcfgd.NSS_LDAP_CONF = op_path + "/libnss-ldap.conf"

shutil.rmtree( op_path, ignore_errors=True)
os.mkdir( op_path)
Expand Down Expand Up @@ -237,4 +234,5 @@ def test_hostcfgd_delete_config_table(self, test_name, test_data):
mock.call(mocked_syslog.LOG_ERR, "['service', 'aaastatsd', 'stop'] - failed: return code - 1, output:\nNone"),
mock.call(mocked_syslog.LOG_INFO, "AAA Update: key: DEL, op: DEL, data: {}")
]
mocked_syslog.assert_has_calls(expected)
for expected_call in expected:
assert expected_call in mocked_syslog.mock_calls, f"Expected call {expected_call} not found"

0 comments on commit aa84129

Please sign in to comment.