18 #include <sys/types.h> 21 calloc_fails(
void **state)
36 getpwnam_r_fails(
void **state)
58 no_matching_pwent(
void **state)
80 entry_found(
void **state)
88 struct passwd returned_ent = { .pw_uid = 1000, .pw_gid = 1000 };
117 assert_int_equal(uid, 1000);
118 assert_int_equal(gid, 1000);
124 cmocka_unit_test(calloc_fails),
125 cmocka_unit_test(getpwnam_r_fails),
126 cmocka_unit_test(no_matching_pwent),
127 cmocka_unit_test(entry_found))
bool pcmk__mock_getpwnam_r
int crm_user_lookup(const char *name, uid_t *uid, gid_t *gid)
int __wrap_getpwnam_r(const char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result)
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
void * __wrap_calloc(size_t nmemb, size_t size)