/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2013 Red Hat
SSSD tests: InfoPipe responder
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <popt.h>
#include "tests/cmocka/common_mock.h"
#include "tests/cmocka/common_mock_resp.h"
#include "responder/ifp/ifp_private.h"
#include "sbus/sssd_dbus_private.h"
/* dbus library checks for valid object paths when unit testing, we don't
* want that */
static struct ifp_ctx *
{
return ifp_ctx;
}
static struct sbus_request *
{
return sr;
}
{
}
{
}
{
char *attr_name;
char *attr_val;
&iter_dict);
/* Test the reply contains what we expect */
}
const char **s2)
{
int i;
for (i=0; s1[i]; i++) {
assert_non_null(s2[i]);
}
assert_null(s2[i]);
}
{
const char **res;
if (expected) {
/* Positive test */
} else {
/* Negative test */
}
}
const char **defaults)
{
const char **res;
if (expected) {
/* Positive test */
} else {
/* Negative test */
}
}
{
/* Test defaults */
/* Test adding some attributes to the defaults */
/* Test removing some attributes to the defaults */
SYSDB_HOMEDIR, "groups",
"domain", "domainname",
NULL };
/* Test both add and remove */
SYSDB_HOMEDIR, "groups",
"domain", "domainname",
NULL };
/* Test rm trumps add */
"groups", "domain",
"domainname", NULL };
"+telephoneNumber, -telephoneNumber, +telephoneNumber");
/* Remove all */
"-domain, -domainname");
/* Malformed list */
}
{
/* Test defaults */
/* Test adding some attributes to the defaults */
"abc", "123", "xyz",
NULL };
/* Test removing some attributes to the defaults */
/* Test adding with empty defaults */
NULL };
/* Test removing with empty defaults */
}
{
}
struct ifp_test_req_ctx {
};
{
return 0;
}
{
struct ifp_test_req_ctx);
return 0;
}
{
int opt;
};
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* Even though normally the tests should clean up after themselves
* they might not after a failed run. Remove the old DB to be sure */
}