Skip to content

Commit aa84129

Browse files
authored
Updated tacacs test (#123)
Fixed sonic-net/sonic-host-services#80 rebase failing newly introduced test from sonic-net/sonic-host-services#106
1 parent 9e6404c commit aa84129

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/hostcfgd/hostcfgd_tacacs_test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def mock_hostcfgd(self, test_data, config_name, op_path, sop_path):
5151
hostcfgd.NSS_RADIUS_CONF_TEMPLATE = t_path + "/radius_nss.conf.j2"
5252
hostcfgd.PAM_RADIUS_AUTH_CONF_TEMPLATE = t_path + "/pam_radius_auth.conf.j2"
5353
hostcfgd.PAM_AUTH_CONF = op_path + "/common-auth-sonic"
54+
hostcfgd.PAM_COMMON_SESS = op_path + "/common-session"
5455
hostcfgd.NSS_TACPLUS_CONF = op_path + "/tacplus_nss.conf"
5556
hostcfgd.NSS_RADIUS_CONF = op_path + "/radius_nss.conf"
5657
hostcfgd.NSS_CONF = op_path + "/nsswitch.conf"
@@ -59,10 +60,6 @@ def mock_hostcfgd(self, test_data, config_name, op_path, sop_path):
5960
hostcfgd.RADIUS_PAM_AUTH_CONF_DIR = op_path + "/"
6061
hostcfgd.LDAP_CONF_TEMPLATE = t_path + "/ldap.conf.j2"
6162
hostcfgd.LDAP_CONF = op_path + "/ldap.conf"
62-
# hostcfgd.PAM_LDAP_CONF_TEMPLATE = t_path + "/pam_ldap.conf.j2"
63-
# hostcfgd.PAM_LDAP_CONF = op_path + "/pam_ldap.conf"
64-
# hostcfgd.NSS_LDAP_CONF_TEMPLATE = t_path + "/libnss-ldap.conf.j2"
65-
# hostcfgd.NSS_LDAP_CONF = op_path + "/libnss-ldap.conf"
6663

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

0 commit comments

Comments
 (0)