Rev 11811: Actually use client.conf,	defer more code as far as possible. in	file:///home/jelmer/bzr.samba/SAMBA_4_0/ At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11811
revision-id: jelmer@samba.org-20070409131517-82iejvs1yb3ja3er
parent: svn-v2:22136@0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij 
branch nick: SAMBA_4_0
timestamp: Mon 2007-04-09 15:15:17 +0200
message:
  Actually use client.conf, defer more code as far as possible.
modified:
  source/script/tests/mktestdc.sh svn-v2:21909@0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fmktestdc.sh
  source/script/tests/selftest.pl svn-v2:20693@0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.pl
=== modified file 'source/script/tests/mktestdc.sh'
--- a/source/script/tests/mktestdc.sh	2007-04-09 00:53:05 +0000
+++ b/source/script/tests/mktestdc.sh	2007-04-09 13:15:17 +0000
@@ -83,7 +83,6 @@
 	server max protocol = SMB2
 	notify:inotify = false
 	ldb:nosync = true
-
 	system:anonymous = true
 #We don't want to pass our self-tests if the PAC code is wrong
 	gensec:require_pac = true
@@ -273,8 +272,6 @@
 
 echo "KRB5_CONFIG=$KRB5_CONFIG"
 echo "PREFIX_ABS=$PREFIX_ABS"
-echo "CONFIGURATION=$CONFIGURATION"
-echo "CONFFILE=$CONFFILE"
 echo "SLAPD_CONF=$SLAPD_CONF"
 echo "PIDDIR=$PIDDIR"
 echo "AUTH=$AUTH"
@@ -290,7 +287,9 @@
 echo "SRCDIR=$SRCDIR"
 echo "PREFIX=$PREFIX"
 echo "LDAPDIR=$LDAPDIR"
+echo "CONFFILE=$CONFFILE"
 echo "PROVISION_OPTIONS=$PROVISION_OPTIONS"
 echo "PROVISION_ACI=$PROVISION_ACI"
 echo "WINBINDD_SOCKET_DIR=$WINBINDD_SOCKET_DIR"
 echo "NCALRPCDIR=$NCALRPCDIR"
+echo "CONFIGURATION=$CONFIGURATION"

=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl	2007-04-09 00:53:05 +0000
+++ b/source/script/tests/selftest.pl	2007-04-09 13:15:17 +0000
@@ -427,15 +427,6 @@
 	close(SKIP);
 }
 
-my $testenv_vars = $target->setup_env("dc", "$prefix/dc", $socket_wrapper_dir);
-
-SocketWrapper::set_default_iface(6);
-
-foreach ("PASSWORD", "DOMAIN", "SERVER", "CONFIGURATION", 
-	      "USERNAME", "NETBIOSNAME") {
-	$ENV{$_} = $testenv_vars->{$_};
-}
-
 my $interfaces = join(',', ("127.0.0.6/8", 
 		                 "127.0.0.7/8",
 						 "127.0.0.8/8",
@@ -443,33 +434,36 @@
 						 "127.0.0.10/8",
 						 "127.0.0.11/8"));
 
-
+my $testenv_vars = $target->setup_env("dc", "$prefix/dc", $socket_wrapper_dir);
 
 my $conffile = "$prefix/client.conf";
+my $abs_srcdir = cwd();
 open(CF, ">$conffile");
 print CF "[global]\\n";
 if (defined($ENV{VALGRIND})) {
-	print CF "iconv:native = true\\n";
+	print CF "\\ticonv:native = true\\n";
 } else {
-	print CF "iconv:native = false\\n";
+	print CF "\\ticonv:native = false\\n";
 }
-print CF "
+print CF 
+"	netbios name = localtest
+	netbios aliases = localhost
 	workgroup = $testenv_vars->{DOMAIN}
 	realm = $testenv_vars->{REALM}
+	pid directory = $testenv_vars->{PIDDIR}
 	ncalrpc dir = $testenv_vars->{NCALRPCDIR}
-	js include = $srcdir/scripting/libjs
+	js include = $abs_srcdir/scripting/libjs
 	winbindd socket directory = $testenv_vars->{WINBINDD_SOCKET_DIR}
 	name resolve order = bcast
 	interfaces = 127.0.0.1/8
-	panic action = $srcdir/script/gdb_backtrace \\%PID\\% \\%PROG\\%
+	panic action = $abs_srcdir/script/gdb_backtrace \\%PID\\% \\%PROG\\%
 	max xmit = 32K
 	notify:inotify = false
 	ldb:nosync = true
 	system:anonymous = true
 #We don't want to pass our self-tests if the PAC code is wrong
-	torture:basedir = st
+	torture:basedir = ./st
 	gensec:require_pac = true
-	pid directory = $testenv_vars->{PIDDIR}
 ";
 close(CF);
 
@@ -486,9 +480,14 @@
 $ENV{TORTURE_OPTIONS} = join(' ', @torture_options);
 print "OPTIONS $ENV{TORTURE_OPTIONS}\\n";
 
+foreach ("PASSWORD", "DOMAIN", "SERVER", "USERNAME", "NETBIOSNAME") {
+	$ENV{$_} = $testenv_vars->{$_};
+}
+
 my @todo = ();
 
 my $testsdir = "$srcdir/script/tests";
+$ENV{CONFIGURATION} = "--configfile=$conffile";
 
 if ($opt_quick) {
 	open(IN, "$testsdir/tests_quick.sh|");
@@ -520,6 +519,8 @@
 
 $ENV{KRB5_CONFIG} = $testenv_vars->{KRB5_CONFIG};
 
+SocketWrapper::set_default_iface(6);
+
 if ($opt_testenv) {
 	$ENV{PIDDIR} = $testenv_vars->{PIDDIR};
 	my $term = ($ENV{TERM} or "xterm");

