From c664859a128ea7bbc05ac59a6b8384638e8cea4a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 16 May 2014 14:30:43 +1200 Subject: [PATCH] selftest: Test auth_wbc, the auth4 winbind and winbind_wbclient modules using pdbtest This ensures these authentication modules continue to operate correctly, and that the results are consistent. Andrew Bartlett Change-Id: I7f63cd93e55c6f73ceeafb14f1dc265291791803 Signed-off-by: Andrew Bartlett Reviewed-by: Andreas Schneider Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri May 16 12:50:44 CEST 2014 on sn-devel-104 --- selftest/target/Samba3.pm | 8 +++++--- selftest/target/Samba4.pm | 3 +++ source4/selftest/tests.py | 6 +++++- testprogs/blackbox/test_pdbtest.sh | 41 +++++++++++++++++++------------------- 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 9606d5b09a5..489fec1c132 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -935,10 +935,10 @@ sub provision($$$$$$) ## my ($max_uid, $max_gid); - my ($uid_nobody, $uid_root, $uid_pdbtest); + my ($uid_nobody, $uid_root, $uid_pdbtest, $uid_pdbtest2); my ($gid_nobody, $gid_nogroup, $gid_root, $gid_domusers, $gid_domadmins); - if ($unix_uid < 0xffff - 2) { + if ($unix_uid < 0xffff - 4) { $max_uid = 0xffff; } else { $max_uid = $unix_uid; @@ -947,8 +947,9 @@ sub provision($$$$$$) $uid_root = $max_uid - 1; $uid_nobody = $max_uid - 2; $uid_pdbtest = $max_uid - 3; + $uid_pdbtest2 = $max_uid - 4; - if ($unix_gids[0] < 0xffff - 3) { + if ($unix_gids[0] < 0xffff - 5) { $max_gid = 0xffff; } else { $max_gid = $unix_gids[0]; @@ -1180,6 +1181,7 @@ sub provision($$$$$$) print PASSWD "nobody:x:$uid_nobody:$gid_nobody:nobody gecos:$prefix_abs:/bin/false $unix_name:x:$unix_uid:$unix_gids[0]:$unix_name gecos:$prefix_abs:/bin/false pdbtest:x:$uid_pdbtest:$gid_nogroup:pdbtest gecos:$prefix_abs:/bin/false +pdbtest2:x:$uid_pdbtest2:$gid_nogroup:pdbtest gecos:$prefix_abs:/bin/false "; if ($unix_uid != 0) { print PASSWD "root:x:$uid_root:$gid_root:root gecos:$prefix_abs:/bin/false diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 15fb5d2c53c..4e7cbd59058 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -679,6 +679,9 @@ root:x:0:0:root gecos:$ctx->{prefix_abs}:/bin/false $ctx->{unix_name}:x:$ctx->{unix_uid}:100:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false nobody:x:65534:65533:nobody gecos:$ctx->{prefix_abs}:/bin/false pdbtest:x:65533:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false +pdbtest2:x:65532:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false +pdbtest3:x:65531:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false +pdbtest4:x:65530:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false "; close(PWD); my $uid_rfc2307test = 65533; diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 4bf02f303bc..58373225258 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -167,7 +167,11 @@ for env in ["dc", "s3dc"]: "-k no --option=usespnego=no"]: name = "rpc.lsa.secrets on %s with with %s" % (transport, ntlmoptions) plansmbtorture4testsuite('rpc.lsa.secrets', env, ["%s:$SERVER[]" % (transport), ntlmoptions, '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN', '--option=gensec:target_hostname=$NETBIOSNAME'], "samba4.%s" % name) - plantestsuite("samba.blackbox.pdbtest", "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", smbclient4, '$SMB_CONF_PATH', configuration]) + plantestsuite("samba.blackbox.pdbtest(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest", smbclient4, '$SMB_CONF_PATH', configuration]) + plantestsuite("samba.blackbox.pdbtest.winbind(%s)" % env, "%s:local" % env, [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest2", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=wbc'"]) + +plantestsuite("samba.blackbox.pdbtest.s4winbind(dc)", "dc:local", [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest3", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=samba4:winbind'"]) +plantestsuite("samba.blackbox.pdbtest.s4winbind_wbclient(dc)", "dc:local", [os.path.join(bbdir, "test_pdbtest.sh"), '$SERVER', "$PREFIX", "pdbtest4", smbclient4, '$SMB_CONF_PATH', configuration + " --option='authmethods=samba4:winbind_wbclient'"]) transports = ["ncacn_np", "ncacn_ip_tcp"] diff --git a/testprogs/blackbox/test_pdbtest.sh b/testprogs/blackbox/test_pdbtest.sh index 77865a09ec5..05314dd2f55 100755 --- a/testprogs/blackbox/test_pdbtest.sh +++ b/testprogs/blackbox/test_pdbtest.sh @@ -5,16 +5,17 @@ if [ $# -lt 2 ]; then cat <