test_expire_common.c revision 50b8a36b0932a510e825ed1ad8103f81ead2b7d8
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl Pavel Reichl <preichl@redhat.com>
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl Copyright (C) 2015 Red Hat
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl SSSD tests - common code for password expiration tests
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 char *now_str(TALLOC_CTX *mem_ctx, const char* format, int s)
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl exp_state = talloc(mem_ctx, struct expire_test_ctx);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl /* testing data */
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl invalid_format = now_str(exp_state, "%Y%m%d%H%M%S", -20);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl invalid_longer_format = (void*)now_str(exp_state, "%Y%m%d%H%M%SZA", -20);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl past_time = (void*)now_str(exp_state, "%Y%m%d%H%M%SZ", -20);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl future_time = (void*)now_str(exp_state, "%Y%m%d%H%M%SZ", 20);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl exp_state->invalid_longer_format = invalid_longer_format;
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl test_ctx = talloc_get_type(*state, struct expire_test_ctx);
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl void (*test_func)(void*, void*),
50b8a36b0932a510e825ed1ad8103f81ead2b7d8Pavel Reichl /* restore */