diff --git a/src/test/test-user-util.c b/src/test/test-user-util.c index 1a507bc00a..fd7878fde2 100644 --- a/src/test/test-user-util.c +++ b/src/test/test-user-util.c @@ -191,6 +191,20 @@ static void test_get_group_creds_one(const char *id, const char *name, gid_t gid assert_se(rgid == gid); } +static void test_make_salt(void) { + log_info("/* %s */", __func__); + + _cleanup_free_ char *s, *t; + + assert_se(make_salt(&s) == 0); + log_info("got %s", s); + + assert_se(make_salt(&t) == 0); + log_info("got %s", t); + + assert(!streq(s, t)); +} + int main(int argc, char *argv[]) { test_uid_to_name_one(0, "root"); test_uid_to_name_one(UID_NOBODY, NOBODY_USER_NAME); @@ -221,5 +235,7 @@ int main(int argc, char *argv[]) { test_valid_gecos(); test_valid_home(); + test_make_salt(); + return 0; }