2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose SSSD - Test for routine to check to access to responder sockets
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose Sumit Bose <sbose@redhat.com>
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose Copyright (C) 2012 Red Hat
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose This program is free software; you can redistribute it and/or modify
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose it under the terms of the GNU General Public License as published by
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose the Free Software Foundation; either version 3 of the License, or
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose (at your option) any later version.
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose This program is distributed in the hope that it will be useful,
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose but WITHOUT ANY WARRANTY; without even the implied warranty of
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose GNU General Public License for more details.
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose You should have received a copy of the GNU General Public License
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose along with this program. If not, see <http://www.gnu.org/licenses/>.
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bosestruct cli_protocol_version *register_cli_protocol_version(void)
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose static struct cli_protocol_version responder_test_cli_protocol_version[] = {
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose {"1,2,3, 4,5 , 6 , 7 ", 0, 7, (uid_t []){1, 2, 3, 4, 5, 6, 7}},
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose {"1, 2, 4294967295", 0, 3, (uid_t []){1, 2, 4294967295U}},
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose {"1, 2, root, 4, 5", 0, 5, (uid_t []){1, 2, 0, 4, 5}},
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose ret = csv_string_to_uid_array(global_talloc_context, s2a_data[c].inp,
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose "Wrong number of values, expected [%d], got [%d].",
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose "Wrong value, expected [%d], got [%d].\n",
e6bf08648e4b808da75d220dfab8d17a2352ca02Lukas Slebodnik for (c = 0; uid_check_data[c].exp_ret != -1; c++) {
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose "check_allowed_uids failed [%d][%s].", ret, strerror(ret));
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose Suite *s = suite_create ("Responder socket access");
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose tcase_add_test(tc_utils, resp_str_to_array_test);
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose tcase_add_test(tc_utils, check_allowed_uids_test);
49dd8ee2834d9477418961dbaffa4a03cfa9fd1eRené Genz /* Set debug level to invalid value so we can decide if -d 0 was used. */
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose pc = poptGetContext(argv[0], argc, argv, long_options, 0);
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose /* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
2d257ccf620ce1b611f89cec8f0a94c88c2f2881Sumit Bose return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;