Branch Coverage

blib/lib/Rex/Config.pm
Criterion Covered Total %
branch 81 162 50.0


line true false branch
462 0 40 if (exists $ENV{'REX_REPORT_TYPE'})
510 0 113 if (exists $ENV{'REX_CACHE_TYPE'})
558 0 0 unless (defined $opt{$key})
672 0 0 if ($class eq 'Rex::Config') { }
682 8 914 if (my $cached_tmp = $cache->get("tmpdir"))
686 914 0 unless ($tmp_dir)
687 0 914 if (my $ssh = Rex::is_ssh()) { }
689 0 0 if (Rex::is_sudo()) { }
690 0 0 if (ref $ssh eq 'Net::OpenSSH') { }
703 0 0 if ($? == 0 and $out)
751 920 1 unless ($path)
796 1 278 if (exists $ENV{'REX_USER'})
800 44 234 if ($user)
804 0 234 if ($^O =~ /^MSWin/u) { }
832 0 278 if (exists $ENV{'REX_PASSWORD'})
862 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'port'})
904 0 296 if (exists $ENV{'REX_SUDO_PASSWORD'})
908 1 295 if ($sudo_password) { }
295 0 elsif (not defined $sudo_password) { }
965 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'connectionattempts'})
998 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'proxycommand'})
1031 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'connecttimeout'})
1061 0 71 if (exists $ENV{'REX_AUTH_TYPE'} and $ENV{'REX_AUTH_TYPE'} eq "pass")
1087 0 63 if (exists $ENV{'REX_AUTH_TYPE'} and $ENV{'REX_AUTH_TYPE'} eq "key")
1113 0 70 if (exists $ENV{'REX_AUTH_TYPE'} and $ENV{'REX_AUTH_TYPE'} eq "krb5")
1141 0 472 if (exists $ENV{'REX_PUBLIC_KEY'})
1142 156 316 if ($public_key)
1171 0 472 if (exists $ENV{'REX_PRIVATE_KEY'})
1172 156 316 if ($private_key)
1270 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'user'})
1284 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'hostname'})
1288 0 0 if ($SSH_CONFIG_FOR{$param->{'server'}}{'hostname'} =~ /^\%h(\.(.*))?/u) { }
1303 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'identityfile'})
1322 0 0 if (exists $param->{'server'} and exists $SSH_CONFIG_FOR{$param->{'server'}} and exists $SSH_CONFIG_FOR{$param->{'server'}}{'identityfile'})
1338 55 0 if (not $^O =~ /^MSWin/u || $connection_type and $use_net_openssh_if_present)
1347 55 0 if ($has_net_openssh)
1355 0 162 unless ($connection_type)
1363 0 0 if ($has_net_ssh2)
1435 0 117 if (ref $template_function eq "CODE")
1445 0 0 'Rex::Resource'->is_inside_resource ? :
0 0 unless $template_vars
0 0 if Rex::Commands::task()
1452 0 117 if ("Rex::Template::NG"->is_loadable and get_use_template_ng())
1464 0 0 'Rex::Resource'->is_inside_resource ? :
0 0 unless $template_vars
0 0 if Rex::Commands::task()
1482 12 17 'Rex::Resource'->is_inside_resource ? :
0 29 unless $template_vars
29 88 if Rex::Commands::task()
1526 0 0 if ($set) { }
1535 0 0 if ($allow_empty_groups)
1556 1 0 if ($set) { }
1565 4 101 if ($use_server_auth)
1658 15 124 if (exists $Rex::Config::SET_HANDLER->{$var})
1664 6 118 if ($set_no_append) { }
1668 98 20 if (ref $data eq 'HASH') { }
4 16 elsif (ref $data eq 'ARRAY') { }
1669 96 2 unless (ref $Rex::Config::set_param->{$var})
1693 13 106 unless $var
1694 60 46 if (exists $Rex::Config::set_param->{$var})
1728 105 4 unless (ref $HOME_CONFIG)
1731 0 0 if (ref $HOME_CONFIG_YAML and exists $Rex::Config::HOME_CONFIG_YAML->{$topic})
1740 1 788 if (-f $config_file)
1744 0 1 if ($@)
1751 1 0 if (exists $Rex::Config::HOME_CONFIG_YAML->{$key})
1763 2 788 if (-f $config_file)
1777 1 26 if $line =~ /^\s*#/u
1778 7 19 if $line =~ /^\s*$/u
1780 6 13 if ($line =~ /^Host(?:\s*=\s*|\s+)(.*)$/iu) { }
13 0 elsif ($in_host) { }
1822 0 1 if ($key eq "keyauth")
1827 0 1 if ($key eq "passwordauth")
1832 0 1 if ($key eq "passauth")
1857 0 3 if ($hndl =~ /^\-/u)
1860 0 3 if ($hndl eq "keyauth")
1861 0 3 if ($hndl eq "passwordauth" or $hndl eq "passauth")
1865 1 2 if ($hndl eq "connection")
1866 0 3 if ($hndl eq "ca")
1867 0 3 if ($hndl eq "cert")
1868 0 3 if ($hndl eq "key")
1880 0 1576 if ($^O =~ /^MSWin/u)