summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-03-16 15:00:57 +0100
committerGünther Deschner <gd@samba.org>2011-03-16 15:51:12 +0100
commite084edc16ea909d99453ef7663e0f5ada081fe22 (patch)
tree13ff9e00cba9fa59e03649937d05bda16e5ebe7c /source4/torture
parentbe55bbc575ecc0e17bfeac7053050efd4178ead6 (diff)
downloadsamba-e084edc16ea909d99453ef7663e0f5ada081fe22.tar.gz
samba-e084edc16ea909d99453ef7663e0f5ada081fe22.tar.bz2
samba-e084edc16ea909d99453ef7663e0f5ada081fe22.zip
s4-smbtorture: use torture_fail and _assert macros in torture_netlogon_samba3().
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Mar 16 15:51:12 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/samba3rpc.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 844527237c..74450a6589 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -1296,7 +1296,6 @@ static bool leave(struct torture_context *tctx,
static bool torture_netlogon_samba3(struct torture_context *torture)
{
NTSTATUS status;
- bool ret = false;
struct smbcli_state *cli;
struct cli_credentials *anon_creds;
struct cli_credentials *wks_creds;
@@ -1311,8 +1310,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
}
if (!(anon_creds = cli_credentials_init_anon(torture))) {
- torture_comment(torture, "create_anon_creds failed\n");
- goto done;
+ torture_fail(torture, "create_anon_creds failed\n");
}
lpcfg_smbcli_options(torture->lp_ctx, &options);
@@ -1327,16 +1325,11 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx));
- if (!NT_STATUS_IS_OK(status)) {
- torture_comment(torture, "smbcli_full_connection failed: %s\n",
- nt_errstr(status));
- goto done;
- }
+ torture_assert_ntstatus_ok(torture, status, "smbcli_full_connection failed\n");
wks_creds = cli_credentials_init(torture);
if (wks_creds == NULL) {
- torture_comment(torture, "cli_credentials_init failed\n");
- goto done;
+ torture_fail(torture, "cli_credentials_init failed\n");
}
cli_credentials_set_conf(wks_creds, torture->lp_ctx);
@@ -1347,10 +1340,9 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
generate_random_password(wks_creds, 8, 255),
CRED_SPECIFIED);
- if (!join3(torture, cli, false, cmdline_credentials, wks_creds)) {
- torture_comment(torture, "join failed\n");
- goto done;
- }
+ torture_assert(torture,
+ join3(torture, cli, false, cmdline_credentials, wks_creds),
+ "join failed");
cli_credentials_set_domain(
cmdline_credentials, cli_credentials_get_domain(wks_creds),
@@ -1364,28 +1356,22 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
int j;
- if (!auth2(torture, cli, wks_creds)) {
- torture_comment(torture, "auth2 failed\n");
- goto done;
- }
+ torture_assert(torture,
+ auth2(torture, cli, wks_creds),
+ "auth2 failed");
for (j=0; j<2; j++) {
- if (!schan(torture, cli, wks_creds, cmdline_credentials)) {
- torture_comment(torture, "schan failed\n");
- goto done;
- }
+ torture_assert(torture,
+ schan(torture, cli, wks_creds, cmdline_credentials),
+ "schan failed");
}
}
- if (!leave(torture, cli, cmdline_credentials, wks_creds)) {
- torture_comment(torture, "leave failed\n");
- goto done;
- }
-
- ret = true;
+ torture_assert(torture,
+ leave(torture, cli, cmdline_credentials, wks_creds),
+ "leave failed");
- done:
- return ret;
+ return true;
}
/*