18 #include <sys/types.h> 21 no_matching_pwent(
void **state)
43 entry_found(
void **state)
51 struct passwd returned_ent = { .pw_uid = 1000, .pw_gid = 1000 };
75 assert_int_equal(uid, 1000);
76 assert_int_equal(gid, 1000);
82 cmocka_unit_test(no_matching_pwent),
83 cmocka_unit_test(entry_found))
bool pcmk__mock_getpwnam_r
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.
PCMK__UNIT_TEST(NULL, NULL, cmocka_unit_test(bad_input), cmocka_unit_test(not_found), cmocka_unit_test(find_attrB), cmocka_unit_test(find_attrA_matching))
pcmk__action_result_t result
#define PCMK__PW_BUFFER_LEN