test_krb5_common.c revision 167b05b28d6b969230973646bee2f1c1f49205d2
/*
SSSD
krb5_common - Test for some krb5 utility functions
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2016 Red Hat
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 <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <popt.h>
#include <stdbool.h>
#include "tests/cmocka/common_mock.h"
#include "src/providers/krb5/krb5_common.h"
#define TEST_REALM "MY.REALM"
#define TEST_FAST_STR "dummy"
#define TEST_LIFE_STR "dummy-life"
#define TEST_RLIFE_STR "dummy-rlife"
#define TEST_CONF_DB "test_krb5_common_conf.ldb"
#define TEST_DOM_NAME "test.krb5.common"
#define TEST_ID_PROVIDER "ldap"
struct test_ctx {
struct sss_test_ctx *tctx;
};
static int test_setup(void **state)
{
return 0;
}
static int test_teardown(void **state)
{
return 0;
}
void test_set_extra_args(void **state)
{
int ret;
char *uid_opt;
char *gid_opt;
const char **krb5_child_extra_args;
krb5_ctx->canonicalize = true;
/* --fast-principal will be only set if FAST is used */
"--fast-principal=" TEST_FAST_PRINC);
"--renewable-lifetime=" TEST_RLIFE_STR);
"--fast-principal=" TEST_FAST_PRINC);
}
void test_sss_krb5_check_options(void **state)
{
int ret;
/* check check_lifetime() indirectly */
/* check canonicalize */
}
{
int rv;
int no_cleanup = 0;
int opt;
struct poptOption long_options[] = {
_("Do not delete the test database after a test run"), NULL },
};
const struct CMUnitTest tests[] = {
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch (opt) {
default:
return 1;
}
}
if (rv == 0 && !no_cleanup) {
}
return rv;
}