Rev 11687: Merge testenv back into core selftest.pl in file:///home/jelmer/bzr.samba/SAMBA_4_0/

Jelmer Vernooij jelmer at samba.org
Wed Mar 7 02:08:54 GMT 2007


At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11687
revision-id: jelmer at samba.org-20070307020834-3uv5fqzr52y9pivl
parent: svn-v2:21732 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: SAMBA_4_0
timestamp: Wed 2007-03-07 03:08:34 +0100
message:
  Merge testenv back into core selftest.pl
removed:
  source/script/tests/testenv.pl svn-v2:21707 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftestenv.pl
modified:
  source/main.mk                 svn-v2:8991 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fmain.mk
  source/script/tests/selftest.pl svn-v2:20693 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.pl
=== removed file 'source/script/tests/testenv.pl'
--- a/source/script/tests/testenv.pl	2007-03-06 23:23:15 +0000
+++ b/source/script/tests/testenv.pl	1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
-#!/usr/bin/perl
-
-use FindBin qw($RealBin);
-use lib "$RealBin";
-
-use Samba4;
-use SocketWrapper;
-
-my $vars = Samba4::provision("st");
-foreach (keys %$vars) { $ENV{$_} = $vars->{$_}; }
-SocketWrapper::set_default_iface(1);
-my $test_fifo = "st/smb_test.fifo";
-my $socket_wrapper_dir = SocketWrapper::setup_dir("$vars->{PREFIX_ABS}/w");
-Samba4::smbd_check_or_start("bin", $test_fifo, $ENV{SMBD_TEST_LOG}, $socket_wrapper_dir, undef, $ENV{CONFFILE});
-SocketWrapper::set_default_iface(6);
-my $interfaces = join(',', ("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"));
-
-push (@torture_options, "--option=interfaces=$interfaces", 
-	                    $ENV{CONFIGURATION}, 
-						"--target=samba4");
-
-$ENV{TORTURE_OPTIONS} = join(' ', @torture_options);
-
-open(DATA, ">$test_fifo");
-Samba4::wait_for_start();
-system("xterm -e 'echo -e \"Welcome to the Samba4 Test environment
-This matches the client environment used in make test
-smbd is pid `cat \$PIDDIR/smbd.pid`
-
-Some useful environment variables:
-AUTH=\$AUTH
-TORTURE_OPTIONS=\$TORTURE_OPTIONS
-CONFIGURATION=\$CONFIGURATION
-SERVER=\$SERVER
-NETBIOSNAME=\$NETBIOSNAME\" && bash'");
-close(DATA);
-

=== modified file 'source/main.mk'
--- a/source/main.mk	2007-03-05 22:24:21 +0000
+++ b/source/main.mk	2007-03-07 02:08:34 +0000
@@ -304,7 +304,7 @@
 	$(SELFTEST) --quick --socket-wrapper --immediate $(TESTS)
 
 testenv: all libraries
-	$(srcdir)/script/tests/testenv.pl 
+	$(SELFTEST) --socket-wrapper --testenv
 
 valgrindtest: valgrindtest-quick
 
@@ -321,7 +321,7 @@
 valgrindtest-env: all libraries
 	SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
 	VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
-	$(srcdir)/script/tests/testenv.pl
+	$(SELFTEST) --socket-wrapper --testenv
 
 gdbtest: gdbtest-quick
 

=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl	2007-03-06 06:30:36 +0000
+++ b/source/script/tests/selftest.pl	2007-03-07 02:08:34 +0000
@@ -130,6 +130,7 @@
 my $opt_expected_failures = undef;
 my $opt_skip = undef;
 my $opt_verbose = 0;
+my $opt_testenv = 0;
 
 my $srcdir = ".";
 my $builddir = ".";
@@ -327,7 +328,8 @@
 		'skip=s' => \$opt_skip,
 		'srcdir=s' => \$srcdir,
 		'builddir=s' => \$builddir,
-		'verbose' => \$opt_verbose
+		'verbose' => \$opt_verbose,
+		'testenv' => \$opt_testenv
 	    );
 
 exit(1) if (not $result);
@@ -515,22 +517,36 @@
 
 delete $ENV{DOMAIN};
 
-foreach (@todo) {
-	$i++;
-	my $cmd = $$_[1];
-	$cmd =~ s/([\(\)])/\\$1/g;
-	my $name = $$_[0];
-	
-	if (skip($name)) {
-		print "SKIPPED: $name\n";
-		$statistics->{SUITES_SKIPPED}++;
-		next;
-	}
-
-	if ($from_build_farm) {
-		run_test_buildfarm($name, $cmd, $i, $suitestotal);
-	} else {
-		run_test_plain($name, $cmd, $i, $suitestotal);
+if ($opt_testenv) {
+	my $term = $ENV{TERM} or "xterm";
+	system("$term -e 'echo -e \"Welcome to the Samba4 Test environment
+This matches the client environment used in make test
+smbd is pid `cat \$PIDDIR/smbd.pid`
+
+Some useful environment variables:
+AUTH=\$AUTH
+TORTURE_OPTIONS=\$TORTURE_OPTIONS
+CONFIGURATION=\$CONFIGURATION
+SERVER=\$SERVER
+NETBIOSNAME=\$NETBIOSNAME\" && bash'");
+} else {
+	foreach (@todo) {
+		$i++;
+		my $cmd = $$_[1];
+		$cmd =~ s/([\(\)])/\\$1/g;
+		my $name = $$_[0];
+		
+		if (skip($name)) {
+			print "SKIPPED: $name\n";
+			$statistics->{SUITES_SKIPPED}++;
+			next;
+		}
+
+		if ($from_build_farm) {
+			run_test_buildfarm($name, $cmd, $i, $suitestotal);
+		} else {
+			run_test_plain($name, $cmd, $i, $suitestotal);
+		}
 	}
 }
 



More information about the samba-cvs mailing list