19 #include <sys/types.h> 25 *
result = mock_ptr_type(
struct passwd *);
30 no_matching_pwent(
void **state)
41 entry_found(
void **state)
49 struct passwd returned_ent = { .pw_uid = 1000, .pw_gid = 1000 };
60 assert_int_equal(uid, 1000);
61 assert_int_equal(gid, 1000);
64 int main(
int argc,
char **argv)
66 const struct CMUnitTest tests[] = {
67 cmocka_unit_test(no_matching_pwent),
68 cmocka_unit_test(entry_found),
71 cmocka_set_message_output(CM_OUTPUT_TAP);
72 return cmocka_run_group_tests(tests, NULL, NULL);
int __wrap_getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result)
int pcmk_daemon_user(uid_t *uid, gid_t *gid)
Get user and group IDs of pacemaker daemon user.
int main(int argc, char **argv)
pcmk__action_result_t result