The branch, master has been updated via e78d465 Revert "s3-test: disable ktest for now" via 4cdbb88 s3-selftest actually wait for smbclient to connect via 1862e90 s3-selftest Fix use of the 'fake DNS' file via 1367e2b wintest Allow setting of the firewall to fail via e410a1a s3-wintest Add test of 'net use' against the Samba3 member via 9ced0df wintest Allow changing the telnet settings to fail, we might not be admin via 36029a0 samba_dnsupdate: Don't use subprocess.check_call, it isn't in python 2.4 from 77820d5 s3-test: disable ktest for now
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e78d4652fa7feade5fcae76fd84b60e204803b61 Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 13:11:04 2011 +1000 Revert "s3-test: disable ktest for now" This reverts commit 77820d59fe517168db5cb79b05214ae9fd6b4467. I beleive this is now reliable, after the changes to wait for an actual connection at startup and to use the fake DNS file. Andrew Bartlett Autobuild-User: Andrew Bartlett <abart...@samba.org> Autobuild-Date: Thu Apr 7 07:20:03 CEST 2011 on sn-devel-104 commit 4cdbb88c4b5319b0818a612dc7956b7ac213df19 Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 13:07:23 2011 +1000 s3-selftest actually wait for smbclient to connect This means that we actually have a working smbd. The previous code didn't know if it worked or not, and so created flaky tests. Andrew Bartlett commit 1862e904a821e2cd6132ab1d13b02da123edd94e Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 12:33:34 2011 +1000 s3-selftest Fix use of the 'fake DNS' file This ensures we don't use netbios before the hosts file and that we do fill in the fake DNS zone correctly for the way we invoke smbtorture4. Currently this works because the realm in client.conf is "", if this changes then this will need to change too (perhaps an additional entry). Andrew Bartlett commit 1367e2b303bb11f26552ee511a823ea551e98cbd Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 14:06:31 2011 +1000 wintest Allow setting of the firewall to fail This is also required to allow a telnet connection as non-admin. Andrew Bartlett commit e410a1af30467b2f1defd24cb17f5b53d30df7f9 Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 08:54:52 2011 +1000 s3-wintest Add test of 'net use' against the Samba3 member commit 9ced0df3794901b65d6329ba0d2f9d82f759cdac Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 12:25:30 2011 +1000 wintest Allow changing the telnet settings to fail, we might not be admin This allows us to test logging in as non-admin users over telnet commit 36029a0343c1c4221b84b3b1ee0e7c841f75d1d6 Author: Andrew Bartlett <abart...@samba.org> Date: Thu Apr 7 07:34:47 2011 +1000 samba_dnsupdate: Don't use subprocess.check_call, it isn't in python 2.4 RHEL5 and clones use python 2.5 ----------------------------------------------------------------------- Summary of changes: selftest/selftest.pl | 2 +- selftest/target/Samba3.pm | 18 +++++++++++++++--- source3/selftest/knownfail | 1 - source4/scripting/bin/samba_dnsupdate | 9 ++++++++- wintest/test-s3.py | 16 +++++++++++----- wintest/wintest.py | 11 +++++++++-- 6 files changed, 44 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 9db3f21..fbb36a2 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -596,7 +596,7 @@ sub write_clientconf($$$) private dir = $clientdir/private lock dir = $clientdir/lockdir ncalrpc dir = $clientdir/ncalrpcdir - name resolve order = bcast file + name resolve order = file bcast panic action = $RealBin/gdb_backtrace \%PID\% \%PROG\% max xmit = 32K notify:inotify = false diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index b6c851a..9a3be7d 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -813,7 +813,7 @@ domusers:X:$gid_domusers: print "DONE\n"; open(HOSTS, ">>$ENV{SELFTEST_PREFIX}/dns_host_file") or die("Unable to open $ENV{SELFTEST_PREFIX}/dns_host_file"); - print HOSTS "A $server $server_ip + print HOSTS "A $server. $server_ip "; close(HOSTS); @@ -858,11 +858,23 @@ sub wait_for_start($$) system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__"); system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}"); system($self->binpath("nmblookup") ." $envvars->{CONFIGURATION} $envvars->{SERVER}"); + # make sure smbd is also up set print "wait for smbd\n"; - system($self->binpath("smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER_IP} -U% -p 139 | head -2"); - system($self->binpath("smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER_IP} -U% -p 139 | head -2"); + my $count = 0; + my $ret; + do { + $ret = system($self->binpath("smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139"); + if ($ret != 0) { + sleep(2); + } + $count++ + } while ($ret != 0 && $count < 10); + if ($count == 10) { + print "SMBD failed to start up in a reasonable time (20sec)\n"; + exit 1; + } # Ensure we have domain users mapped. system($self->binpath("net") ." $envvars->{CONFIGURATION} groupmap add rid=513 unixgroup=domusers type=domain"); diff --git a/source3/selftest/knownfail b/source3/selftest/knownfail index d97bed2..95f01f6 100644 --- a/source3/selftest/knownfail +++ b/source3/selftest/knownfail @@ -12,4 +12,3 @@ samba3.posix_s3.nbt.dgram.*netlogon2 samba3.*rap.sam.*.useradd # Not provided by Samba 3 samba3.*rap.sam.*.userdelete # Not provided by Samba 3 samba3.*rap.basic.*.netsessiongetinfo # Not provided by Samba 3 -samba3.*ktest # ktest is currently flakey due to name resolution issues diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 99f898e..695bed6 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -263,7 +263,14 @@ def call_nsupdate(d): try: cmd = nsupdate_cmd[:] cmd.append(tmpfile) - subprocess.check_call(cmd, shell=False) + ret = subprocess.call(cmd, shell=False) + if ret != 0: + global error_count + if opts.fail_immediately: + sys.exit(1) + error_count = error_count + 1 + if opts.verbose: + print("Failed nsupdate: %d" % ret) except Exception, estr: global error_count if opts.fail_immediately: diff --git a/wintest/test-s3.py b/wintest/test-s3.py index 3002777..811e086 100755 --- a/wintest/test-s3.py +++ b/wintest/test-s3.py @@ -99,7 +99,6 @@ def test_smbclient(t): child.sendline("cd ..") child.sendline("rmdir testdir") - def create_shares(t): t.info("Adding test shares") t.chdir('${PREFIX}') @@ -156,11 +155,9 @@ def join_as_member(t, vm): 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}') @@ -172,6 +169,12 @@ def test_join_as_member(t, vm): 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) @@ -208,6 +211,7 @@ def test_s3(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"): @@ -228,6 +232,7 @@ def test_s3(t): 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', 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: @@ -246,6 +251,7 @@ def test_s3(t): 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', t.getvar("W2K8R2A_DOMAIN"), 'root', '${PASSWORD2}') t.info("S3 test: All OK") diff --git a/wintest/wintest.py b/wintest/wintest.py index 2a6da7d..d5728a8 100644 --- a/wintest/wintest.py +++ b/wintest/wintest.py @@ -571,13 +571,13 @@ options { def run_tlntadmn(self, child): '''remove the annoying telnet restrictions''' child.sendline('tlntadmn config maxconn=1024') - child.expect("The settings were successfully updated") + child.expect(["The settings were successfully updated", "Access is denied"]) child.expect("C:") def disable_firewall(self, child): '''remove the annoying firewall''' child.sendline('netsh advfirewall set allprofiles state off') - i = child.expect(["Ok", "The following command was not found: advfirewall set allprofiles state off"]) + i = child.expect(["Ok", "The following command was not found: advfirewall set allprofiles state off", "The requested operation requires elevation"]) child.expect("C:") if i == 1: child.sendline('netsh firewall set opmode mode = DISABLE profile = ALL') @@ -845,6 +845,13 @@ RebootOnCompletion=No self.cmd_contains("bin/smbclient --version", ["${SAMBA_VERSION}"]) self.retry_cmd('bin/smbclient -L ${WIN_HOSTNAME} -U%s%%%s %s' % (username, password, args), ["IPC"]) + def test_net_use(self, vm, domain, username, password): + self.setwinvars(vm) + self.info('Testing net use against Samba3 member') + child = self.open_telnet("${WIN_HOSTNAME}", "%s\\%s" % (domain, username), password) + child.sendline("net use t: \\\\${HOSTNAME}.${LCREALM}\\test") + child.expect("The command completed successfully") + def setup(self, testname, subdir): '''setup for main tests, parsing command line''' -- Samba Shared Repository