pf-tools/pf-tools: 4 new changesets
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Mon Jan 3 10:40:08 UTC 2011
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/b2b7d4a5a88f
changeset: 1157:b2b7d4a5a88f
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Mon Jan 03 08:35:16 2011 +0100
description:
Code factorization: new function get_hostshort_hostvlan_from_fqdn()
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/aee61b1bb07a
changeset: 1158:aee61b1bb07a
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Mon Jan 03 08:55:38 2011 +0100
description:
get_hostshort_hostvlan_from_fqdn() -> get_hostshort_hostvlan_zone_from_fqdn() + tests
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/c8468567bab6
changeset: 1159:c8468567bab6
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Mon Jan 03 08:58:03 2011 +0100
description:
Another use of get_hostshort_hostvlan_zone_from_fqdn()
details: http://hg.debian.org/hg/pf-tools/pf-tools/rev/8fab735a6f9e
changeset: 1160:8fab735a6f9e
user: Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>
date: Mon Jan 03 09:02:28 2011 +0100
description:
perltidy
diffstat:
2 files changed, 40 insertions(+), 13 deletions(-)
lib/PFTools/Structqueries.pm | 33 ++++++++++++++++++++-------------
t/13.conf.t | 20 ++++++++++++++++++++
diffs (727 lines):
diff -r badcfa737c2e -r 8fab735a6f9e lib/PFTools/Structqueries.pm
--- a/lib/PFTools/Structqueries.pm Sun Jan 02 13:57:47 2011 +0100
+++ b/lib/PFTools/Structqueries.pm Mon Jan 03 09:02:28 2011 +0100
@@ -30,27 +30,75 @@
use List::MoreUtils qw( uniq );
our @EXPORT = qw(
+ get_cmdline_from_host_ref
+ get_distrib_from_host_ref
+ get_host_config
+ get_hostshort_hostvlan_zone_from_fqdn
+ get_hosttype_from_hostname
+ get_iface_vlan_from_hostname
+ get_mode_from_host_ref
+ get_pkgtype_from_hostname
+ get_site_config
+ get_site_dhcp_config
+ get_site_list_from_hostname
+ get_site_list_from_section
get_suffix_from_ip_type
+ get_uniq_site_from_hostname
+ get_vlan_config
get_zone_from_hostname
get_zone_from_site
- get_hosttype_from_hostname
- get_iface_vlan_from_hostname
- get_uniq_site_from_hostname
- get_site_list_from_hostname
- get_site_list_from_section
- get_cmdline_from_host_ref
- get_distrib_from_host_ref
- get_mode_from_host_ref
- get_pkgtype_from_hostname
- get_host_config
- get_site_dhcp_config
- get_site_config
- get_vlan_config
is_private_vlan
resolve_hostname_from_global_config
);
our @EXPORT_OK = qw ();
+
+=head2 get_hostshort_hostvlan_from_fqdn($fqdn)
+
+Returns an array containing the hostshort, hostvlan and zone (or undefined
+values if there's no match).
+
+Example: the result for rdeploy00.vlan-systeme.private would be the following
+array:
+
+ ( q{rdeploy00}, q{vlan-systeme}, q{private} )
+
+=cut
+
+sub get_hostshort_hostvlan_zone_from_fqdn {
+ my ($fqdn) = @_;
+
+ if ( not $fqdn ) {
+ croak q{ERROR: Invalid false fqdn};
+ }
+
+ if ( ref $fqdn ) {
+ croak q{ERROR: Invalid non-scalar fqdn};
+ }
+
+ my @return
+ = $fqdn =~ m{
+ \A
+ ( # -> $hostshort
+ [^.]+
+ )
+ (?:
+ [.]
+ ( # -> $hostvlan
+ [^.]+
+ )
+ )?
+ (?:
+ [.]
+ ( # -> $zone
+ [^.]+ # or just .+ to allow subzones?
+ )
+ )?
+ \z
+ }xms;
+
+ return @return;
+}
=head2 get_suffix_from_ip_type ( $ip_type )
@@ -82,7 +130,7 @@
my ( $hostname, $global_config ) = @_;
my $list_ref = get_site_list_from_hostname( $hostname, $global_config );
- if ( not $list_ref) {
+ if ( not $list_ref ) {
croak qq{ERROR: Uknown host $hostname};
}
if ( @{$list_ref} > 1 ) {
@@ -142,7 +190,7 @@
: $global_config->{'SITE'}->{'__site_list'};
foreach my $site ( @{$site_list} ) {
- my $site_ref = get_site_config( $site, $global_config);
+ my $site_ref = get_site_config( $site, $global_config );
my $host_part = $site_ref->{'HOST'}->{'BY_NAME'};
foreach my $hostclass ( keys %{$host_part} ) {
return $hostclass if $hostclass eq $hostname;
@@ -270,27 +318,9 @@
= get_hosttype_from_hostname( $hostname, $global_config, $site_name );
my $site_ref = get_site_config( $site_name, $global_config );
- my $zone = $site_ref->{'zone'};
- my ($hostshort)
- = $hostname =~ m{
- \A
- ( # -> $hostshort
- [^.]+ # hostname
- )
- (?:
- [.]
- (?:
- [^.]+ # vlan name
- )
- )?
- (?:
- [.]
- $zone # zone name
- )?
- \z
- }xms;
-
- unless ($hostshort) {
+ my $zone = $site_ref->{'zone'};
+ my ($hostshort) = get_hostshort_hostvlan_zone_from_fqdn($hostname);
+ if ( not $hostshort ) {
croak
qq{ERROR: Unable to get hostshort from hostname $hostname};
}
@@ -539,19 +569,7 @@
= @{$arguments_ref}{@argument_names};
my ( $hostshort, $hostvlan )
- = $hostname =~ m{
- \A
- ( # -> $hostshort
- [^.]+
- )
- (?:
- [.]
- ( # -> $hostvlan
- [^.]+
- )
- )?
- \z
- }xms;
+ = get_hostshort_hostvlan_zone_from_fqdn($hostname);
my $zone_key = $ip_type eq 'ipv6' ? 'ZONE6' : 'ZONE';
my $zone_ref = $global_config->{$zone_key}->{'BY_NAME'}->{$zone_name};
diff -r badcfa737c2e -r 8fab735a6f9e lib/PFTools/Utils.pm
--- a/lib/PFTools/Utils.pm Sun Jan 02 13:57:47 2011 +0100
+++ b/lib/PFTools/Utils.pm Mon Jan 03 09:02:28 2011 +0100
@@ -106,7 +106,7 @@
store_global_config( $global_struct, $pf_config );
}
else {
- $global_struct = retrieve_global_config( $global_store_file );
+ $global_struct = retrieve_global_config($global_store_file);
}
return ( $pf_config, $global_struct );
@@ -144,17 +144,22 @@
sub make_preseed_file {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname site_name template_filename )
);
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( global_config pf_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( global_config pf_config )
+ );
- check_optional_args_type( $args_ref, q{HASH},
- qw( host_ref) );
+ check_optional_args_type(
+ $args_ref, q{HASH},
+ qw( host_ref)
+ );
- my ($hostname, $site_name, $global_config,
+ my ($hostname, $site_name, $global_config,
$pf_config, $template_filename, $host_ref
)
= @{$args_ref}{
@@ -168,12 +173,13 @@
$host_ref ||= get_host_config( $hostname, $global_config, $site_name );
- my $mode = $host_ref->{'deployment'}->{'mode'};
+ my $mode = $host_ref->{'deployment'}->{'mode'};
my $templates_dirname = $pf_config->{'path'}->{'templates_dir'};
$template_filename ||= join q{/}, $templates_dirname,
(
- $host_ref->{'deployment'}->{'preseed'} || $pf_config->{$mode}->{'preseed'}
+ $host_ref->{'deployment'}->{'preseed'}
+ || $pf_config->{$mode}->{'preseed'}
);
my $basename = qq{preseed_$hostname};
@@ -228,12 +234,15 @@
sub make_pxe_boot_and_preseed_files {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname site_name preseed_template_filename pxe_template_filename )
);
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( global_config pf_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( global_config pf_config )
+ );
my ($hostname, $site_name, $preseed_template_filename,
$pxe_template_filename, $global_config, $pf_config
@@ -244,7 +253,8 @@
)
};
- $site_name ||= get_uniq_site_from_hostname( $hostname, $global_config, $pf_config );
+ $site_name ||= get_uniq_site_from_hostname( $hostname, $global_config,
+ $pf_config );
my $host_ref = get_host_config( $hostname, $global_config, $site_name );
@@ -259,8 +269,10 @@
my $iface = get_iface_vlan_from_hostname(
$host_ref->{'deployment'}->{'dhcpvlan'}, $host_ref
);
- ( my $mac = $host_ref->{'interfaces'}->{$iface}->{'mac'} ) =~ s{ [:] }{-}xmsg;
- my $pxe_boot_file = join q{/}, $pf_config->{'path'}->{'pxefiles_dir'}, $mac;
+ ( my $mac = $host_ref->{'interfaces'}->{$iface}->{'mac'} )
+ =~ s{ [:] }{-}xmsg;
+ my $pxe_boot_file = join q{/}, $pf_config->{'path'}->{'pxefiles_dir'},
+ $mac;
__make_file(
{
@@ -371,10 +383,11 @@
=cut
my %filter_function_for = (
- q{distrib} => \&__search_and_replace_distrib,
- q{iface} => \&__search_and_replace_iface,
- q{ip} => \&__search_and_replace_ip,
+ q{distrib} => \&__search_and_replace_distrib,
+ q{iface} => \&__search_and_replace_iface,
+ q{ip} => \&__search_and_replace_ip,
);
+
sub search_and_replace {
my ($args_ref) = @_;
@@ -463,8 +476,10 @@
sub fix_etc_hosts {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
- qw( input_filename output_filename ) );
+ check_mandatory_true_args_type(
+ $args_ref, q{},
+ qw( input_filename output_filename )
+ );
__make_file(
{
@@ -730,16 +745,20 @@
sub __resolve_hostname {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname )
);
- check_optional_args_type( $args_ref, q{},
+ check_optional_args_type(
+ $args_ref, q{},
qw( resolution_type site_name hosttype ip_type )
);
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( global_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( global_config )
+ );
my ($hostname, $resolution_type, $site_name,
$hosttype, $ip_type, $global_config
@@ -767,28 +786,18 @@
= get_zone_from_hostname( $hostname, $global_config, $site_name );
$hostname =~ s{ [.] $zone \z}{}xms;
- # FIXME this regexp is also used in
- # PFTools::Structqueries::resolve_hostname_from_global_config()
- my ( $hostshort, $hostvlan ) = $hostname =~ m{
- \A
- ( # $hostshort
- [^.]+
- )
- (?:
- [.]
- ( # $hostvlan
- [^.]+
- )
- )?
- \z
- }xms;
+ my ( $hostshort, $hostvlan )
+ = get_hostshort_hostvlan_zone_from_fqdn($hostname);
if (not defined $hosttype
- and $hostshort !~ m{\A (network|netmask|broadcast|gateway|prefix) }xms # \z ?
+ and $hostshort
+ !~ m{\A (network|netmask|broadcast|gateway|prefix) }xms # \z ?
)
{
- $hosttype = get_hosttype_from_hostname( $hostshort, $global_config,
- $site_name );
+ $hosttype = get_hosttype_from_hostname(
+ $hostshort, $global_config,
+ $site_name
+ );
}
if ( $hostshort eq q{prefix} ) {
@@ -914,15 +923,19 @@
sub __search_and_replace_distrib {
my ($args_ref) = @_;
- check_mandatory_args_type( $args_ref, q{},
- qw( line ) );
+ check_mandatory_args_type(
+ $args_ref, q{},
+ qw( line )
+ );
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( host_ref ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( host_ref )
+ );
- my ($line, $host_ref) = @{$args_ref}{qw( line host_ref )};
+ my ( $line, $host_ref ) = @{$args_ref}{qw( line host_ref )};
- return $line unless $line; # no warnings if undef
+ return $line unless $line; # no warnings if undef
$line =~ s{ %DISTSRC% }{$host_ref->{'deployment'}->{'mode'}}xmsg;
$line =~ s{ %DISTRIB% }{$host_ref->{'deployment'}->{'distrib'}}xmsg;
@@ -972,17 +985,25 @@
sub __search_and_replace_ip {
my ($args_ref) = @_;
- check_mandatory_args_type( $args_ref, q{},
- qw( line ) );
+ check_mandatory_args_type(
+ $args_ref, q{},
+ qw( line )
+ );
- check_mandatory_true_args_type( $args_ref, q{},
- qw( hostname site_name ip_type ) );
+ check_mandatory_true_args_type(
+ $args_ref, q{},
+ qw( hostname site_name ip_type )
+ );
- check_optional_args_type( $args_ref, q{},
- qw( separator resolution_type ) );
+ check_optional_args_type(
+ $args_ref, q{},
+ qw( separator resolution_type )
+ );
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( host_ref site_ref subst_ref global_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( host_ref site_ref subst_ref global_config )
+ );
my ($line, $hostname, $site_name, $ip_type, $separator, $resolution_type,
$host_ref, $site_ref, $subst_ref, $global_config
@@ -992,7 +1013,7 @@
host_ref site_ref subst_ref global_config )
};
- return $line unless $line; # no warnings if undef
+ return $line unless $line; # no warnings if undef
# $separator //= q{ };
if ( not defined $separator ) {
@@ -1057,9 +1078,9 @@
global_config => $global_config,
}
);
- if (@{$resolved_ref}) {
+ if ( @{$resolved_ref} ) {
if ( $separator eq q{DUPLICATE} ) {
- foreach my $res (@{$resolved_ref}) {
+ foreach my $res ( @{$resolved_ref} ) {
my $templine2 = $line;
substr( $templine2, $lengthbefore, length $match, $res );
push @lines, $templine2;
@@ -1107,16 +1128,20 @@
sub __search_and_replace_iface {
my ($args_ref) = @_;
- check_mandatory_args_type( $args_ref, q{},
- qw( line ) );
+ check_mandatory_args_type(
+ $args_ref, q{},
+ qw( line )
+ );
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( host_ref subst_ref ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( host_ref subst_ref )
+ );
my ( $line, $host_ref, $subst_ref )
= @{$args_ref}{qw( line host_ref subst_ref )};
- return $line unless $line; # no warnings if undef
+ return $line unless $line; # no warnings if undef
my $pos = length $line;
while (
@@ -1198,11 +1223,15 @@
sub __build_preseed {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
- qw( hostname template_filename pf_script ) );
+ check_mandatory_true_args_type(
+ $args_ref, q{},
+ qw( hostname template_filename pf_script )
+ );
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( host_ref ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( host_ref )
+ );
my ( $hostname, $template_filename, $pf_script, $host_ref )
= @{$args_ref}{qw( hostname template_filename pf_script host_ref )};
@@ -1219,7 +1248,8 @@
'config_script' => $pf_script,
};
- my $content = __read_and_process_template( $template_filename, $vars_ref );
+ my $content
+ = __read_and_process_template( $template_filename, $vars_ref );
return [$content];
}
@@ -1251,14 +1281,20 @@
sub __build_pxe_boot {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
- qw( hostname site_name preseed_filename ) );
+ check_mandatory_true_args_type(
+ $args_ref, q{},
+ qw( hostname site_name preseed_filename )
+ );
- check_optional_args_type( $args_ref, q{},
- qw( template_filename ) );
+ check_optional_args_type(
+ $args_ref, q{},
+ qw( template_filename )
+ );
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( global_config pf_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( global_config pf_config )
+ );
my ($hostname, $site_name, $preseed_filename, $template_filename,
$global_config, $pf_config
@@ -1286,7 +1322,8 @@
my $mode = $host_ref->{'deployment'}->{'mode'};
my $templates_dirname = $pf_config->{'path'}->{'templates_dir'};
- $template_filename ||= join q{/}, $templates_dirname, $pf_config->{$mode}->{'pxe'};
+ $template_filename ||= join q{/}, $templates_dirname,
+ $pf_config->{$mode}->{'pxe'};
my $preseed_md5
= __get_md5sum_for_preseedfile( $preseed_filename, $pf_config );
@@ -1334,12 +1371,15 @@
sub __build_interfaces {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname site_name )
);
- check_mandatory_args_type( $args_ref, q{HASH},
- qw( global_config pf_config ) );
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
+ qw( global_config pf_config )
+ );
my ( $hostname, $global_config, $pf_config, $site_name )
= @{$args_ref}{qw( hostname global_config pf_config site_name )};
@@ -1519,7 +1559,8 @@
sub __build_resolv_conf {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname site_name template_filename )
);
@@ -1558,7 +1599,7 @@
}
my $vars_ref = {
- domain => $domain,
+ domain => $domain,
nameservers => \@nameservers,
};
my $lines_ref = [
@@ -1590,7 +1631,8 @@
sub __build_zone {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( site_name zone_name template_filename )
);
@@ -1627,7 +1669,7 @@
my $merged_zone_ref = merge( $zone_part, $zone_ref->{'ALL_SITES'} );
# Networks
- my @networks = ();
+ my @networks = ();
my @network_order = @{ $zone_part->{'__network_order'} };
push @network_order,
@@ -1736,19 +1778,23 @@
sub __build_sources_list {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname site_name template )
);
- check_mandatory_args_type( $args_ref, q{HASH},
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
qw( global_config pf_config)
);
- check_mandatory_args_type( $args_ref, q{ARRAY},
+ check_mandatory_args_type(
+ $args_ref, q{ARRAY},
qw( sections_ref )
);
- check_optional_args_type( $args_ref, q{},
+ check_optional_args_type(
+ $args_ref, q{},
qw( backports )
);
@@ -1833,16 +1879,19 @@
sub __fix_etc_hosts {
my ($args_ref) = @_;
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( hostname input_filename ip_type )
);
- check_optional_args_type( $args_ref, q{},
+ check_optional_args_type(
+ $args_ref, q{},
qw( site_name )
);
# FIXME pf_config is not actually used
- check_mandatory_args_type( $args_ref, q{HASH},
+ check_mandatory_args_type(
+ $args_ref, q{HASH},
qw( global_config pf_config )
);
@@ -1850,8 +1899,10 @@
$ip_type, $global_config, $pf_config
)
= @{$args_ref}
- {qw( hostname site_name input_filename
- ip_type global_config pf_config )};
+ {
+ qw( hostname site_name input_filename
+ ip_type global_config pf_config )
+ };
if ( $ip_type ne q{ipv4} ) {
croak qq{ERROR: __fix_etc_hosts: ip_type '$ip_type' not implemented};
@@ -2005,7 +2056,8 @@
croak q{ERROR: Invalid non-scalar preseed_dir};
}
- my $file_path = join q{/}, $pf_config->{'path'}->{'preseed_dir'}, $filename;
+ my $file_path = join q{/}, $pf_config->{'path'}->{'preseed_dir'},
+ $filename;
my $fh = IO::File->new( $file_path, q{<} );
unless ($fh) {
@@ -2206,7 +2258,8 @@
$out_fn = $out_fh->filename();
}
- __write_array_to_filehandle( $out_fh, $out_fn, $lines_ref, $line_separator );
+ __write_array_to_filehandle( $out_fh, $out_fn, $lines_ref,
+ $line_separator );
if ( $filename ne q{-} ) {
make_path( dirname($filename) );
@@ -2256,7 +2309,8 @@
# NOTE: all other parameters are properly checked by
# __build_FOO() => no need to check them here
- check_mandatory_true_args_type( $args_ref, q{},
+ check_mandatory_true_args_type(
+ $args_ref, q{},
qw( file_type filename )
);
diff -r badcfa737c2e -r 8fab735a6f9e t/13.conf.t
--- a/t/13.conf.t Sun Jan 02 13:57:47 2011 +0100
+++ b/t/13.conf.t Mon Jan 03 09:02:28 2011 +0100
@@ -1902,6 +1902,47 @@
=> q{Returns the correct site_ref for cbv4}
or note explain $result;
+########################################################################
+note('Testing PFTools::Structqueries::get_hostshort_hostvlan_zone_from_fqdn');
+can_ok( 'PFTools::Structqueries', qw( get_hostshort_hostvlan_zone_from_fqdn ) );
+
+throws_ok { get_hostshort_hostvlan_zone_from_fqdn() }
+qr{ \A ERROR: [ ] Invalid [ ] false [ ] fqdn }xms
+ => 'Dies if no fqdn';
+
+throws_ok { get_hostshort_hostvlan_zone_from_fqdn( q{} ) }
+qr{ \A ERROR: [ ] Invalid [ ] false [ ] fqdn }xms
+ => q{Dies if empty fqdn};
+
+throws_ok { get_hostshort_hostvlan_zone_from_fqdn( {} ) }
+qr{ \A ERROR: [ ] Invalid [ ] non-scalar [ ] fqdn }xms
+ => q{Dies if non-scalar fqdn};
+
+my @result = get_hostshort_hostvlan_zone_from_fqdn( q{rdeploy00.vlan-systeme.private} );
+my @expected_result = qw( rdeploy00 vlan-systeme private );
+is_deeply \@result, \@expected_result
+ => q{Returns the correct result for rdeploy00.vlan-systeme.private}
+ or note explain $result;
+
+ at result = get_hostshort_hostvlan_zone_from_fqdn( q{cbv4-rdeploy00.vlan-systeme.private} );
+ at expected_result = qw( cbv4-rdeploy00 vlan-systeme private );
+is_deeply \@result, \@expected_result
+ => q{Returns the correct result for cbv4-rdeploy00.vlan-systeme.private}
+ or note explain @result;
+
+ at result = get_hostshort_hostvlan_zone_from_fqdn( q{cbv4-rdeploy00.vlan-systeme} );
+ at expected_result = ( q{cbv4-rdeploy00}, q{vlan-systeme}, undef );
+is_deeply \@result, \@expected_result
+ => q{Returns the correct result for cbv4-rdeploy00.vlan-systeme}
+ or note explain @result;
+
+ at result = get_hostshort_hostvlan_zone_from_fqdn( q{cbv4-rdeploy00} );
+ at expected_result = ( q{cbv4-rdeploy00}, undef, undef );
+is_deeply \@result, \@expected_result
+ => q{Returns the correct result for cbv4-rdeploy00}
+ or note explain @result;
+
+
#TODO: {
# local $TODO = 'Depends on other, still failing, tests';
#} # END TODO
More information about the pf-tools-commits
mailing list