2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek Jakub Hrozek <jhrozek@redhat.com>
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek Copyright (C) 2014 Red Hat
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek SSSD tests: Server instantiation
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek This program is free software; you can redistribute it and/or modify
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek it under the terms of the GNU General Public License as published by
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek the Free Software Foundation; either version 3 of the License, or
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek (at your option) any later version.
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek This program is distributed in the hope that it will be useful,
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek GNU General Public License for more details.
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek You should have received a copy of the GNU General Public License
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozekstatic void wait_for_bg_server(const char *pidfile)
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek } while (ret != 0);
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* read the pidfile */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Make sure the daemon goes away! */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Must root as root, real or fake */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Must root as root, real or fake */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek ret = server_setup(__FUNCTION__, 0, sssd->pw_uid, sssd->pw_gid,
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Must root as root, real or fake */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek pidfile = talloc_asprintf(NULL, "%s/%s.pid", TEST_PID_PATH, __FUNCTION__);
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Make sure there are no leftovers */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek ret = server_setup(__FUNCTION__, FLAGS_PID_FILE,
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Set debug level to invalid value so we can deside if -d 0 was used. */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek pc = poptGetContext(argv[0], argc, argv, long_options, 0);
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek /* Even though normally the tests should clean up after themselves
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek * they might not after a failed run. Remove the old db to be sure */
2689efa614826d45cab60ea1186d44b8bdd243adJakub Hrozek test_dom_suite_cleanup(TEST_DB_PATH, CONFDB_FILE, NULL);
4e5e846de22407f825fe3b4040d79606818a2419Jakub Hrozek rv = cmocka_run_group_tests(tests, NULL, NULL);