common_mock_sysdb_objects.h revision 17d37aecdf397fcb7a1d0c75adebdb25d7be112e
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/*
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen Authors:
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen Pavel Březina <pbrezina@redhat.com>
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen Copyright (C) 2013 Red Hat
1f366614aaafcc9496ff85b25988f19c3254ab7cTimo Sirainen
1f366614aaafcc9496ff85b25988f19c3254ab7cTimo Sirainen This program is free software; you can redistribute it and/or modify
39ea5717264668e2c7f9f7986eb821d21785f47fTimo Sirainen it under the terms of the GNU General Public License as published by
97943a36e08923d625898f5ca8ffd38325a3986dTimo Sirainen the Free Software Foundation; either version 3 of the License, or
3bc62efe513ebc7450cffe9a4e8f0b07424bf190Timo Sirainen (at your option) any later version.
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen This program is distributed in the hope that it will be useful,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen GNU General Public License for more details.
8bf42ce5ef783b96a2ded67524173e95e9b45adaTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen You should have received a copy of the GNU General Public License
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen*/
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#ifndef COMMON_MOCK_SYSDB_OBJECTS_H_
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#define COMMON_MOCK_SYSDB_OBJECTS_H_
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#include <talloc.h>
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#include "util/util.h"
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen#include "providers/ldap/sdap.h"
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenstruct sysdb_attrs *
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen_mock_sysdb_object(TALLOC_CTX *mem_ctx,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen const char *base_dn,
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen const char *name,
f739c92a9237db03327dc82e3792e39c160a1e4dTimo Sirainen ...);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#define mock_sysdb_object(mem_ctx, base_dn, name, ...) \
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen _mock_sysdb_object(mem_ctx, base_dn, name, ##__VA_ARGS__, NULL)
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen#define mock_sysdb_user(mem_ctx, base_dn, name, ...) \
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen mock_sysdb_object(mem_ctx, base_dn, name, ##__VA_ARGS__)
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenstruct sysdb_attrs *
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainenmock_sysdb_group_rfc2307bis(TALLOC_CTX *mem_ctx,
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen const char *base_dn,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen gid_t gid,
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen const char *name,
9c7f6dbf65ca01026e5f9c8c8b67c7e629c0b5e7Timo Sirainen const char **members);
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen
e3fabe8d0faa9aab7cae2d0eee9653f581a3061dTimo Sirainen#endif /* COMMON_MOCK_SYSDB_OBJECTS_H_ */
055389c58fa3915e12fb4e72ec86782ce77c5c72Timo Sirainen