common_mock_sdap.c revision 3f32406640d89face5e79244b4d8dab34adb6c7c
842ae4bd224140319ae7feec1872b93dfd491143fielding Pavel Březina <pbrezina@redhat.com>
842ae4bd224140319ae7feec1872b93dfd491143fielding Copyright (C) 2013 Red Hat
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding This program is free software; you can redistribute it and/or modify
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd it under the terms of the GNU General Public License as published by
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding the Free Software Foundation; either version 3 of the License, or
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd (at your option) any later version.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd This program is distributed in the hope that it will be useful,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd but WITHOUT ANY WARRANTY; without even the implied warranty of
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding GNU General Public License for more details.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding You should have received a copy of the GNU General Public License
36a72c96fc2dda27eadbae8a108fa428cc1419c1wrowe along with this program. If not, see <http://www.gnu.org/licenses/>.
79d97c2c5e2d3f8bb2a92cd21b3b4900d7bf04d6mturk const char *conf_path,
e9501b71b8a1e76384cb010b1e41e76a1e47aacctrawickstruct sdap_options *mock_sdap_options_ldap(TALLOC_CTX *mem_ctx,
7a3f81622e6b6995e0e879b1c0279ba68130b4b1jfclere const char *conf_path)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ret = ldap_get_options(mem_ctx, domain, confdb_ctx, conf_path, &opts);
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstruct sdap_handle *mock_sdap_handle(TALLOC_CTX *mem_ctx)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct sdap_handle *handle = talloc_zero(mem_ctx, struct sdap_handle);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* we will never connect to any LDAP server and any sdap API that
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * access sdap_handle should be mocked, thus returning empty structure
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * is enough */
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe * Every function that is placed in sdap_async.c module has to be mocked,
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe * to avoid any attempt to communicate with remote servers. Therefore no test
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe * can be compiled with sdap_async.c. If any of these functions is needed,
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe * their mock equivalent shall be used.
eee895b02dd7867622afd0a8a94f2efc7de9c618wrowebool sdap_has_deref_support(struct sdap_handle *sh, struct sdap_options *opts)
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe return sss_mock_type(bool);
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowestruct tevent_req *sdap_get_generic_send(TALLOC_CTX *mem_ctx,
9f1a88897168c3f1e5009acb585daf01e38a0299jim const char *search_base,
01261c7d9578aadd1891f94c8ee03f32ba51db3dmturk const char *filter,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe const char **attrs,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowestruct tevent_req * sdap_deref_search_send(TALLOC_CTX *mem_ctx,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe const char *base_dn,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe const char *deref_attr,
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe const char **attrs,