Branch Coverage

blib/lib/MySQL/Sandbox.pm
Criterion Covered Total %
branch 9 202 4.4


line true false branch
40 24 0 unless ($ENV{'USER'})
48 0 72 unless ($ENV{$var})
52 0 24 if ($ENV{'HOME'} =~ /\s/)
56 24 0 unless ($ENV{'SANDBOX_HOME'})
60 24 0 unless ($ENV{'TMPDIR'})
64 0 24 unless (-d $ENV{'TMPDIR'})
69 0 24 if (-d "$ENV{'HOME'}/sandboxes")
73 24 0 unless ($ENV{'SANDBOX_BINARY'})
74 0 24 if (-d "$ENV{'HOME'}/opt/mysql") { }
130 0 0 unless (ref $opt eq 'HASH')
133 0 0 if ($opt)
175 0 0 if ($msg)
186 0 0 if ($short)
193 0 0 if ($lparam < 0)
203 0 0 if (@{$text_items;} > 1)
223 0 0 if ($MySQL::Sandbox::PROGRAM_NAME =~ /replication|multiple/)
229 0 0 if ($MySQL::Sandbox::PROGRAM_NAME =~ /replication/)
238 0 0 if (grep {$MySQL::Sandbox::PROGRAM_NAME =~ /$_/;} 'make_sandbox', 'make_replication_sandbox', 'make_multiple_sandbox', 'make_multiple_sandbox')
278 0 0 if ($v =~ /(\d+)\.(\d+)\.(\d+)/) { }
296 0 0 if ($v1_major > $v2_major) { }
0 0 elsif ($v1_major == $v2_major and $v1_minor > $v2_minor) { }
0 0 elsif ($v1_major == $v2_major and $v1_minor == $v2_minor and $v1_rev > $v2_rev) { }
315 0 0 if ($version =~ /(\d+)\.(\d+)/)
318 0 0 unless ($major == 8 or $major == 5 and $minor >= 6)
327 0 0 unless (-d $operation_dir)
332 0 0 if $DEBUG
333 0 0 if ($operation_dir =~ m[/node\d/data$] and -d '../../master')
342 0 0 if ($server_id < 10) { }
0 0 elsif ($server_id >= 100 and $server_id < 109) { }
349 0 0 if $increase_id
355 0 0 if ($second_id > 9999)
362 0 0 unless open my $FH, '>', 'auto.cnf'
368 0 0 if $DEBUG
378 0 0 unless ($@)
380 0 0 if $DEBUG
385 0 0 unless ($JSON_module)
387 0 0 if $DEBUG
391 0 0 unless ($json_text)
401 0 0 if ($@)
403 0 0 if $DEBUG
411 0 0 unless open my $FH, '<', $filename
417 0 0 if ($skip_blanks)
419 0 0 if $line =~ /^\s*$/
421 0 0 if ($skip_comments)
423 0 0 if $line =~ /^\s*#/
425 0 0 if (wantarray) { }
435 0 0 if (wantarray) { }
452 0 0 if ($collective_json) { }
461 0 0 if (-f $filename) { }
472 0 0 if ($DEBUG)
483 0 0 if ($is_valid_json and $is_valid_json == -1) { }
0 0 elsif (not $is_valid_json) { }
485 0 0 if ($DEBUG)
513 0 0 unless open my $FILE, $mode, $fname
516 0 0 if ($mode eq '>' and $contents =~ m[\#!/bin/sh])
528 0 0 unless $port
532 0 0 unless $iaddr = inet_aton($host)
537 0 0 unless socket SOCK, 2, 1, $proto
539 0 0 if (connect SOCK, $paddr)
540 0 0 unless close SOCK
551 0 0 if ($port > 65520)
563 0 0 unless $dir
564 0 0 unless -d $dir
565 0 0 unless (is_a_sandbox($dir))
566 0 0 unless $skip_strict
572 0 0 if (-f "$dir/$sandbox_options_file") { }
592 0 0 unless $file
593 0 0 unless -f $file
595 0 0 unless open my $RFILE, '<', $file
598 0 0 if $line =~ /^\s*$/
599 0 0 if $line =~ /^\s*#/
600 0 0 if $line =~ /^\s*\[/
622 0 0 if ($seen_dir eq $File::Find::dir)
626 0 0 if ($params = get_sandbox_params($File::Find::dir, 1))
629 0 0 if (-f $params->{'opt'}{'pid_file'} and -e $params->{'opt'}{'socket'}) { }
633 0 0 if $options->{'all_info'}
636 0 0 unless ($options->{'only_used'})
638 0 0 if $options->{'all_info'}
651 0 0 unless ($dir)
660 0 0 unless (exists $sandbox_files{$req})
669 0 0 unless (-d $sandbox)
673 0 0 unless ($sboptions->{'opt'} and $sboptions->{'opt'}{'pid_file'} and $sboptions->{'opt'}{'socket'})
679 0 0 if (-f $sboptions->{'opt'}{'pid_file'} and -e $sboptions->{'opt'}{'socket'}) { }
694 0 0 if ($minimum_port >= $maximum_port)
697 0 0 if ($minimum_port + $range_size > $maximum_port)
703 0 0 if ($minimum_port >= $maximum_port)
709 0 0 if (exists $ports->{$i} or $i >= $maximum_port)
716 0 0 unless ($silent)
726 0 0 if ($options->{'format'} eq 'perl') { }
0 0 elsif ($options->{'format'} eq 'text') { }
729 0 0 if $options->{'all_info'}
746 0 0 if (-x "$dir/$cmd")
754 0 0 if ($MySQL::Sandbox::REAL_USER_ID == 0 or $MySQL::Sandbox::EFFECTIVE_USER_ID == 0)
755 0 0 unless ($ENV{'SANDBOX_AS_ROOT'})
767 0 0 if (-r $mylogin_cnf)
768 0 0 unless ($ENV{'IGNORE_MYLOGIN_CNF'})
790 0 0 unless $path
792 0 0 if ($path =~ /^$ENV{$var}/)
802 0 0 unless ($ENV{'SBINSTR'})
806 0 0 unless ($DEBUG)
810 0 0 unless open my $FH, '>>', $ENV{'SBINSTR'}