diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-22 13:00:21 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-29 04:24:07 +0200 |
commit | 8f13c84dcecb769e4ba85fa120d9ac4ac772223e (patch) | |
tree | ce4154a1c26289ebcd132e379657b4a1fcc2cc98 | |
parent | 2b47aface434000b29aa29f4ff6348cc147ae757 (diff) | |
download | samba-8f13c84dcecb769e4ba85fa120d9ac4ac772223e.tar.gz samba-8f13c84dcecb769e4ba85fa120d9ac4ac772223e.tar.bz2 samba-8f13c84dcecb769e4ba85fa120d9ac4ac772223e.zip |
s3-selftest Add tests for 'map to guest = bad user'
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r-- | selftest/target/Samba3.pm | 32 | ||||
-rwxr-xr-x | source3/selftest/tests.py | 5 |
2 files changed, 36 insertions, 1 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 49f8b4d6d3..93b999fbb4 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -95,6 +95,8 @@ sub setup_env($$$) return $self->setup_s3dc("$path/s3dc"); } elsif ($envname eq "secshare") { return $self->setup_secshare("$path/secshare"); + } elsif ($envname eq "maptoguest") { + return $self->setup_maptoguest("$path/maptoguest"); } elsif ($envname eq "ktest") { return $self->setup_ktest("$path/ktest"); } elsif ($envname eq "secserver") { @@ -472,6 +474,36 @@ $ret->{USERNAME} = KTEST\\Administrator return $ret; } +sub setup_maptoguest($$) +{ + my ($self, $path) = @_; + + print "PROVISIONING maptoguest..."; + + my $options = " +map to guest = bad user +"; + + my $vars = $self->provision($path, + "maptoguest", + 7, + "maptoguestpass", + $options); + + $vars or return undef; + + $self->check_or_start($vars, + "yes", "no", "yes"); + + if (not $self->wait_for_start($vars)) { + return undef; + } + + $self->{vars}->{s3maptoguest} = $vars; + + return $vars; +} + sub stop_sig_term($$) { my ($self, $pid) = @_; kill("USR1", $pid) or kill("ALRM", $pid) or warn("Unable to kill $pid: $!"); diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 0b0da7f934..b6fb166fe0 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -108,9 +108,12 @@ for env in ["secserver"]: for env in ["member"]: plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER\\\\$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration]) -for env in ["secshare", "secserver"]: +for env in ["maptoguest", "secshare", "secserver"]: plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"]) +env = "maptoguest" +plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) bad username" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', 'notmy$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"]) + # plain for env in ["s3dc"]: plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), configuration]) |