X-Git-Url: https://git.exim.org/users/heiko/exim.git/blobdiff_plain/b369d47038a075706f6dfe57ab2e1ebeea0e5bdf..87e93574a5da99b5f36751a4219caacc4e81ea3c:/test/lib/Exim/Runtest.pm diff --git a/test/lib/Exim/Runtest.pm b/test/lib/Exim/Runtest.pm index 1df2ea1a9..851c29d3b 100644 --- a/test/lib/Exim/Runtest.pm +++ b/test/lib/Exim/Runtest.pm @@ -1,17 +1,36 @@ package Exim::Runtest; +use 5.010; use strict; use warnings; use IO::Socket::INET; use Carp; +use parent 'Exporter'; +our @EXPORT_OK = qw(mailgroup dynamic_socket); +our %EXPORT_TAGS = ( + all => \@EXPORT_OK, +); + use List::Util qw'shuffle'; +=head1 NAME + +Exim::Runtest - helper functions for the runtest script + +=head1 SYNOPSIS + + use Exim::Runtest; + my $foo = Exim::Runtest::foo('foo'); + +=head1 DESCRIPTION + +The B module provides some simple functions +for the F script. No functions are exported yet. + +=cut -# find a group name, preferrable 'mail', but -# use some other random name if 'mail' isn't a valid group -# name sub mailgroup { - my $group = shift; + my $group = shift // croak "Need a default group name."; croak "Need a group *name*, not a numeric group id." if $group =~ /^\d+$/; @@ -39,3 +58,23 @@ sub dynamic_socket { } 1; + +__END__ + +=head1 FUNCTIONS + +=over + +=item B(I<$default>) + +Check if the mailgroup I<$default> exists. Return the checked +group name or some other random but existing group. + +=item B() + +Return a dynamically allocated listener socket in the range +between 1024 and 65534; + +=back + +=cut