def test_wbinfo(t):
t.info('Testing wbinfo')
t.chdir('${PREFIX}')
- t.cmd_contains("bin/wbinfo --version", ["Version 3."])
+ t.cmd_contains("bin/wbinfo --version", ["Version 4."])
t.cmd_contains("bin/wbinfo -p", ["Ping to winbindd succeeded"])
t.retry_cmd("bin/wbinfo --online-status",
["BUILTIN : online",
["plaintext password authentication succeeded",
"challenge/response password authentication succeeded"])
+ t.retry_cmd("bin/wbinfo --krb5auth=${WIN_DOMAIN}/administrator%${WIN_PASS}",
+ ["succeeded"])
+
def test_smbclient(t):
t.info('Testing smbclient')
+ smbclient = t.getvar("smbclient")
t.chdir('${PREFIX}')
- t.cmd_contains("bin/smbclient --version", ["Version 3."])
- t.cmd_contains('bin/smbclient -L ${INTERFACE_IP} -U%', ["Domain=[${WIN_DOMAIN}]", "test", "IPC$", "Samba 3."],
+ t.cmd_contains("%s --version" % (smbclient), ["Version 4."])
+ t.cmd_contains('%s -L ${INTERFACE_IP} -U%%' % (smbclient), ["Domain=[${WIN_DOMAIN}]", "test", "IPC$", "Samba 4."],
casefold=True)
- child = t.pexpect_spawn('bin/smbclient //${HOSTNAME}.${WIN_REALM}/test -Uroot@${WIN_REALM}%${PASSWORD2}')
+ child = t.pexpect_spawn('%s //${HOSTNAME}.${WIN_REALM}/test -Uroot@${WIN_REALM}%%${PASSWORD2}' % (smbclient))
child.expect("smb:")
child.sendline("dir")
child.expect("blocks available")
child.sendline("cd ..")
child.sendline("rmdir testdir")
- child = t.pexpect_spawn('bin/smbclient //${HOSTNAME}.${WIN_REALM}/test -Uroot@${WIN_REALM}%${PASSWORD2} -k')
+ child = t.pexpect_spawn('%s //${HOSTNAME}.${WIN_REALM}/test -Uroot@${WIN_REALM}%%${PASSWORD2} -k' % (smbclient))
child.expect("smb:")
child.sendline("dir")
child.expect("blocks available")
child.sendline("cd ..")
child.sendline("rmdir testdir")
-
def create_shares(t):
t.info("Adding test shares")
t.chdir('${PREFIX}')
- t.write_file("lib/smb.conf", '''
+ t.write_file("etc/smb.conf", '''
[test]
path = ${PREFIX}/test
read only = no
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_time=True)
t.get_ipconfig(child)
t.del_files(["var", "private"])
- t.write_file("lib/smb.conf", '''
+ t.write_file("etc/smb.conf", '''
[global]
netbios name = ${HOSTNAME}
log level = ${DEBUGLEVEL}
t.cmd_contains("host -t A ${HOSTNAME}.${WIN_REALM}",
['${HOSTNAME}.${WIN_REALM} has address'])
-
-def test_join_as_member(t, vm):
- '''test the domain join'''
+def create_root_account(t, vm):
t.setwinvars(vm)
- t.info('Testing join as member')
+ t.info("Creating 'root' account for testing Samba3 member server")
t.chdir('${PREFIX}')
t.run_cmd('bin/net ads user add root -Uadministrator%${WIN_PASS}')
child = t.pexpect_spawn('bin/net ads password root -Uadministrator%${WIN_PASS}')
child.expect("net rpc>")
child.sendline("user edit disabled root no")
child.expect("Set root's disabled flag")
+
+def test_join_as_member(t, vm):
+ '''test the domain join'''
+ t.setwinvars(vm)
+ t.info('Testing join as member')
+ t.chdir('${PREFIX}')
test_wbinfo(t)
test_smbclient(t)
def test_s3(t):
'''basic s3 testing'''
- t.setvar("SAMBA_VERSION", "Version 3")
+ t.setvar("SAMBA_VERSION", "Version 4")
+ t.setvar("smbclient", "bin/smbclient")
t.check_prerequesites()
set_libpath(t)
join_as_member(t, "W2K8R2A")
create_shares(t)
start_s3(t)
+ create_root_account(t, "W2K8R2A")
test_join_as_member(t, "W2K8R2A")
if t.have_var('WINDOWS7_VM') and t.have_var('W2K8R2A_VM') and not t.skip("join_windows7_2008r2"):
t.test_remote_smbclient('WINDOWS7', dom_username, dom_password, args='--option=clientntlmv2auth=no')
t.test_remote_smbclient('WINDOWS7', "%s@%s" % (dom_username, dom_realm), dom_password, args="-k")
t.test_remote_smbclient('WINDOWS7', "%s@%s" % (dom_username, dom_realm), dom_password, args="-k --option=clientusespnegoprincipal=yes")
+ t.test_net_use('WINDOWS7', dom_realm, t.getvar("W2K8R2A_DOMAIN"), 'root', '${PASSWORD2}')
if t.have_var('WINXP_VM') and t.have_var('W2K8R2A_VM') and not t.skip("join_winxp_2008r2"):
if not dc_started:
t.test_remote_smbclient('WINXP', dom_username, dom_password, args='--option=clientntlmv2auth=no')
t.test_remote_smbclient('WINXP', "%s@%s" % (dom_username, dom_realm), dom_password, args="-k")
t.test_remote_smbclient('WINXP', "%s@%s" % (dom_username, dom_realm), dom_password, args="-k --clientusespnegoprincipal=yes")
+ t.test_net_use('WINXP', dom_realm, t.getvar("W2K8R2A_DOMAIN"), 'root', '${PASSWORD2}')
t.info("S3 test: All OK")