test_child_common.c revision 4e5e846de22407f825fe3b4040d79606818a2419
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen Jakub Hrozek <jhrozek@redhat.com>
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen Copyright (C) 2014 Red Hat
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen SSSD tests: Child handlers
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen This program is free software; you can redistribute it and/or modify
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen it under the terms of the GNU General Public License as published by
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen the Free Software Foundation; either version 3 of the License, or
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen (at your option) any later version.
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen This program is distributed in the hope that it will be useful,
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen but WITHOUT ANY WARRANTY; without even the implied warranty of
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen GNU General Public License for more details.
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen You should have received a copy of the GNU General Public License
9e69977fa6fe9273cbe166cbb7f9cbbd427b5a01Dwight Engen along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <tevent.h>
#include <errno.h>
#include <popt.h>
#include "util/child_common.h"
#include "tests/cmocka/common_mock.h"
static int destructor_called;
struct child_test_ctx {
struct child_test_ctx);
int status;
struct child_test_ctx);
if (child_pid == 0) {
errno = 0;
if (ret > 0) {
int status;
struct child_test_ctx);
NULL };
if (child_pid == 0) {
errno = 0;
if (ret > 0) {
const char *input);
struct child_test_ctx);
destructor_called = 0;
errno = 0;
errno = 0;
errno = 0;
errno = 0;
void *pvt);
struct child_test_ctx);
if (child_pid == 0) {
void *pvt)
struct child_test_ctx);
if (child_pid == 0) {
struct test_exec_echo_state {
const char *input)
return req;
struct child_test_ctx);
if (child_pid == 0) {
int rv;
int opt;
switch(opt) {
return rv;