/*
Copyright (C) 2015 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 <talloc.h>
#include <tevent.h>
#include <errno.h>
#include <popt.h>
#include "providers/data_provider/dp_private.h"
#include "providers/data_provider/dp.h"
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_be.h"
#include "tests/cmocka/data_provider/mock_dp.h"
struct test_ctx {
};
{
return 0;
}
{
return 0;
}
static bool is_be_offline_opt = false;
{
return is_be_offline_opt;
}
struct method_data
{
int foo;
};
struct req_data
{
};
struct test_state
{
const char *name;
};
struct tevent_timer *tt,
void *pvt);
static struct tevent_req *
struct method_data *md,
struct dp_req_params *params)
{
return NULL;
}
/* Init state of lookup */
/* Mock lookup */
return NULL;
}
return req;
}
struct tevent_timer *tt,
void *pvt)
{
/* Result */
} else {
}
}
struct recv_data
{
const char *name;
};
static errno_t
struct tevent_req *req,
{
return ENOENT;
} else {
}
return EOK;
}
{
const char *req_name;
md,
/* Prepare request data #1 */
/* Prepare request data #2 */
/* Prepare request data #3 */
/* Send request #1 */
/* Send request #2 */
/* Send request #3 */
/* Receive lookup results */
}
{
const char *req_name;
md,
/* Prepare request data #1 */
/* Send request #1 */
/* Receive lookup results */
struct req_data, /* Wrong data type. */
&recv_data);
}
{
md,
/* Prepare request data #1 */
/* Send request #1 */
"non-existing domain name",
0,
/* Receive lookup results */
}
{
bool backup;
md,
/* Prepare request data #1 */
is_be_offline_opt = true;
/* Send request #1 */
DP_FAST_REPLY, /* FAST REPLY, don't check online! */
/* Restore */
/* Receive lookup results */
}
{
int opt;
int rv;
int no_cleanup = 0;
_("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;
}