50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl Pavel Reichl <preichl@redhat.com>
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl Copyright (C) 2015 Red Hat
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl SSSD tests - ldap auth
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl This program is free software; you can redistribute it and/or modify
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl it under the terms of the GNU General Public License as published by
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl the Free Software Foundation; either version 3 of the License, or
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl (at your option) any later version.
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl This program is distributed in the hope that it will be useful,
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl but WITHOUT ANY WARRANTY; without even the implied warranty of
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl GNU General Public License for more details.
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl You should have received a copy of the GNU General Public License
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl along with this program. If not, see <http://www.gnu.org/licenses/>.
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichlstatic void check_pwexpire_policy_wrap(void *in, void *_out)
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl struct check_pwexpire_policy_wrap_indata *data =
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl (struct check_pwexpire_policy_wrap_indata*) in;
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl ret = check_pwexpire_policy(data->type, data->time_fmt, NULL, 0);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl tc = talloc_get_type(*state, struct expire_test_ctx);
33e54a998f51558faaec82872a59723d2ceadb4fLukas Slebodnik assert_int_equal(ret, ERR_TIMESPEC_NOT_SUPPORTED);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl ret = check_pwexpire_policy(type, (void*) tc->invalid_format,
33e54a998f51558faaec82872a59723d2ceadb4fLukas Slebodnik assert_int_equal(ret, ERR_TIMESPEC_NOT_SUPPORTED);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl ret = check_pwexpire_policy(type, (void*) tc->past_time,
33e54a998f51558faaec82872a59723d2ceadb4fLukas Slebodnik assert_int_equal(ret, ERR_PASSWORD_EXPIRED);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl ret = check_pwexpire_policy(type, (void*) tc->future_time,
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl /* changing time zone has no effect as time of expiration is in UTC */
33e54a998f51558faaec82872a59723d2ceadb4fLukas Slebodnik assert_int_equal(ret, ERR_PASSWORD_EXPIRED);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl cmocka_unit_test_setup_teardown(test_pwexpire_krb,