/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2014 Red Hat
SSSD tests: Tests keytab utilities
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 <stdio.h>
#include <popt.h>
#include "util/sss_krb5.h"
#include "providers/krb5/krb5_common.h"
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_krb5.h"
struct keytab_test_ctx {
const char *keytab_file_name;
};
{
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
return 0;
}
{
int ret;
struct keytab_test_ctx);
assert_int_equal(ret, 0);
return 0;
}
{
char *mem_keytab_name;
struct keytab_test_ctx);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
&kent);
assert_int_not_equal(kerr, 0);
&kent);
assert_int_equal(kerr, 0);
&kent);
assert_int_equal(kerr, 0);
&kent);
assert_int_equal(kerr, 0);
&kent);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
}
{
struct keytab_test_ctx);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
/* no need to remove EMPTY_KEYTAB_PATH because krb5_kt_close() does not
* create empty keytab files */
}
{
return false;
}
return true;
}
{
char *mem_keytab_name;
struct keytab_test_ctx);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
&cursor)) == 0) {
&mem_cursor);
assert_int_equal(kerr_mem, 0);
}
&mem_cursor);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
assert_int_equal(kerr, 0);
}
{
int opt;
int rv;
};
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* Even though normally the tests should clean up after themselves
* they might not after a failed run. Remove the old db to be sure */
return rv;
}