summaryrefslogtreecommitdiff
path: root/source4/script/tests/SocketWrapper.pm
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-19 08:04:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:07 -0500
commitad6b43ae3b4e7d698ce15813a98b478c10a100e7 (patch)
tree2bb7f087766eb31cb002cfb7cbdd5a60c017e01c /source4/script/tests/SocketWrapper.pm
parent1711fed0dd7ab34b0c6029364019a51695c84174 (diff)
downloadsamba-ad6b43ae3b4e7d698ce15813a98b478c10a100e7.tar.gz
samba-ad6b43ae3b4e7d698ce15813a98b478c10a100e7.tar.bz2
samba-ad6b43ae3b4e7d698ce15813a98b478c10a100e7.zip
r22360: print out the name of the PCAP file and move setup and cleanup
of pcap files into functions metze (This used to be commit dea42ce55965d22ff82279cacd8939b1e133ff1e)
Diffstat (limited to 'source4/script/tests/SocketWrapper.pm')
-rw-r--r--source4/script/tests/SocketWrapper.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/script/tests/SocketWrapper.pm b/source4/script/tests/SocketWrapper.pm
index 9f6c879663..17c4457146 100644
--- a/source4/script/tests/SocketWrapper.pm
+++ b/source4/script/tests/SocketWrapper.pm
@@ -12,17 +12,30 @@ use Exporter;
use strict;
use FindBin qw($RealBin);
-sub setup_dir($)
+sub setup_dir($$)
{
- my ($dir) = @_;
+ my ($dir, $pcap) = @_;
+ my $pcap_dir = undef;
+
if (defined($dir)) {
if ( -d $dir ) {
unlink <$dir/*>;
} else {
mkdir($dir);
}
+
+ if ($pcap) {
+ $pcap_dir = $dir."/pcap";
+
+ if ( -d $pcap_dir ) {
+ unlink <$pcap_dir/*>;
+ } else {
+ mkdir($pcap_dir);
+ }
+ }
}
+ $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir;
$ENV{SOCKET_WRAPPER_DIR} = $dir;
return $dir;
}