summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-03-07 02:11:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:20 -0500
commiteaa02e4b54e79c4dca49054eaf6558f4bfd152bb (patch)
treec00ace51d9ad34e13aab6f4627dea72ee3d19656 /source4/script
parent8fdbf34ea7956a6b9ed8e9f0dd73019c6e00183a (diff)
downloadsamba-eaa02e4b54e79c4dca49054eaf6558f4bfd152bb.tar.gz
samba-eaa02e4b54e79c4dca49054eaf6558f4bfd152bb.tar.bz2
samba-eaa02e4b54e79c4dca49054eaf6558f4bfd152bb.zip
r21733: Merge testenv back into core selftest.pl
(This used to be commit 4b78ed3a606b6697512f1e4e9b9c6c93816e71f8)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/tests/selftest.pl48
-rwxr-xr-xsource4/script/tests/testenv.pl42
2 files changed, 32 insertions, 58 deletions
diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl
index c62b073afc..a9a6ca4851 100755
--- a/source4/script/tests/selftest.pl
+++ b/source4/script/tests/selftest.pl
@@ -130,6 +130,7 @@ my $opt_immediate = 0;
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 @@ my $result = GetOptions (
'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 @@ $| = 1;
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 ($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);
+ if ($from_build_farm) {
+ run_test_buildfarm($name, $cmd, $i, $suitestotal);
+ } else {
+ run_test_plain($name, $cmd, $i, $suitestotal);
+ }
}
}
diff --git a/source4/script/tests/testenv.pl b/source4/script/tests/testenv.pl
deleted file mode 100755
index 412fc71dab..0000000000
--- a/source4/script/tests/testenv.pl
+++ /dev/null
@@ -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);
-