test_krb5_wait_queue.c revision 01ec08efd0e166ac6f390f8627c6d08dcc63ccc4
/*
Copyright (C) 2015 Red Hat
SSSD tests: Kerberos wait queue tests
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 <talloc.h>
#include <tevent.h>
#include <errno.h>
#include <popt.h>
#include <stdlib.h>
#include <security/pam_modules.h>
#include "providers/krb5/krb5_common.h"
#include "providers/krb5/krb5_auth.h"
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_be.h"
struct krb5_mocked_auth_state {
const char *user;
int ret;
int pam_status;
int dp_err;
};
struct tevent_timer *tt,
void *pvt);
struct tevent_context *ev,
{
struct tevent_req *req;
struct krb5_mocked_auth_state *state;
struct tevent_timer *tt;
return NULL;
}
return NULL;
}
return req;
}
struct tevent_timer *tt,
void *pvt)
{
struct tevent_req *req;
struct krb5_mocked_auth_state *state;
} else {
}
}
int *_pam_status,
int *_dp_err)
{
struct krb5_mocked_auth_state *state;
if (_pam_status != NULL) {
}
}
return EOK;
}
struct test_krb5_wait_queue {
struct sss_test_ctx *tctx;
int num_auths;
int num_finished_auths;
};
static int test_krb5_wait_queue_setup(void **state)
{
struct test_krb5_wait_queue *test_ctx;
struct test_krb5_wait_queue);
return 0;
}
static int test_krb5_wait_queue_teardown(void **state)
{
struct test_krb5_wait_queue *test_ctx =
return 0;
}
const char *username,
int ret,
int pam_status,
int dp_err)
{
}
const char *username)
{
}
static void test_krb5_wait_queue_single(void **state)
{
struct tevent_req *req;
struct test_krb5_wait_queue *test_ctx =
}
{
struct test_krb5_wait_queue *test_ctx = \
int pam_status;
int dp_err;
}
static void test_krb5_wait_queue_multi(void **state)
{
int i;
struct tevent_req *req;
struct test_krb5_wait_queue *test_ctx =
}
}
{
struct test_krb5_wait_queue *test_ctx = \
int pam_status;
int dp_err;
}
}
static void test_krb5_wait_queue_fail_odd(void **state)
{
int i;
struct tevent_req *req;
struct test_krb5_wait_queue *test_ctx =
}
}
{
struct test_krb5_wait_queue *test_ctx = \
int pam_status;
int dp_err;
}
}
{
int opt;
struct poptOption long_options[] = {
};
const struct CMUnitTest tests[] = {
/* Run a single auth request */
/* Run multiple auth requests */
/* Make sure that all requests in queue run even if some fail */
};
/* 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 */
}