62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl Copyright (C) 2015 Red Hat
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl This program is free software; you can redistribute it and/or modify
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl it under the terms of the GNU General Public License as published by
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl the Free Software Foundation; either version 3 of the License, or
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl (at your option) any later version.
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl This program is distributed in the hope that it will be useful,
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl but WITHOUT ANY WARRANTY; without even the implied warranty of
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl GNU General Public License for more details.
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl You should have received a copy of the GNU General Public License
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl along with this program. If not, see <http://www.gnu.org/licenses/>.
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx = talloc_zero(global_talloc_context, struct test_ctx);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx->tctx = create_dom_test_ctx(test_ctx, TESTS_PATH, TEST_CONF_DB,
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx->be_ctx = mock_be_ctx(test_ctx, test_ctx->tctx);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx->params = mock_dp_req_params(test_ctx, test_ctx->be_ctx->ev,
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx = talloc_get_type_abort(*state, struct test_ctx);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl req = dp_access_deny_handler_send(test_ctx, NULL, pd, test_ctx->params);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl ret = dp_access_deny_handler_recv(test_ctx, req, &out_pd);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl assert_int_equal(pd->pam_status, PAM_PERM_DENIED);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_ctx = talloc_get_type(*state, struct test_ctx);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl req = dp_access_permit_handler_send(test_ctx, NULL, pd, test_ctx->params);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl ret = dp_access_permit_handler_recv(test_ctx, req, &out_pd);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl {"no-cleanup", 'n', POPT_ARG_NONE, &no_cleanup, 0,
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl _("Do not delete the test database after a test run"), NULL },
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl cmocka_unit_test_setup_teardown(test_permit_handler,
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl cmocka_unit_test_setup_teardown(test_deny_handler,
57c5ea8825c7179fd93382dbcbb07e828e5aec19René Genz /* Set debug level to invalid value so we can decide if -d 0 was used. */
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl pc = poptGetContext(argv[0], argc, argv, long_options, 0);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl /* Even though normally the tests should clean up after themselves
57c5ea8825c7179fd93382dbcbb07e828e5aec19René Genz * they might not after a failed run. Remove the old DB to be sure */
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, TEST_DOM_NAME);
62370340092503baeaf6587d7ffe4fe25bd9582dPavel Reichl rv = cmocka_run_group_tests(tests, NULL, NULL);