mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
s4-torture: cleanup nsswrapper test a little by removing nwrap references.
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
64e0231c52
commit
975073adc1
@ -69,7 +69,7 @@
|
||||
torture_dsdb_syntax,
|
||||
torture_registry,
|
||||
torture_local_verif_trailer,
|
||||
torture_local_nss_wrapper,
|
||||
torture_local_nss,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -53,9 +53,9 @@ static void print_passwd(struct passwd *pwd)
|
||||
}
|
||||
|
||||
|
||||
static bool test_nwrap_getpwnam(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct passwd *pwd_p)
|
||||
static bool test_getpwnam(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct passwd *pwd_p)
|
||||
{
|
||||
struct passwd *pwd;
|
||||
|
||||
@ -73,9 +73,9 @@ static bool test_nwrap_getpwnam(struct torture_context *tctx,
|
||||
return pwd ? true : false;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getpwnam_r(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct passwd *pwd_p)
|
||||
static bool test_getpwnam_r(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct passwd *pwd_p)
|
||||
{
|
||||
struct passwd pwd, *pwdp;
|
||||
char buffer[4096];
|
||||
@ -100,9 +100,9 @@ static bool test_nwrap_getpwnam_r(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getpwuid(struct torture_context *tctx,
|
||||
uid_t uid,
|
||||
struct passwd *pwd_p)
|
||||
static bool test_getpwuid(struct torture_context *tctx,
|
||||
uid_t uid,
|
||||
struct passwd *pwd_p)
|
||||
{
|
||||
struct passwd *pwd;
|
||||
|
||||
@ -120,9 +120,9 @@ static bool test_nwrap_getpwuid(struct torture_context *tctx,
|
||||
return pwd ? true : false;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getpwuid_r(struct torture_context *tctx,
|
||||
uid_t uid,
|
||||
struct passwd *pwd_p)
|
||||
static bool test_getpwuid_r(struct torture_context *tctx,
|
||||
uid_t uid,
|
||||
struct passwd *pwd_p)
|
||||
{
|
||||
struct passwd pwd, *pwdp;
|
||||
char buffer[4096];
|
||||
@ -187,9 +187,9 @@ static void print_group(struct group *grp)
|
||||
printf("%s\n", grp->gr_mem[i]);
|
||||
}
|
||||
|
||||
static bool test_nwrap_getgrnam(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct group *grp_p)
|
||||
static bool test_getgrnam(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct group *grp_p)
|
||||
{
|
||||
struct group *grp;
|
||||
|
||||
@ -207,9 +207,9 @@ static bool test_nwrap_getgrnam(struct torture_context *tctx,
|
||||
return grp ? true : false;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getgrnam_r(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct group *grp_p)
|
||||
static bool test_getgrnam_r(struct torture_context *tctx,
|
||||
const char *name,
|
||||
struct group *grp_p)
|
||||
{
|
||||
struct group grp, *grpp;
|
||||
char buffer[4096];
|
||||
@ -235,9 +235,9 @@ static bool test_nwrap_getgrnam_r(struct torture_context *tctx,
|
||||
}
|
||||
|
||||
|
||||
static bool test_nwrap_getgrgid(struct torture_context *tctx,
|
||||
gid_t gid,
|
||||
struct group *grp_p)
|
||||
static bool test_getgrgid(struct torture_context *tctx,
|
||||
gid_t gid,
|
||||
struct group *grp_p)
|
||||
{
|
||||
struct group *grp;
|
||||
|
||||
@ -255,9 +255,9 @@ static bool test_nwrap_getgrgid(struct torture_context *tctx,
|
||||
return grp ? true : false;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getgrgid_r(struct torture_context *tctx,
|
||||
gid_t gid,
|
||||
struct group *grp_p)
|
||||
static bool test_getgrgid_r(struct torture_context *tctx,
|
||||
gid_t gid,
|
||||
struct group *grp_p)
|
||||
{
|
||||
struct group grp, *grpp;
|
||||
char buffer[4096];
|
||||
@ -282,9 +282,9 @@ static bool test_nwrap_getgrgid_r(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_enum_passwd(struct torture_context *tctx,
|
||||
struct passwd **pwd_array_p,
|
||||
size_t *num_pwd_p)
|
||||
static bool test_enum_passwd(struct torture_context *tctx,
|
||||
struct passwd **pwd_array_p,
|
||||
size_t *num_pwd_p)
|
||||
{
|
||||
struct passwd *pwd;
|
||||
struct passwd *pwd_array = NULL;
|
||||
@ -318,9 +318,9 @@ static bool test_nwrap_enum_passwd(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_enum_r_passwd(struct torture_context *tctx,
|
||||
struct passwd **pwd_array_p,
|
||||
size_t *num_pwd_p)
|
||||
static bool test_enum_r_passwd(struct torture_context *tctx,
|
||||
struct passwd **pwd_array_p,
|
||||
size_t *num_pwd_p)
|
||||
{
|
||||
struct passwd pwd, *pwdp;
|
||||
struct passwd *pwd_array = NULL;
|
||||
@ -379,21 +379,21 @@ static bool torture_assert_passwd_equal(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_passwd(struct torture_context *tctx)
|
||||
static bool test_passwd(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct passwd *pwd, pwd1, pwd2;
|
||||
size_t num_pwd;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
|
||||
for (i=0; i < num_pwd; i++) {
|
||||
torture_assert(tctx, test_nwrap_getpwnam(tctx, pwd[i].pw_name, &pwd1),
|
||||
torture_assert(tctx, test_getpwnam(tctx, pwd[i].pw_name, &pwd1),
|
||||
"failed to call getpwnam for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
|
||||
"getpwent and getpwnam gave different results");
|
||||
torture_assert(tctx, test_nwrap_getpwuid(tctx, pwd[i].pw_uid, &pwd2),
|
||||
torture_assert(tctx, test_getpwuid(tctx, pwd[i].pw_uid, &pwd2),
|
||||
"failed to call getpwuid for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
|
||||
"getpwent and getpwuid gave different results");
|
||||
@ -404,21 +404,21 @@ static bool test_nwrap_passwd(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_passwd_r(struct torture_context *tctx)
|
||||
static bool test_passwd_r(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct passwd *pwd, pwd1, pwd2;
|
||||
size_t num_pwd;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_r_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
|
||||
for (i=0; i < num_pwd; i++) {
|
||||
torture_assert(tctx, test_nwrap_getpwnam_r(tctx, pwd[i].pw_name, &pwd1),
|
||||
torture_assert(tctx, test_getpwnam_r(tctx, pwd[i].pw_name, &pwd1),
|
||||
"failed to call getpwnam_r for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
|
||||
"getpwent_r and getpwnam_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getpwuid_r(tctx, pwd[i].pw_uid, &pwd2),
|
||||
torture_assert(tctx, test_getpwuid_r(tctx, pwd[i].pw_uid, &pwd2),
|
||||
"failed to call getpwuid_r for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
|
||||
"getpwent_r and getpwuid_r gave different results");
|
||||
@ -429,31 +429,31 @@ static bool test_nwrap_passwd_r(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_passwd_r_cross(struct torture_context *tctx)
|
||||
static bool test_passwd_r_cross(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
|
||||
size_t num_pwd;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_r_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
|
||||
for (i=0; i < num_pwd; i++) {
|
||||
torture_assert(tctx, test_nwrap_getpwnam_r(tctx, pwd[i].pw_name, &pwd1),
|
||||
torture_assert(tctx, test_getpwnam_r(tctx, pwd[i].pw_name, &pwd1),
|
||||
"failed to call getpwnam_r for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
|
||||
"getpwent_r and getpwnam_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getpwuid_r(tctx, pwd[i].pw_uid, &pwd2),
|
||||
torture_assert(tctx, test_getpwuid_r(tctx, pwd[i].pw_uid, &pwd2),
|
||||
"failed to call getpwuid_r for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
|
||||
"getpwent_r and getpwuid_r gave different results");
|
||||
torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
|
||||
"getpwnam_r and getpwuid_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getpwnam(tctx, pwd[i].pw_name, &pwd3),
|
||||
torture_assert(tctx, test_getpwnam(tctx, pwd[i].pw_name, &pwd3),
|
||||
"failed to call getpwnam for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd3,
|
||||
"getpwent_r and getpwnam gave different results");
|
||||
torture_assert(tctx, test_nwrap_getpwuid(tctx, pwd[i].pw_uid, &pwd4),
|
||||
torture_assert(tctx, test_getpwuid(tctx, pwd[i].pw_uid, &pwd4),
|
||||
"failed to call getpwuid for enumerated user");
|
||||
torture_assert_passwd_equal(tctx, &pwd[i], &pwd4,
|
||||
"getpwent_r and getpwuid gave different results");
|
||||
@ -464,9 +464,9 @@ static bool test_nwrap_passwd_r_cross(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_enum_group(struct torture_context *tctx,
|
||||
struct group **grp_array_p,
|
||||
size_t *num_grp_p)
|
||||
static bool test_enum_group(struct torture_context *tctx,
|
||||
struct group **grp_array_p,
|
||||
size_t *num_grp_p)
|
||||
{
|
||||
struct group *grp;
|
||||
struct group *grp_array = NULL;
|
||||
@ -500,9 +500,9 @@ static bool test_nwrap_enum_group(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_enum_r_group(struct torture_context *tctx,
|
||||
struct group **grp_array_p,
|
||||
size_t *num_grp_p)
|
||||
static bool test_enum_r_group(struct torture_context *tctx,
|
||||
struct group **grp_array_p,
|
||||
size_t *num_grp_p)
|
||||
{
|
||||
struct group grp, *grpp;
|
||||
struct group *grp_array = NULL;
|
||||
@ -570,21 +570,21 @@ static bool torture_assert_group_equal(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_group(struct torture_context *tctx)
|
||||
static bool test_group(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct group *grp, grp1, grp2;
|
||||
size_t num_grp;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
|
||||
for (i=0; i < num_grp; i++) {
|
||||
torture_assert(tctx, test_nwrap_getgrnam(tctx, grp[i].gr_name, &grp1),
|
||||
torture_assert(tctx, test_getgrnam(tctx, grp[i].gr_name, &grp1),
|
||||
"failed to call getgrnam for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp1,
|
||||
"getgrent and getgrnam gave different results");
|
||||
torture_assert(tctx, test_nwrap_getgrgid(tctx, grp[i].gr_gid, &grp2),
|
||||
torture_assert(tctx, test_getgrgid(tctx, grp[i].gr_gid, &grp2),
|
||||
"failed to call getgrgid for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp2,
|
||||
"getgrent and getgrgid gave different results");
|
||||
@ -595,21 +595,21 @@ static bool test_nwrap_group(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_group_r(struct torture_context *tctx)
|
||||
static bool test_group_r(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct group *grp, grp1, grp2;
|
||||
size_t num_grp;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_r_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
|
||||
for (i=0; i < num_grp; i++) {
|
||||
torture_assert(tctx, test_nwrap_getgrnam_r(tctx, grp[i].gr_name, &grp1),
|
||||
torture_assert(tctx, test_getgrnam_r(tctx, grp[i].gr_name, &grp1),
|
||||
"failed to call getgrnam_r for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp1,
|
||||
"getgrent_r and getgrnam_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getgrgid_r(tctx, grp[i].gr_gid, &grp2),
|
||||
torture_assert(tctx, test_getgrgid_r(tctx, grp[i].gr_gid, &grp2),
|
||||
"failed to call getgrgid_r for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp2,
|
||||
"getgrent_r and getgrgid_r gave different results");
|
||||
@ -620,31 +620,31 @@ static bool test_nwrap_group_r(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_group_r_cross(struct torture_context *tctx)
|
||||
static bool test_group_r_cross(struct torture_context *tctx)
|
||||
{
|
||||
int i;
|
||||
struct group *grp, grp1, grp2, grp3, grp4;
|
||||
size_t num_grp;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_r_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
|
||||
for (i=0; i < num_grp; i++) {
|
||||
torture_assert(tctx, test_nwrap_getgrnam_r(tctx, grp[i].gr_name, &grp1),
|
||||
torture_assert(tctx, test_getgrnam_r(tctx, grp[i].gr_name, &grp1),
|
||||
"failed to call getgrnam_r for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp1,
|
||||
"getgrent_r and getgrnam_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getgrgid_r(tctx, grp[i].gr_gid, &grp2),
|
||||
torture_assert(tctx, test_getgrgid_r(tctx, grp[i].gr_gid, &grp2),
|
||||
"failed to call getgrgid_r for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp2,
|
||||
"getgrent_r and getgrgid_r gave different results");
|
||||
torture_assert_group_equal(tctx, &grp1, &grp2,
|
||||
"getgrnam_r and getgrgid_r gave different results");
|
||||
torture_assert(tctx, test_nwrap_getgrnam(tctx, grp[i].gr_name, &grp3),
|
||||
torture_assert(tctx, test_getgrnam(tctx, grp[i].gr_name, &grp3),
|
||||
"failed to call getgrnam for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp3,
|
||||
"getgrent_r and getgrnam gave different results");
|
||||
torture_assert(tctx, test_nwrap_getgrgid(tctx, grp[i].gr_gid, &grp4),
|
||||
torture_assert(tctx, test_getgrgid(tctx, grp[i].gr_gid, &grp4),
|
||||
"failed to call getgrgid for enumerated user");
|
||||
torture_assert_group_equal(tctx, &grp[i], &grp4,
|
||||
"getgrent_r and getgrgid gave different results");
|
||||
@ -655,11 +655,11 @@ static bool test_nwrap_group_r_cross(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_getgrouplist(struct torture_context *tctx,
|
||||
const char *user,
|
||||
gid_t gid,
|
||||
gid_t **gids_p,
|
||||
int *num_gids_p)
|
||||
static bool test_getgrouplist(struct torture_context *tctx,
|
||||
const char *user,
|
||||
gid_t gid,
|
||||
gid_t **gids_p,
|
||||
int *num_gids_p)
|
||||
{
|
||||
int ret;
|
||||
int num_groups = 0;
|
||||
@ -690,9 +690,9 @@ static bool test_nwrap_getgrouplist(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_user_in_group(struct torture_context *tctx,
|
||||
const struct passwd *pwd,
|
||||
const struct group *grp)
|
||||
static bool test_user_in_group(struct torture_context *tctx,
|
||||
const struct passwd *pwd,
|
||||
const struct group *grp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -705,10 +705,10 @@ static bool test_nwrap_user_in_group(struct torture_context *tctx,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool test_nwrap_membership_user(struct torture_context *tctx,
|
||||
const struct passwd *pwd,
|
||||
struct group *grp_array,
|
||||
size_t num_grp)
|
||||
static bool test_membership_user(struct torture_context *tctx,
|
||||
const struct passwd *pwd,
|
||||
struct group *grp_array,
|
||||
size_t num_grp)
|
||||
{
|
||||
int num_user_groups = 0;
|
||||
int num_user_groups_from_enum = 0;
|
||||
@ -716,15 +716,15 @@ static bool test_nwrap_membership_user(struct torture_context *tctx,
|
||||
int g, i;
|
||||
bool primary_group_had_user_member = false;
|
||||
|
||||
torture_assert(tctx, test_nwrap_getgrouplist(tctx,
|
||||
pwd->pw_name,
|
||||
pwd->pw_gid,
|
||||
&user_groups,
|
||||
&num_user_groups),
|
||||
"failed to test getgrouplist");
|
||||
torture_assert(tctx, test_getgrouplist(tctx,
|
||||
pwd->pw_name,
|
||||
pwd->pw_gid,
|
||||
&user_groups,
|
||||
&num_user_groups),
|
||||
"failed to test getgrouplist");
|
||||
|
||||
for (g=0; g < num_user_groups; g++) {
|
||||
torture_assert(tctx, test_nwrap_getgrgid(tctx, user_groups[g], NULL),
|
||||
torture_assert(tctx, test_getgrgid(tctx, user_groups[g], NULL),
|
||||
"failed to find the group the user is a member of");
|
||||
}
|
||||
|
||||
@ -733,12 +733,12 @@ static bool test_nwrap_membership_user(struct torture_context *tctx,
|
||||
|
||||
struct group grp = grp_array[i];
|
||||
|
||||
if (test_nwrap_user_in_group(tctx, pwd, &grp)) {
|
||||
if (test_user_in_group(tctx, pwd, &grp)) {
|
||||
|
||||
struct group current_grp;
|
||||
num_user_groups_from_enum++;
|
||||
|
||||
torture_assert(tctx, test_nwrap_getgrnam(tctx, grp.gr_name, ¤t_grp),
|
||||
torture_assert(tctx, test_getgrnam(tctx, grp.gr_name, ¤t_grp),
|
||||
"failed to find the group the user is a member of");
|
||||
|
||||
if (current_grp.gr_gid == pwd->pw_gid) {
|
||||
@ -762,7 +762,7 @@ static bool test_nwrap_membership_user(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_membership(struct torture_context *tctx)
|
||||
static bool test_membership(struct torture_context *tctx)
|
||||
{
|
||||
const char *old_pwd = getenv("NSS_WRAPPER_PASSWD");
|
||||
const char *old_group = getenv("NSS_WRAPPER_GROUP");
|
||||
@ -777,14 +777,14 @@ static bool test_nwrap_membership(struct torture_context *tctx)
|
||||
torture_skip(tctx, "nothing to test\n");
|
||||
}
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
torture_assert(tctx, test_nwrap_enum_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
|
||||
for (i=0; i < num_pwd; i++) {
|
||||
|
||||
torture_assert(tctx, test_nwrap_membership_user(tctx, &pwd[i], grp, num_grp),
|
||||
torture_assert(tctx, test_membership_user(tctx, &pwd[i], grp, num_grp),
|
||||
"failed to test membership for user");
|
||||
|
||||
}
|
||||
@ -792,7 +792,7 @@ static bool test_nwrap_membership(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_enumeration(struct torture_context *tctx)
|
||||
static bool test_enumeration(struct torture_context *tctx)
|
||||
{
|
||||
const char *old_pwd = getenv("NSS_WRAPPER_PASSWD");
|
||||
const char *old_group = getenv("NSS_WRAPPER_GROUP");
|
||||
@ -802,15 +802,15 @@ static bool test_nwrap_enumeration(struct torture_context *tctx)
|
||||
torture_skip(tctx, "nothing to test\n");
|
||||
}
|
||||
|
||||
torture_assert(tctx, test_nwrap_passwd(tctx),
|
||||
torture_assert(tctx, test_passwd(tctx),
|
||||
"failed to test users");
|
||||
torture_assert(tctx, test_nwrap_group(tctx),
|
||||
torture_assert(tctx, test_group(tctx),
|
||||
"failed to test groups");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_reentrant_enumeration(struct torture_context *tctx)
|
||||
static bool test_reentrant_enumeration(struct torture_context *tctx)
|
||||
{
|
||||
const char *old_pwd = getenv("NSS_WRAPPER_PASSWD");
|
||||
const char *old_group = getenv("NSS_WRAPPER_GROUP");
|
||||
@ -822,15 +822,15 @@ static bool test_nwrap_reentrant_enumeration(struct torture_context *tctx)
|
||||
|
||||
torture_comment(tctx, "Testing re-entrant calls\n");
|
||||
|
||||
torture_assert(tctx, test_nwrap_passwd_r(tctx),
|
||||
torture_assert(tctx, test_passwd_r(tctx),
|
||||
"failed to test users");
|
||||
torture_assert(tctx, test_nwrap_group_r(tctx),
|
||||
torture_assert(tctx, test_group_r(tctx),
|
||||
"failed to test groups");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_reentrant_enumeration_crosschecks(struct torture_context *tctx)
|
||||
static bool test_reentrant_enumeration_crosschecks(struct torture_context *tctx)
|
||||
{
|
||||
const char *old_pwd = getenv("NSS_WRAPPER_PASSWD");
|
||||
const char *old_group = getenv("NSS_WRAPPER_GROUP");
|
||||
@ -842,22 +842,22 @@ static bool test_nwrap_reentrant_enumeration_crosschecks(struct torture_context
|
||||
|
||||
torture_comment(tctx, "Testing re-entrant calls with cross checks\n");
|
||||
|
||||
torture_assert(tctx, test_nwrap_passwd_r_cross(tctx),
|
||||
torture_assert(tctx, test_passwd_r_cross(tctx),
|
||||
"failed to test users");
|
||||
torture_assert(tctx, test_nwrap_group_r_cross(tctx),
|
||||
torture_assert(tctx, test_group_r_cross(tctx),
|
||||
"failed to test groups");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_passwd_duplicates(struct torture_context *tctx)
|
||||
static bool test_passwd_duplicates(struct torture_context *tctx)
|
||||
{
|
||||
int i, d;
|
||||
struct passwd *pwd;
|
||||
size_t num_pwd;
|
||||
int duplicates = 0;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
|
||||
"failed to enumerate passwd");
|
||||
|
||||
for (i=0; i < num_pwd; i++) {
|
||||
@ -885,14 +885,14 @@ static bool test_nwrap_passwd_duplicates(struct torture_context *tctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_nwrap_group_duplicates(struct torture_context *tctx)
|
||||
static bool test_group_duplicates(struct torture_context *tctx)
|
||||
{
|
||||
int i, d;
|
||||
struct group *grp;
|
||||
size_t num_grp;
|
||||
int duplicates = 0;
|
||||
|
||||
torture_assert(tctx, test_nwrap_enum_group(tctx, &grp, &num_grp),
|
||||
torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
|
||||
"failed to enumerate group");
|
||||
|
||||
for (i=0; i < num_grp; i++) {
|
||||
@ -921,7 +921,7 @@ static bool test_nwrap_group_duplicates(struct torture_context *tctx)
|
||||
}
|
||||
|
||||
|
||||
static bool test_nwrap_duplicates(struct torture_context *tctx)
|
||||
static bool test_duplicates(struct torture_context *tctx)
|
||||
{
|
||||
const char *old_pwd = getenv("NSS_WRAPPER_PASSWD");
|
||||
const char *old_group = getenv("NSS_WRAPPER_GROUP");
|
||||
@ -931,24 +931,24 @@ static bool test_nwrap_duplicates(struct torture_context *tctx)
|
||||
torture_skip(tctx, "nothing to test\n");
|
||||
}
|
||||
|
||||
torture_assert(tctx, test_nwrap_passwd_duplicates(tctx),
|
||||
torture_assert(tctx, test_passwd_duplicates(tctx),
|
||||
"failed to test users");
|
||||
torture_assert(tctx, test_nwrap_group_duplicates(tctx),
|
||||
torture_assert(tctx, test_group_duplicates(tctx),
|
||||
"failed to test groups");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
struct torture_suite *torture_local_nss_wrapper(TALLOC_CTX *mem_ctx)
|
||||
struct torture_suite *torture_local_nss(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct torture_suite *suite = torture_suite_create(mem_ctx, "nss-wrapper");
|
||||
struct torture_suite *suite = torture_suite_create(mem_ctx, "nss");
|
||||
|
||||
torture_suite_add_simple_test(suite, "enumeration", test_nwrap_enumeration);
|
||||
torture_suite_add_simple_test(suite, "reentrant enumeration", test_nwrap_reentrant_enumeration);
|
||||
torture_suite_add_simple_test(suite, "reentrant enumeration crosschecks", test_nwrap_reentrant_enumeration_crosschecks);
|
||||
torture_suite_add_simple_test(suite, "membership", test_nwrap_membership);
|
||||
torture_suite_add_simple_test(suite, "duplicates", test_nwrap_duplicates);
|
||||
torture_suite_add_simple_test(suite, "enumeration", test_enumeration);
|
||||
torture_suite_add_simple_test(suite, "reentrant enumeration", test_reentrant_enumeration);
|
||||
torture_suite_add_simple_test(suite, "reentrant enumeration crosschecks", test_reentrant_enumeration_crosschecks);
|
||||
torture_suite_add_simple_test(suite, "membership", test_membership);
|
||||
torture_suite_add_simple_test(suite, "duplicates", test_duplicates);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user