summaryrefslogtreecommitdiff
path: root/source4/script/tests/testenv.pl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script/tests/testenv.pl')
-rwxr-xr-xsource4/script/tests/testenv.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/script/tests/testenv.pl b/source4/script/tests/testenv.pl
new file mode 100755
index 0000000000..b290aff542
--- /dev/null
+++ b/source4/script/tests/testenv.pl
@@ -0,0 +1,32 @@
+#!/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");
+close(DATA);