[SCM] Samba Shared Repository - branch master updated
Stefan Metzmacher
metze at samba.org
Thu Apr 9 11:36:02 MDT 2015
The branch, master has been updated
via 0c6c081 s4:torture/winbind: add torture:winbindd_domain_without_prefix option
via 86f29d6 s4:torture/local: add more torture_assert() checks
via 85827c5 selftest/Samba4: use 'testallowed account' instead of 'test allowed'
via ff5f466 selftest/knownfail: remove unused ^samba4.winbind.struct.show_sequence\(ad_dc\) line
from 2bca4cd rpcclient: Fix the timeout command
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0c6c081dc4e743c142a59d90c9e7f5b6e4cf5bd1
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Mar 28 10:04:30 2015 +0100
s4:torture/winbind: add torture:winbindd_domain_without_prefix option
We should not assume that names in the domain
specified by 'torture:winbindd_netbios_domain' have no DOMAIN\ prefix.
On an AD DC we prefix all principals.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11183
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu Apr 9 19:35:38 CEST 2015 on sn-devel-104
commit 86f29d62a6ebb6c0245c07a9d8e7524ac0b93940
Author: Stefan Metzmacher <metze at samba.org>
Date: Sun Mar 29 11:21:16 2015 +0200
s4:torture/local: add more torture_assert() checks
We need to make sure we return when torture_assert_passwd_equal()
or torture_assert_group_equal() fails.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11183
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 85827c5292fca0eef565b0361948405aa662c59b
Author: Stefan Metzmacher <metze at samba.org>
Date: Sun Mar 29 11:15:29 2015 +0200
selftest/Samba4: use 'testallowed account' instead of 'test allowed'
local.nss test might print lines starting with 'test allowed:...'
and that confused the subunit parser.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit ff5f46682566452dc28123e052bb32216ebf1e14
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Mar 28 10:07:41 2015 +0100
selftest/knownfail: remove unused ^samba4.winbind.struct.show_sequence\(ad_dc\) line
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
selftest/knownfail | 1 -
selftest/target/Samba4.pm | 17 ++-
source4/selftest/tests.py | 6 +-
source4/torture/local/nss_tests.c | 255 +++++++++++++++++++--------------
source4/torture/winbind/struct_based.c | 8 +-
5 files changed, 164 insertions(+), 123 deletions(-)
Changeset truncated at 500 lines:
diff --git a/selftest/knownfail b/selftest/knownfail
index c16e916..d4a6923 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -241,7 +241,6 @@
#
# The Samba4 winbind does not cover the full winbind protocol, so these are expected
#
-^samba4.winbind.struct.show_sequence\(ad_dc\)
^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo -N against ad_dc_ntvfs
^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo -I against ad_dc_ntvfs
^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo --trusted-domains against ad_dc_ntvfs
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 9d765c4..26f6dda 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -816,8 +816,9 @@ sub provision_raw_step2($$$)
return undef;
}
+ my $testallowed_account = "testallowed";
my $samba_tool_cmd = Samba::bindir_path($self, "samba-tool")
- . " user add --configfile=$ctx->{smb_conf} testallowed $ctx->{password}";
+ . " user add --configfile=$ctx->{smb_conf} $testallowed_account $ctx->{password}";
unless (system($samba_tool_cmd) == 0) {
warn("Unable to add testallowed user: \n$samba_tool_cmd\n");
return undef;
@@ -830,12 +831,13 @@ sub provision_raw_step2($$$)
$base_dn = "DC=$ctx->{netbiosname}";
}
- my $user_dn = "cn=testallowed,cn=users,$base_dn";
+ my $user_dn = "cn=$testallowed_account,cn=users,$base_dn";
+ $testallowed_account = "testallowed account";
open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb");
print LDIF "dn: $user_dn
changetype: modify
replace: samAccountName
-samAccountName: test allowed
+samAccountName: $testallowed_account
-
";
close(LDIF);
@@ -869,9 +871,9 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn
close(LDIF);
$samba_tool_cmd = Samba::bindir_path($self, "samba-tool")
- . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' 'test allowed'";
+ . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' '$testallowed_account'";
unless (system($samba_tool_cmd) == 0) {
- warn("Unable to add 'test allowed' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n");
+ warn("Unable to add '$testallowed_account' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n");
return undef;
}
@@ -1637,10 +1639,11 @@ sub provision_rodc($$$)
return undef;
}
- # This ensures deterministic behaviour for tests that want to have the 'test allowed'
+ # This ensures deterministic behaviour for tests that want to have the 'testallowed account'
# user password verified on the RODC
+ my $testallowed_account = "testallowed account";
$cmd = "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
- $cmd .= "$samba_tool rodc preload 'test allowed' $ret->{CONFIGURATION}";
+ $cmd .= "$samba_tool rodc preload '$testallowed_account' $ret->{CONFIGURATION}";
$cmd .= " --server=$dcvars->{DC_SERVER}";
unless (system($cmd) == 0) {
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index bea1540..015e902 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -368,11 +368,13 @@ plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_sha
plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
-wb_opts = ["--option=\"torture:strict mode=no\"", "--option=\"torture:timelimit=1\"", "--option=\"torture:winbindd_separator=/\"", "--option=\"torture:winbindd_netbios_name=$SERVER\"", "--option=\"torture:winbindd_netbios_domain=$DOMAIN\""]
+wb_opts_default = ["--option=\"torture:strict mode=no\"", "--option=\"torture:timelimit=1\"", "--option=\"torture:winbindd_separator=/\"", "--option=\"torture:winbindd_netbios_name=$SERVER\"", "--option=\"torture:winbindd_netbios_domain=$DOMAIN\""]
winbind_ad_client_tests = smbtorture4_testsuites("winbind.struct") + smbtorture4_testsuites("winbind.pac")
winbind_wbclient_tests = smbtorture4_testsuites("winbind.wbclient")
for env in ["ad_dc", "s4member", "ad_member"]:
+ wb_opts = wb_opts_default
+ wb_opts += ["--option=\"torture:winbindd_domain_without_prefix=$DOMAIN\""]
for t in winbind_ad_client_tests:
plansmbtorture4testsuite(t, "%s:local" % env, wb_opts + ['//$SERVER/tmp', '--realm=$REALM', '--machine-pass', '--option=torture:addc=$DC_SERVER'])
@@ -572,7 +574,7 @@ for env in ["ad_dc_ntvfs", "rodc", "promoted_dc", "ad_dc", "fl2000dc", "fl2003dc
plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P', '--workgroup=$DOMAIN', '--realm=$REALM', '--option=torture:krb5-hostname=$SERVER', '--option=torture:expect_machine_account=true'] + extra_options,
"samba4.krb5.kdc with machine account")
- plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utest\ allowed%$PASSWORD',
+ plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
'--workgroup=$DOMAIN', '--realm=$REALM',
'--option=torture:expect_machine_account=true',
'--option=torture:krb5-upn=testallowed\ upn@$REALM',
diff --git a/source4/torture/local/nss_tests.c b/source4/torture/local/nss_tests.c
index a6baf21..546d7eb 100644
--- a/source4/torture/local/nss_tests.c
+++ b/source4/torture/local/nss_tests.c
@@ -30,12 +30,17 @@ static bool copy_passwd(struct torture_context *tctx,
struct passwd *p)
{
p->pw_name = talloc_strdup(tctx, pwd->pw_name);
+ torture_assert(tctx, (p->pw_name != NULL || pwd->pw_name == NULL), __location__);
p->pw_passwd = talloc_strdup(tctx, pwd->pw_passwd);
+ torture_assert(tctx, (p->pw_passwd != NULL || pwd->pw_passwd == NULL), __location__);
p->pw_uid = pwd->pw_uid;
p->pw_gid = pwd->pw_gid;
p->pw_gecos = talloc_strdup(tctx, pwd->pw_gecos);
+ torture_assert(tctx, (p->pw_gecos != NULL || pwd->pw_gecos == NULL), __location__);
p->pw_dir = talloc_strdup(tctx, pwd->pw_dir);
+ torture_assert(tctx, (p->pw_dir != NULL || pwd->pw_dir == NULL), __location__);
p->pw_shell = talloc_strdup(tctx, pwd->pw_shell);
+ torture_assert(tctx, (p->pw_shell != NULL || pwd->pw_shell == NULL), __location__);
return true;
}
@@ -58,19 +63,22 @@ static bool test_getpwnam(struct torture_context *tctx,
struct passwd *pwd_p)
{
struct passwd *pwd;
+ int ret;
torture_comment(tctx, "Testing getpwnam: %s\n", name);
+ errno = 0;
pwd = getpwnam(name);
- if (pwd) {
- print_passwd(pwd);
- }
+ ret = errno;
+ torture_assert(tctx, (pwd != NULL), talloc_asprintf(tctx,
+ "getpwnam(%s) failed - %d - %s",
+ name, ret, strerror(ret)));
- if (pwd_p) {
- copy_passwd(tctx, pwd, pwd_p);
+ if (pwd_p != NULL) {
+ torture_assert(tctx, copy_passwd(tctx, pwd, pwd_p), __location__);
}
- return pwd ? true : false;
+ return true;
}
static bool test_getpwnam_r(struct torture_context *tctx,
@@ -84,17 +92,14 @@ static bool test_getpwnam_r(struct torture_context *tctx,
torture_comment(tctx, "Testing getpwnam_r: %s\n", name);
ret = getpwnam_r(name, &pwd, buffer, sizeof(buffer), &pwdp);
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- return false;
- }
+ torture_assert(tctx, ret == 0, talloc_asprintf(tctx,
+ "getpwnam_r(%s) failed - %d - %s",
+ name, ret, strerror(ret)));
print_passwd(&pwd);
- if (pwd_p) {
- copy_passwd(tctx, &pwd, pwd_p);
+ if (pwd_p != NULL) {
+ torture_assert(tctx, copy_passwd(tctx, &pwd, pwd_p), __location__);
}
return true;
@@ -105,19 +110,24 @@ static bool test_getpwuid(struct torture_context *tctx,
struct passwd *pwd_p)
{
struct passwd *pwd;
+ int ret;
torture_comment(tctx, "Testing getpwuid: %lu\n", (unsigned long)uid);
+ errno = 0;
pwd = getpwuid(uid);
- if (pwd) {
- print_passwd(pwd);
- }
+ ret = errno;
+ torture_assert(tctx, (pwd != NULL), talloc_asprintf(tctx,
+ "getpwuid(%lu) failed - %d - %s",
+ (unsigned long)uid, ret, strerror(ret)));
+
+ print_passwd(pwd);
- if (pwd_p) {
- copy_passwd(tctx, pwd, pwd_p);
+ if (pwd_p != NULL) {
+ torture_assert(tctx, copy_passwd(tctx, pwd, pwd_p), __location__);
}
- return pwd ? true : false;
+ return true;
}
static bool test_getpwuid_r(struct torture_context *tctx,
@@ -131,17 +141,14 @@ static bool test_getpwuid_r(struct torture_context *tctx,
torture_comment(tctx, "Testing getpwuid_r: %lu\n", (unsigned long)uid);
ret = getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &pwdp);
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- return false;
- }
+ torture_assert(tctx, ret == 0, talloc_asprintf(tctx,
+ "getpwuid_r(%lu) failed - %d - %s",
+ (unsigned long)uid, ret, strerror(ret)));
print_passwd(&pwd);
- if (pwd_p) {
- copy_passwd(tctx, &pwd, pwd_p);
+ if (pwd_p != NULL) {
+ torture_assert(tctx, copy_passwd(tctx, &pwd, pwd_p), __location__);
}
return true;
@@ -155,13 +162,17 @@ static bool copy_group(struct torture_context *tctx,
int i;
g->gr_name = talloc_strdup(tctx, grp->gr_name);
+ torture_assert(tctx, (g->gr_name != NULL || grp->gr_name == NULL), __location__);
g->gr_passwd = talloc_strdup(tctx, grp->gr_passwd);
+ torture_assert(tctx, (g->gr_passwd != NULL || grp->gr_passwd == NULL), __location__);
g->gr_gid = grp->gr_gid;
g->gr_mem = NULL;
for (i=0; grp->gr_mem && grp->gr_mem[i]; i++) {
g->gr_mem = talloc_realloc(tctx, g->gr_mem, char *, i + 2);
+ torture_assert(tctx, (g->gr_mem != NULL), __location__);
g->gr_mem[i] = talloc_strdup(g->gr_mem, grp->gr_mem[i]);
+ torture_assert(tctx, (g->gr_mem[i] != NULL), __location__);
g->gr_mem[i+1] = NULL;
}
@@ -192,19 +203,24 @@ static bool test_getgrnam(struct torture_context *tctx,
struct group *grp_p)
{
struct group *grp;
+ int ret;
torture_comment(tctx, "Testing getgrnam: %s\n", name);
+ errno = 0;
grp = getgrnam(name);
- if (grp) {
- print_group(grp);
- }
+ ret = errno;
+ torture_assert(tctx, (grp != NULL), talloc_asprintf(tctx,
+ "getgrnam(%s) failed - %d - %s",
+ name, ret, strerror(ret)));
+
+ print_group(grp);
- if (grp_p) {
- copy_group(tctx, grp, grp_p);
+ if (grp_p != NULL) {
+ torture_assert(tctx, copy_group(tctx, grp, grp_p), __location__);
}
- return grp ? true : false;
+ return true;
}
static bool test_getgrnam_r(struct torture_context *tctx,
@@ -218,17 +234,14 @@ static bool test_getgrnam_r(struct torture_context *tctx,
torture_comment(tctx, "Testing getgrnam_r: %s\n", name);
ret = getgrnam_r(name, &grp, buffer, sizeof(buffer), &grpp);
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- return false;
- }
+ torture_assert(tctx, ret == 0, talloc_asprintf(tctx,
+ "getgrnam_r(%s) failed - %d - %s",
+ name, ret, strerror(ret)));
print_group(&grp);
- if (grp_p) {
- copy_group(tctx, &grp, grp_p);
+ if (grp_p != NULL) {
+ torture_assert(tctx, copy_group(tctx, &grp, grp_p), __location__);
}
return true;
@@ -240,19 +253,24 @@ static bool test_getgrgid(struct torture_context *tctx,
struct group *grp_p)
{
struct group *grp;
+ int ret;
torture_comment(tctx, "Testing getgrgid: %lu\n", (unsigned long)gid);
+ errno = 0;
grp = getgrgid(gid);
- if (grp) {
- print_group(grp);
- }
+ ret = errno;
+ torture_assert(tctx, (grp != NULL), talloc_asprintf(tctx,
+ "getgrgid(%lu) failed - %d - %s",
+ (unsigned long)gid, ret, strerror(ret)));
+
+ print_group(grp);
- if (grp_p) {
- copy_group(tctx, grp, grp_p);
+ if (grp_p != NULL) {
+ torture_assert(tctx, copy_group(tctx, grp, grp_p), __location__);
}
- return grp ? true : false;
+ return true;
}
static bool test_getgrgid_r(struct torture_context *tctx,
@@ -266,17 +284,14 @@ static bool test_getgrgid_r(struct torture_context *tctx,
torture_comment(tctx, "Testing getgrgid_r: %lu\n", (unsigned long)gid);
ret = getgrgid_r(gid, &grp, buffer, sizeof(buffer), &grpp);
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- return false;
- }
+ torture_assert(tctx, ret == 0, talloc_asprintf(tctx,
+ "getgrgid_r(%lu) failed - %d - %s",
+ (unsigned long)gid, ret, strerror(ret)));
print_group(&grp);
- if (grp_p) {
- copy_group(tctx, &grp, grp_p);
+ if (grp_p != NULL) {
+ torture_assert(tctx, copy_group(tctx, &grp, grp_p), __location__);
}
return true;
@@ -391,14 +406,17 @@ static bool test_passwd(struct torture_context *tctx)
for (i=0; i < num_pwd; i++) {
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
+ "getpwent and getpwnam gave different results"),
+ __location__);
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");
- torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
- "getpwnam and getpwuid gave different results");
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
+ "getpwent and getpwuid gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
+ "getpwnam and getpwuid gave different results"),
+ __location__);
}
return true;
@@ -416,14 +434,17 @@ static bool test_passwd_r(struct torture_context *tctx)
for (i=0; i < num_pwd; i++) {
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
+ "getpwent_r and getpwnam_r gave different results"),
+ __location__);
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
+ "getpwent_r and getpwuid_r gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
+ "getpwnam_r and getpwuid_r gave different results"),
+ __location__);
}
return true;
@@ -441,24 +462,30 @@ static bool test_passwd_r_cross(struct torture_context *tctx)
for (i=0; i < num_pwd; i++) {
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
+ "getpwent_r and getpwnam_r gave different results"),
+ __location__);
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
+ "getpwent_r and getpwuid_r gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
+ "getpwnam_r and getpwuid_r gave different results"),
+ __location__);
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, torture_assert_passwd_equal(tctx, &pwd[i], &pwd3,
+ "getpwent_r and getpwnam gave different results"),
+ __location__);
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");
- torture_assert_passwd_equal(tctx, &pwd3, &pwd4,
- "getpwnam and getpwuid gave different results");
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd[i], &pwd4,
+ "getpwent_r and getpwuid gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_passwd_equal(tctx, &pwd3, &pwd4,
+ "getpwnam and getpwuid gave different results"),
+ __location__);
}
return true;
@@ -554,12 +581,8 @@ static bool torture_assert_group_equal(struct torture_context *tctx,
torture_assert_str_equal(tctx, g1->gr_name, g2->gr_name, comment);
torture_assert_str_equal(tctx, g1->gr_passwd, g2->gr_passwd, comment);
torture_assert_int_equal(tctx, g1->gr_gid, g2->gr_gid, comment);
- if (g1->gr_mem && !g2->gr_mem) {
- return false;
- }
- if (!g1->gr_mem && g2->gr_mem) {
- return false;
- }
+ torture_assert(tctx, !(g1->gr_mem && !g2->gr_mem), __location__);
+ torture_assert(tctx, !(!g1->gr_mem && g2->gr_mem), __location__);
if (!g1->gr_mem && !g2->gr_mem) {
return true;
}
@@ -582,14 +605,17 @@ static bool test_group(struct torture_context *tctx)
for (i=0; i < num_grp; i++) {
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, torture_assert_group_equal(tctx, &grp[i], &grp1,
+ "getgrent and getgrnam gave different results"),
+ __location__);
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");
- torture_assert_group_equal(tctx, &grp1, &grp2,
- "getgrnam and getgrgid gave different results");
+ torture_assert(tctx, torture_assert_group_equal(tctx, &grp[i], &grp2,
+ "getgrent and getgrgid gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_group_equal(tctx, &grp1, &grp2,
+ "getgrnam and getgrgid gave different results"),
+ __location__);
}
return true;
@@ -607,14 +633,17 @@ static bool test_group_r(struct torture_context *tctx)
for (i=0; i < num_grp; i++) {
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, torture_assert_group_equal(tctx, &grp[i], &grp1,
+ "getgrent_r and getgrnam_r gave different results"),
+ __location__);
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, torture_assert_group_equal(tctx, &grp[i], &grp2,
+ "getgrent_r and getgrgid_r gave different results"),
+ __location__);
+ torture_assert(tctx, torture_assert_group_equal(tctx, &grp1, &grp2,
--
Samba Shared Repository
More information about the samba-cvs
mailing list