test_dyndns.c revision 12e7e87ccbae0d5c2f338cd019ca51556cbcd3ae
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner Jakub Hrozek <jhrozek@redhat.com>
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder Copyright (C) 2013 Red Hat
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder SSSD tests: Dynamic DNS tests
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder This program is free software; you can redistribute it and/or modify
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder it under the terms of the GNU General Public License as published by
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder the Free Software Foundation; either version 3 of the License, or
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder (at your option) any later version.
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder This program is distributed in the hope that it will be useful,
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder GNU General Public License for more details.
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder You should have received a copy of the GNU General Public License
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder along with this program. If not, see <http://www.gnu.org/licenses/>.
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder/* In order to access opaque types */
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder#define TEST_SYSDB_FILE "cache_"TEST_DOM_NAME".ldb"
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maederstatic TALLOC_CTX *global_mock_context = NULL;
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maederstatic struct dyndns_test_ctx *dyndns_test_ctx;
aeabd99d28fef3b392ca208c5ac84f7892af0ddbnotanartistvoid __wrap_execv(const char *path, char *const argv[])
aeabd99d28fef3b392ca208c5ac84f7892af0ddbnotanartist DEBUG(SSSDBG_FUNC_DATA, "nsupdate success test case\n");
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maeder DEBUG(SSSDBG_FUNC_DATA, "nsupdate error test case\n");
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maeder DEBUG(SSSDBG_FUNC_DATA, "nsupdate timeout test case\n");
6f70475dddc12732bdbef3e3dd116373e34cd6b9Christian Maeder DEBUG(SSSDBG_CRIT_FAILURE, "unknown test case\n");
be110dccc9f7bd9e987b35943b16ccb22922248fChristian Maeder DEBUG(SSSDBG_TRACE_LIBS, "Child exiting with status %d\n", err);
be110dccc9f7bd9e987b35943b16ccb22922248fChristian Maederint __wrap_getifaddrs(struct ifaddrs **_ifap)
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder while ((name = sss_mock_ptr_type(char *)) != NULL) {
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder ifap = talloc_zero(global_mock_context, struct ifaddrs);
2ca39b9545cad63df411619615736d9070ad7932Christian Maeder errno = ENOMEM; /* getifaddrs sets errno, too */
goto fail;
goto fail;
goto fail;
fail:
if (ifname) {
static int ncalls = 0;
ncalls++;
int rv;
int no_cleanup = 0;
int opt;
switch(opt) {
return rv;