summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/samba3rpc.c
diff options
context:
space:
mode:
authorJamie McClymont <jamiemcclymont@catalyst.net.nz>2017-12-06 12:49:48 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-12-20 04:22:10 +0100
commitbfcbc9be612bf947f4238208b5a35a715ec36007 (patch)
tree46e01fcc8d8e1fecfb037f14acb5b8f01af2aece /source4/torture/rpc/samba3rpc.c
parentef240aaca0ef693a96726ac2366c454294b87b96 (diff)
downloadsamba-bfcbc9be612bf947f4238208b5a35a715ec36007.tar.gz
selftest: fix samba3.rpc.samba3.netlogon running after an nt4_member test
samba3.rpc.samba3.netlogon is using get_myname to find a username with which to perform a join. This means that the test tries to join with the existing localnt4dc2 user, which happens to work if get_myname is working correctly (which it isn't -- see next commit about NSS_WRAPPER_HOSTNAME!) This commit fixes a test run with, for example: TESTS="samba3.blackbox.smbclient_ntlm.plain samba3.rpc.samba3.netlogon" (given samba3.blackbox.smbclient_ntlm.plain is in the nt4_member env) ...which previously failed due to the combination of this and the NSS_WRAPPER_HOSTNAME bug. Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/rpc/samba3rpc.c')
-rw-r--r--source4/torture/rpc/samba3rpc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 54239d4812e..9cd479c9baf 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -1373,9 +1373,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
struct smbcli_session_options session_options;
wks_name = torture_setting_string(torture, "wksname", NULL);
- if (wks_name == NULL) {
- wks_name = get_myname(torture);
- }
+ torture_assert(torture, wks_name != NULL, "wksname not set");
lpcfg_smbcli_options(torture->lp_ctx, &options);
lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
@@ -1513,7 +1511,9 @@ static bool torture_samba3_sessionkey(struct torture_context *torture)
struct cli_credentials *anon_creds;
const char *wks_name;
- wks_name = torture_setting_string(torture, "wksname", get_myname(torture));
+
+ wks_name = torture_setting_string(torture, "wksname", NULL);
+ torture_assert(torture, wks_name != NULL, "wksname not set");
if (!(anon_creds = cli_credentials_init_anon(torture))) {
torture_fail(torture, "create_anon_creds failed\n");