From 67bf7a2396051d10c07aeaa2d8b373a96a44d892 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 28 Jan 2009 22:15:44 +0100 Subject: selftest: fix Samba3 bugs metze --- selftest/selftest.pl | 1 + selftest/target/Samba3.pm | 34 ++++++++++++++++++---------------- source3/Makefile.in | 3 ++- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/selftest/selftest.pl b/selftest/selftest.pl index d47261da79..dc754efa17 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -580,6 +580,7 @@ sub write_clientconf($$) } if (defined($vars->{WINBINDD_SOCKET_DIR})) { print CF "\twinbindd socket directory = $vars->{WINBINDD_SOCKET_DIR}\n"; + print CF "\twinbindd:socket dir = $vars->{WINBINDD_SOCKET_DIR}\n"; } if ($opt_socket_wrapper) { print CF "\tinterfaces = $interfaces\n"; diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 0a9dd79fc8..2b2f6a51b5 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -265,7 +265,6 @@ sub create_clientconf($$$) my $logdir = "$prefix/logs"; my $piddir = "$prefix/pid"; my $privatedir = "$prefix/private"; - my $scriptdir = "$RealBin/.."; my $conffile = "$prefix/smb.conf"; my $torture_interfaces='127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8'; @@ -284,7 +283,7 @@ sub create_clientconf($$$) netbios name = TORTURE_6 interfaces = $torture_interfaces - panic action = $scriptdir/gdb_backtrace \%d %\$(MAKE_TEST_BINARY) + panic action = $RealBin/gdb_backtrace \%d %\$(MAKE_TEST_BINARY) passdb backend = tdbsam "; @@ -308,10 +307,7 @@ sub provision($$$$$$) my $unix_uid = $>; my $unix_gids_str = $); my @unix_gids = split(" ", $unix_gids_str); - my $password = "test"; - my $srcdir="$RealBin/.."; - my $scriptdir="$srcdir/selftest"; my $prefix_abs = abs_path($prefix); my $bindir_abs = abs_path($self->{bindir}); @@ -349,7 +345,7 @@ sub provision($$$$$$) my $conffile="$libdir/server.conf"; - my $nss_wrapper_pl = "$ENV{PERL} $srcdir/../lib/nss_wrapper/nss_wrapper.pl"; + my $nss_wrapper_pl = "$ENV{PERL} $RealBin/../lib/nss_wrapper/nss_wrapper.pl"; my $nss_wrapper_passwd = "$privatedir/passwd"; my $nss_wrapper_group = "$privatedir/group"; @@ -359,7 +355,7 @@ sub provision($$$$$$) netbios name = $server interfaces = $server_ip/8 bind interfaces only = yes - panic action = $scriptdir/gdb_backtrace %d %\$(MAKE_TEST_BINARY) + panic action = $RealBin/gdb_backtrace %d %\$(MAKE_TEST_BINARY) workgroup = $domain @@ -408,8 +404,13 @@ sub provision($$$$$$) # End extra options #Include user defined custom parameters if set - $ENV{INCLUDE_CUSTOM_CONF} +"; + + if (defined($ENV{INCLUDE_CUSTOM_CONF})) { + print CONF "\t$ENV{INCLUDE_CUSTOM_CONF}\n"; + } + print CONF " [tmp] path = $shrdir [hideunread] @@ -436,15 +437,13 @@ sub provision($$$$$$) ## open(PASSWD, ">$nss_wrapper_passwd") or die("Unable to open $nss_wrapper_passwd"); - print PASSWD " -nobody:x:65534:65533:nobody gecos:$prefix_abs:/bin/false + print PASSWD "nobody:x:65534:65533:nobody gecos:$prefix_abs:/bin/false $unix_name:x:$unix_uid:$unix_gids[0]:$unix_name gecos:$prefix_abs:/bin/false "; close(PASSWD); open(GROUP, ">$nss_wrapper_group") or die("Unable to open $nss_wrapper_group"); - print GROUP " -nobody:x:65533: + print GROUP "nobody:x:65533: nogroup:x:65534:nobody $unix_name-group:x:$unix_gids[0]: "; @@ -457,15 +456,18 @@ $unix_name-group:x:$unix_gids[0]: print PWD "$password\n$password\n"; close(PWD) or die("Unable to set password for test account"); - $ENV{NSS_WRAPPER_PASSWD} = undef; - $ENV{NSS_WRAPPER_GROUP} = undef; + delete $ENV{NSS_WRAPPER_PASSWD}; + delete $ENV{NSS_WRAPPER_GROUP}; print "DONE\n"; $ret{SERVER_IP} = $server_ip; $ret{NMBD_TEST_LOG} = "$prefix/nmbd_test.log"; + $ret{NMBD_TEST_LOG_POS} = 0; $ret{WINBINDD_TEST_LOG} = "$prefix/winbindd_test.log"; + $ret{WINBINDD_TEST_LOG_POS} = 0; $ret{SMBD_TEST_LOG} = "$prefix/smbd_test.log"; + $ret{SMBD_TEST_LOG_POS} = 0; $ret{SERVERCONFFILE} = $conffile; $ret{CONFIGURATION} ="-s $conffile"; $ret{SERVER} = $server; @@ -476,7 +478,7 @@ $unix_name-group:x:$unix_gids[0]: $ret{PIDDIR} = $piddir; $ret{WINBINDD_SOCKET_DIR} = $wbsockdir; $ret{WINBINDD_PRIV_PIPE_DIR} = $wbsockprivdir; - $ret{SOCKET_WRAPPER_DEFAULT_IFACE} => $swiface, + $ret{SOCKET_WRAPPER_DEFAULT_IFACE} = $swiface; $ret{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd; $ret{NSS_WRAPPER_GROUP} = $nss_wrapper_group; @@ -504,7 +506,7 @@ sub wait_for_start($$) print "creating BUILTIN\\Administrators\n"; $ENV{WINBINDD_SOCKET_DIR} = $envvars->{WINBINDD_SOCKET_DIR}; system($self->binpath("net") ." $envvars->{CONFIGURATION} sam createbuiltingroup Administrators"); - $ENV{WINBINDD_SOCKET_DIR} = undef; + delete $ENV{WINBINDD_SOCKET_DIR}; print $self->getlog_env($envvars); } diff --git a/source3/Makefile.in b/source3/Makefile.in index e786a81efa..b3978eae40 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -2954,7 +2954,8 @@ selftestdir = ../selftest S3_LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)="$(builddir)/bin" selftest:: all torture timelimit - @$(S3_LD_LIBPATH_OVERRIDE) $(selftestdir)/selftest.pl \ + @$(S3_LD_LIBPATH_OVERRIDE) PERL="$(PERL)" \ + $(PERL) $(selftestdir)/selftest.pl \ --prefix=${selftest_prefix} --target=samba3 \ --testlist="$(srcdir)/selftest/tests.sh|" \ --expected-failures=$(srcdir)/selftest/knownfail \ -- cgit