line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Docker::Image::Utility; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
74374
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
154
|
|
4
|
5
|
|
|
5
|
|
299
|
use warnings; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
145
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
3601
|
use parent 'Exporter'; |
|
5
|
|
|
|
|
1319
|
|
|
5
|
|
|
|
|
28
|
|
7
|
5
|
|
|
5
|
|
257086
|
use IPC::Run3; |
|
5
|
|
|
|
|
205293
|
|
|
5
|
|
|
|
|
371
|
|
8
|
5
|
|
|
5
|
|
3059
|
use Time::HiRes; |
|
5
|
|
|
|
|
14637
|
|
|
5
|
|
|
|
|
34
|
|
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
640
|
use constant DEBUG => $ENV{DEBUG_TEST_DOCKER_IMAGE}; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
1663
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(docker); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw(run); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub WARN { |
17
|
0
|
|
|
0
|
0
|
0
|
my $msg = join " ", @_; |
18
|
0
|
|
|
|
|
0
|
chomp $msg; |
19
|
0
|
|
|
|
|
0
|
warn sprintf "[%s %.5f] %s\n", __PACKAGE__, Time::HiRes::time, $msg; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
0
|
1355
|
sub docker { run('docker', @_); } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub run { |
25
|
2
|
|
|
2
|
0
|
4243
|
my (@cmd) = @_; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
5
|
DEBUG && WARN sprintf "Run [ %s ]", join ' ', @cmd; |
28
|
2
|
|
|
|
|
17
|
my $is_success = run3 [ @cmd ], \my $in, \my $out, \my $err; |
29
|
1
|
50
|
|
|
|
8612
|
if ($is_success) { |
30
|
1
|
|
|
|
|
14
|
chomp $out; |
31
|
1
|
|
|
|
|
46
|
return $out; |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
|
die $err; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |