summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-11-29 23:22:49 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:54 +0100
commitcd5eb29f1f6fbc2213f316a528ffb9bf31f1d095 (patch)
tree31b8a3a76b9a22d02e49837ac26834d335f7644f
parentb32cbeafb2f9815cad30942bafa72895ff67b490 (diff)
downloadsamba-cd5eb29f1f6fbc2213f316a528ffb9bf31f1d095.tar.gz
samba-cd5eb29f1f6fbc2213f316a528ffb9bf31f1d095.tar.bz2
samba-cd5eb29f1f6fbc2213f316a528ffb9bf31f1d095.zip
r26212: Make test_NetrJoinDomain2() a little more robust against missing parameters.
Guenther (This used to be commit 08aad347e8fd25f480ecf9b1283575012792cf71)
-rw-r--r--source4/torture/rpc/wkssvc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index 5e0be1f5b5..f82238da61 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -1198,10 +1198,11 @@ static bool test_NetrJoinDomain2(struct torture_context *tctx,
struct wkssvc_NetrJoinDomain2 r;
const char *domain_admin_account = NULL;
const char *domain_admin_password = NULL;
+ const char *domain_name = NULL;
struct wkssvc_PasswordBuffer pwd_buf;
enum wkssvc_NetJoinStatus join_status;
const char *join_name = NULL;
- WERROR expected_err = WERR_OK;
+ WERROR expected_err;
/* FIXME: this test assumes to join workstations / servers and does not
* handle DCs (WERR_SETUP_DOMAIN_CONTROLLER) */
@@ -1218,6 +1219,8 @@ static bool test_NetrJoinDomain2(struct torture_context *tctx,
case NetSetupUnknownStatus:
case NetSetupUnjoined:
case NetSetupWorkgroupName:
+ default:
+ expected_err = WERR_OK;
break;
}
@@ -1229,6 +1232,17 @@ static bool test_NetrJoinDomain2(struct torture_context *tctx,
"torture",
"domain_admin_password");
+ domain_name = lp_parm_string(global_loadparm, NULL,
+ "torture",
+ "domain_name");
+
+ if ((domain_admin_account == NULL) ||
+ (domain_admin_password == NULL) ||
+ (domain_name == NULL)) {
+ torture_comment(tctx, "not enough input parameter\n");
+ return false;
+ }
+
if (!encode_wkssvc_join_password_buffer(tctx, p,
domain_admin_password,
&pwd_buf))
@@ -1237,7 +1251,7 @@ static bool test_NetrJoinDomain2(struct torture_context *tctx,
}
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_realm(global_loadparm);
+ r.in.domain_name = domain_name;
r.in.account_ou = NULL;
r.in.admin_account = domain_admin_account;
r.in.encrypted_password = &pwd_buf;