sss_nss_idmap-tests.c revision ef105b3848894920eda52f4c5e38e9fb7b5ac616
/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2013 Red Hat
Test for the NSS Responder ID-SID mapping interface
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 <errno.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include "sss_client/idmap/sss_nss_idmap.h"
#include "tests/cmocka/common_mock.h"
#include <nss.h>
#include "sss_client/sss_cli.h"
struct sss_nss_make_request_test_data {
int errnop;
enum nss_status nss_status;
};
uint8_t buf1[] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 't', 'e', 's', 't', 0x00};
uint8_t buf2[] = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 't', 'e', 's', 't', 0x00};
uint8_t buf3[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 't', 'e', 's', 't', 0x00};
uint8_t buf4[] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 't', 'e', 's', 't', 'x'};
struct sss_cli_req_data *rd,
int *errnop)
{
struct sss_nss_make_request_test_data *d;
d = sss_mock_ptr_type(struct sss_nss_make_request_test_data *);
/* the caller must be able to free repbuf. */
}
return d->nss_status;
}
void test_getsidbyname(void **state) {
int ret;
size_t c;
enum sss_id_type type;
struct test_data {
struct sss_nss_make_request_test_data d;
int ret;
const char *str;
} d[] = {
};
will_return(sss_nss_make_request, &d[0].d);
assert_int_equal(type, 0);
}
}
}
{
};
}