/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2014 Red Hat
SSSD tests: Common responder code 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 "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_resp.h"
/* register_cli_protocol_version is required in test since it links with
* responder_common.c module
*/
{
};
}
static void
struct tevent_immediate *imm,
void *pvt);
struct tevent_req *nreq)
{
return ENOMEM;
}
return EOK;
}
static void
struct tevent_immediate *imm,
void *pvt)
{
}
struct tevent_req *sidereq,
char **err_msg)
{
return EOK;
}
struct parse_inp_test_ctx {
};
{
int ret;
/* Testing the request race condition should be a special case */
/* sysdb_master_domain_update sets the view name, if we do not call it
* here we get a leak check warning when sysdb_master_domain_update is
* called later while processing the tests. */
*state = parse_inp_ctx;
return 0;
}
{
struct parse_inp_test_ctx);
return 0;
}
struct sss_domain_info *domains,
const char *default_domain,
struct sss_domain_info *domains,
const char *default_domain,
{
if (wtype == WRAP_CALL_REAL) {
}
return ret;
}
{
}
{
struct parse_inp_test_ctx);
}
{
struct parse_inp_test_ctx);
/* First call will indicate we need to go to DP */
/* The second one will succeed as the domains are up-to-date */
}
{
struct parse_inp_test_ctx);
/* simulate responder startup */
/* The first parse wouldn't be called, the second one will succeed
* as the domains are up-to-date */
}
{
}
{
struct parse_inp_test_ctx);
/* Simulate an error */
}
struct sss_nc_ctx {
};
struct sss_nc_ctx *dummy_ncache_ptr)
{
return EOK;
}
{
struct parse_inp_test_ctx);
}
{
struct parse_inp_test_ctx);
}
{
int rv;
int no_cleanup = 0;
int opt;
_("Do not delete the test database after a test run"), NULL },
};
};
/* Set debug level to invalid value so we can decide 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 */
if (rv == 0 && !no_cleanup) {
}
return rv;
}