From e3e505625d5da70078b925ab5605c1aed2411609 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 4 Apr 2007 12:23:10 +0000 Subject: r22074: More refactoring. (This used to be commit b0e0c5cb94fc6d96dff9acd55ec632e3dd461b17) --- source4/script/tests/selftest.pl | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'source4/script/tests/selftest.pl') diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl index 86c00ac946..52311347fe 100755 --- a/source4/script/tests/selftest.pl +++ b/source4/script/tests/selftest.pl @@ -369,8 +369,6 @@ $ENV{PREFIX} = $prefix; $ENV{SRCDIR} = $srcdir; -my $testsdir = "$srcdir/script/tests"; - my $tls_enabled = not $opt_quick; my $from_build_farm = (defined($ENV{RUN_FROM_BUILD_FARM}) and ($ENV{RUN_FROM_BUILD_FARM} eq "yes")); @@ -399,6 +397,8 @@ if ($opt_socket_wrapper) { $socket_wrapper_dir = SocketWrapper::setup_dir("$prefix/w"); print "SOCKET_WRAPPER_DIR=$socket_wrapper_dir\n"; +} else { + warn("Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports") unless $< == 0; } my $target; @@ -431,15 +431,10 @@ if (defined($opt_skip)) { close(SKIP); } -my $testenv_vars; -$testenv_vars = $target->provision("dc", "$prefix/dc"); +my $testenv_vars = $target->setup_env("dc", "$prefix/dc", $socket_wrapper_dir); foreach (keys %$testenv_vars) { $ENV{$_} = $testenv_vars->{$_}; } -SocketWrapper::set_default_iface(1); -$target->check_or_start($testenv_vars, $socket_wrapper_dir, - ($ENV{SMBD_MAX_TIME} or 5400)); - SocketWrapper::set_default_iface(6); my $interfaces = join(',', ("127.0.0.6/8", @@ -463,6 +458,8 @@ print "OPTIONS $ENV{TORTURE_OPTIONS}\n"; my @todo = (); +my $testsdir = "$srcdir/script/tests"; + if ($opt_quick) { open(IN, "$testsdir/tests_quick.sh|"); } else { @@ -484,11 +481,6 @@ while () { } close(IN) or die("Error creating recipe"); -$target->wait_for_start(); - -# start off with 0 failures -$ENV{failed} = 0; - my $suitestotal = $#todo + 1; my $i = 0; $| = 1; @@ -522,7 +514,7 @@ NETBIOSNAME=\$NETBIOSNAME\" && bash'"); next; } - $target->setup_env($envname); + # $target->setup_env($envname); if ($from_build_farm) { run_test_buildfarm($name, $cmd, $i, $suitestotal); @@ -558,13 +550,6 @@ if ($numfailed == 0) { } print "FAILED ($statistics->{TESTS_UNEXPECTED_FAIL} failures and $statistics->{TESTS_ERROR} errors in $statistics->{SUITES_FAIL} testsuites)\n"; - } else { - print <