1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source4/script/tests/SocketWrapper.pm
Jelmer Vernooij 72d88d158a r21707: Finally merge my (long-living) perlselftest branch.
This changes the main selftest code to be in perl rather than in shell script.

The selftest script is now no longer a black box but a regular executable that takes
--help.

This adds the following features:

 * "make test TESTS=foo" will run only the tests that match the regex "foo"
 * ability to deal with expected failures. the suite will not warn about tests
   that fail and are known to fail, but will warn about other failing tests and
   tests that are succeeding tests but incorrectly marked as failing.
 * ability to print a summary with all failures at the end of the run

It also opens up the way to the following features, which I hope to implement later:
 * "environments", for example having a complete domains with DCs and domain members
 in a testenvironment
 * only set up smbd if necessary (not when running LOCAL tests, for example)
 * different mktestsetup scripts per target. except for the mktestsetup script, we can
   use the same infrastructure for samba 3 or windows.
(This used to be commit 38f867880b)
2007-10-10 14:49:15 -05:00

35 lines
558 B
Perl

#!/usr/bin/perl
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL, v3 or later.
package SocketWrapper;
use Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(setup_dir setup_pcap set_default_iface);
use strict;
use FindBin qw($RealBin);
sub setup_dir($)
{
my ($dir) = @_;
$ENV{SOCKET_WRAPPER_DIR} = $dir;
return $dir;
}
sub setup_pcap($)
{
my ($pcap_file) = @_;
}
sub set_default_iface($)
{
my ($i) = @_;
$ENV{SOCKET_WRAPPER_DEFAULT_IFACE} = $i;
}
1;