/*
Authors:
Pavel Reichl <preichl@redhat.com>
Copyright (C) 2015 Red Hat
SSSD tests - sdap access
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdlib.h>
#include <stddef.h>
#include <setjmp.h>
#include <unistd.h>
#include <cmocka.h>
#include <ldb.h>
#include "tests/common_check.h"
#include "tests/cmocka/test_expire_common.h"
#include "tests/cmocka/test_sdap_access.h"
/* linking against function from sdap_access.c module */
extern bool nds_check_expired(const char *exp_time_str);
{
}
{
bool res;
/* changing time zone has no effect as time of expiration is in UTC */
(void*)&res);
(void*)&res);
}
{
/* Setup empty user entry (with 0 entries for rhost) */
user_no_rhost->num_elements = 0;
/* Setup user entry with allow somehost */
"somehost");
/* Setup user entry with deny somehost */
"!somehost");
/* Setup user entry with allow all */
"*");
/* Setup user entry with allow all and deny somehost */
"*");
"!somehost");
/* Setup user entry with allow all, allow somehost and deny somehost */
"*");
"!somehost");
"somehost");
/* Setup test context */
return 0;
}
{
return 0;
}
{
/* Test both arguments as NULL */
/* Test with user_entry == NULL and rhost == "somehost" */
/* Test with user_no_rhost and rhost == NULL */
/* Test with user_no_rhost and rhost == "" (local access) */
/* Test with user_no_rhost and rhost == "somehost" */
/* Test with user_allow_somehost and rhost == "somehost" */
/* Test with user_deny_somehost and rhost == "somehost" */
/* Test with user_allow_all and rhost == "somehost" */
/* Test with user_allow_all_deny_somehost and rhost == "somehost" */
/* Test with user_allow_all_allow_somehost_deny_somehost
* and rhost == "somehost" */
/* Test with user_no_rhost and rhost == "someotherhost" */
/* Test with user_allow_somehost and rhost == "someotherhost" */
/* Test with user_deny_somehost and rhost == "someotherhost" */
/* Test with user_allow_all and rhost == "someotherhost" */
/* Test with user_allow_all_deny_somehost and rhost == "someotherhost" */
/* Test with user_allow_all_allow_somehost_deny_somehost
* and rhost == "someotherhost" */
}
int main(void)
{
};
}