common_mock_be.c revision d43c9d18fb263b1ea4071b20e93ce4994583f62f
af84459fbf938e508fd10b01cb8d699c79083813takashi/*
af84459fbf938e508fd10b01cb8d699c79083813takashi Authors:
af84459fbf938e508fd10b01cb8d699c79083813takashi Jakub Hrozek <jhrozek@redhat.com>
af84459fbf938e508fd10b01cb8d699c79083813takashi
af84459fbf938e508fd10b01cb8d699c79083813takashi Copyright (C) 2015 Red Hat
af84459fbf938e508fd10b01cb8d699c79083813takashi
af84459fbf938e508fd10b01cb8d699c79083813takashi SSSD tests: Fake back end
af84459fbf938e508fd10b01cb8d699c79083813takashi
af84459fbf938e508fd10b01cb8d699c79083813takashi This program is free software; you can redistribute it and/or modify
af84459fbf938e508fd10b01cb8d699c79083813takashi it under the terms of the GNU General Public License as published by
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the Free Software Foundation; either version 3 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen This program is distributed in the hope that it will be useful,
af84459fbf938e508fd10b01cb8d699c79083813takashi but WITHOUT ANY WARRANTY; without even the implied warranty of
af84459fbf938e508fd10b01cb8d699c79083813takashi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen GNU General Public License for more details.
3f08db06526d6901aa08c110b5bc7dde6bc39905nd
af84459fbf938e508fd10b01cb8d699c79083813takashi You should have received a copy of the GNU General Public License
af84459fbf938e508fd10b01cb8d699c79083813takashi along with this program. If not, see <http://www.gnu.org/licenses/>.
af84459fbf938e508fd10b01cb8d699c79083813takashi*/
3f08db06526d6901aa08c110b5bc7dde6bc39905nd
af84459fbf938e508fd10b01cb8d699c79083813takashi#include "util/util.h"
af84459fbf938e508fd10b01cb8d699c79083813takashi#include "tests/cmocka/common_mock_resp.h"
af84459fbf938e508fd10b01cb8d699c79083813takashi
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjungstruct be_ctx *mock_be_ctx(TALLOC_CTX *mem_ctx, struct sss_test_ctx *tctx)
af84459fbf938e508fd10b01cb8d699c79083813takashi{
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen struct be_ctx *be_ctx;
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen
af84459fbf938e508fd10b01cb8d699c79083813takashi be_ctx = talloc_zero(mem_ctx, struct be_ctx);
af84459fbf938e508fd10b01cb8d699c79083813takashi assert_non_null(be_ctx);
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin
af84459fbf938e508fd10b01cb8d699c79083813takashi be_ctx->cdb = tctx->confdb;
3c13a815670b54d1c17bf02954f7d2b066cde95cnd be_ctx->ev = tctx->ev;
3c13a815670b54d1c17bf02954f7d2b066cde95cnd be_ctx->domain = tctx->dom;
af84459fbf938e508fd10b01cb8d699c79083813takashi be_ctx->conf_path = tctx->conf_dom_path;
af84459fbf938e508fd10b01cb8d699c79083813takashi
af84459fbf938e508fd10b01cb8d699c79083813takashi return be_ctx;
af84459fbf938e508fd10b01cb8d699c79083813takashi}
5effc8b39fae5cd169d17f342bfc265705840014rbowen