test_dyndns.c revision b0a8ed519554f8896e35812e0759862c33f157fe
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen Jakub Hrozek <jhrozek@redhat.com>
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen Copyright (C) 2013 Red Hat
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen SSSD tests: Dynamic DNS tests
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen This program is free software; you can redistribute it and/or modify
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen it under the terms of the GNU General Public License as published by
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen the Free Software Foundation; either version 3 of the License, or
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen (at your option) any later version.
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen This program is distributed in the hope that it will be useful,
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
feaa6a3d82ea61496ced1f83a726ff33047c7da2Timo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen GNU General Public License for more details.
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen You should have received a copy of the GNU General Public License
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen/* In order to access opaque types */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic struct dyndns_test_ctx *dyndns_test_ctx;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenvoid __wrap_execv(const char *path, char *const argv[])
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen DEBUG(SSSDBG_FUNC_DATA, "nsupdate success test case\n");
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen DEBUG(SSSDBG_FUNC_DATA, "nsupdate error test case\n");
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen DEBUG(SSSDBG_FUNC_DATA, "nsupdate timeout test case\n");
83bb013a99f0936995f9c7a1077822662d8fefdbTimo Sirainen DEBUG(SSSDBG_CRIT_FAILURE, "unknown test case\n");
75f3dddc3a5922c92a1bdb921b653ead51227cabTimo Sirainen DEBUG(SSSDBG_TRACE_LIBS, "Child exiting with status %d\n", err);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen while ((name = sss_mock_ptr_type(char *)) != NULL) {
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen ifap = talloc_zero(global_mock_context, struct ifaddrs);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen errno = ENOMEM; /* getifaddrs sets errno, too */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen /* Do not alocate directly on ifap->ifa_addr to
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen * avoid alignment warnings */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen sa = (struct sockaddr_in *) talloc(ifap, struct sockaddr_in6);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen dst = &((struct sockaddr_in6 *)sa)->sin6_addr;
306b3f41b05da642d87e7ca7a1496efce9f5902fTimo Sirainen /* convert straddr into ifa_addr */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen if (inet_pton(ad_family, straddr, dst) != 1) {
int af_family)
if (ifname) {
if (straddr) {
&addrlist);
&addrlist);
&addrlist);
&addrlist);
static int ncalls = 0;
ncalls++;
int rv;
int no_cleanup = 0;
int opt;
switch(opt) {
return rv;