Branch Coverage

blib/lib/Tapper/Installer/Precondition.pm
Criterion Covered Total %
branch 51 92 55.4


line true false branch
27 1 9 if ($type eq 'iso') { }
4 5 elsif ($type eq 'gz' or $type eq 'tgz') { }
1 4 elsif ($type eq 'tar') { }
0 4 elsif ($type eq 'bz' or $type eq 'bz2') { }
0 4 elsif ($type eq 'rpm') { }
1 3 elsif ($type eq 'deb') { }
41 0 3 unless (-e $file)
46 0 3 if ($type eq 'application/octet-stream') { }
0 3 elsif ($type eq 'application/x-dpkg') { }
1 2 elsif ($type eq 'application/x-gzip') { }
1 1 elsif ($type eq 'application/x-gtar') { }
1 0 elsif ($type eq 'application/x-bzip2') { }
48 0 0 if $error
49 0 0 if $output =~ /ISO 9660/i
50 0 0 if $output =~ /$file: RPM/i
51 0 0 if $output =~ /$file: Debian/i
73 0 1 if ($hostname =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
74 0 0 unless ($hostname) = gethostbyaddr(inet_aton($hostname), 2)
85 5 1 unless $self->cfg->{'cleanup'}
86 0 1 unless $order->{'options'}
97 1 0 if ($precondition->{'source_url'} =~ m[^nfs://(.+/)([^/]+)(/?)$])
113 1 5 if $precondition->{'source_url'}
117 0 6 unless -d $self->cfg->{'paths'}{'guest_mount_dir'}
123 2 4 if ($precondition->{'mountfile'}) { }
1 3 elsif ($precondition->{'mountpartition'}) { }
1 2 elsif ($precondition->{'mountdir'}) { }
126 1 1 if ($precondition->{'mountpartition'}) { }
130 0 1 if $retval = $self->log_and_exec("losetup /dev/loop0 $image")
131 0 1 if $retval = $self->log_and_exec("kpartx -a /dev/loop0")
132 0 1 if $retval = $self->log_and_exec("mount /dev/mapper/loop0$partition " . $new_base_dir)
134 0 1 if $retval = $self->log_and_exec("mount -o loop $image " . $new_base_dir)
139 0 1 if $retval = $self->log_and_exec("mount $partition " . $new_base_dir)
148 0 6 if $retval = $self->install($precondition)
151 2 4 if ($precondition->{'mountfile'}) { }
1 3 elsif ($precondition->{'mountpartition'}) { }
152 1 1 if ($precondition->{'mountpartition'}) { }
153 0 1 if $retval = $self->log_and_exec("umount /dev/mapper/loop0$partition")
154 0 1 if $retval = $self->log_and_exec("kpartx -d /dev/loop0")
155 0 1 if ($retval = $self->log_and_exec("losetup -d /dev/loop0"))
157 0 0 if $retval = $self->log_and_exec("kpartx -d /dev/loop0")
158 0 0 if $retval = $self->log_and_exec("losetup -d /dev/loop0")
162 0 1 if $retval
171 0 1 if $retval
187 0 0 unless (-d $destdir)
188 0 0 unless system("mkdir", "-p", $destdir) == 0
190 0 0 unless open my $FH, ">", $destfile