| 1 | package Tapper::MCP::Child; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 20 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Control one specific testrun on MCP side | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 20 | $Tapper::MCP::Child::VERSION = '5.0.9'; | |||||||||||||||||||||||||||||||||||||||||||||
| 5 | 20 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 20 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 20 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 20 | ▶ | use Class::Load 'load_class'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 20 | ▶ | use Hash::Merge::Simple qw/merge/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 20 | ▶ | use List::Util qw(min max); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 20 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | #use UNIVERSAL; | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 20 | ▶ | use YAML::Syck; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 20 | ▶ | use Tapper::MCP::Net; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 20 | ▶ | use Tapper::MCP::Config; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 20 | ▶ | use Tapper::Model 'model'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 20 | ▶ | use Tapper::MCP::State; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 20 | ▶ | use Tapper::MCP::Plugin; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 20 | ▶ | use Devel::Backtrace; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 20 | ▶ | use constant BUFLEN => 1024; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 20 | ▶ | use constant ONE_MINUTE => 60; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 20 | extends 'Tapper::MCP::Control'; | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | 20 | with 'Tapper::MCP::Net::TAP'; | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | 20 | with 'Tapper::MCP::Plugin'; | |||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 20 | has state => (is => 'rw'); | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 20 | has mcp_info => (is => 'rw'); | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | 20 | has rerun => (is => 'rw', default => 0); | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | 12 | ▶ | has plugin_conf => (is => 'ro', default => sub {{}}, isa => 'HashRef'); # get the config for creating the plugin object | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | sub get_messages | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 9 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_messages: called CC=6 SCAR=18.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 9 | my ($self, $timeout) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | 9 | ▶ | $timeout //= 0; # get rid of warning; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$timeout //= 0
MC/DC0%0/1
$timeout //= 0
$timeout
Truth table50%1/2
A
A= $timeout
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 9 | my $end_time = time() + $timeout; | |||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 9 | my $messages; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 9 | while (1) { | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 3105 | $messages = $self->testrun->message; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 3105 | ▶ | last if ($messages and $messages->count) or time() > $end_time; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$messages and $messages->count or time > $end_time
$messages and $messages->count
MC/DC66%2/3
$messages and $messages->count or time > $end_time
$messages
$messages->count
time > $end_time
Truth table60%3/5
A and B or C
A= $messagesB= $messages->countC= time > $end_time
| |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 3096 | Tapper::Model::model('TestrunDB')->storage->disconnect; | |||||||||||||||||||||||||||||||||||||||||||||
| 47 | 3096 | ▶ | sleep $self->cfg->{mcp}{child}{get_message_sleep_interval} unless $ENV{HARNESS_ACTIVE}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 9 | return $messages; | |||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||
| 53 | sub wait_for_testrun | ||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
wait_for_testrun: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 5 | my $timeout_span = $self->state->get_current_timeout_span(); | |||||||||||||||||||||||||||||||||||||||||||||
| 58 | 5 | my $error; | |||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | MESSAGE: | ||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 5 | while (1) { | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | 7 | my $msg = $self->get_messages($timeout_span); | |||||||||||||||||||||||||||||||||||||||||||||
| 63 | 7 | $self->log->debug('wait_for_testrun loop'); | |||||||||||||||||||||||||||||||||||||||||||||
| 64 | 7 | ($error, $timeout_span) = $self->state->update_state($msg); | |||||||||||||||||||||||||||||||||||||||||||||
| 65 | 7 | ▶ | if ($error) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 5 | ▶ | last MESSAGE if $self->state->testrun_finished; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||
| 73 | sub generate_configs | ||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 8 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_configs: called CC=9 SCAR=22.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 8 | my ($self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 77 | 8 | my $retval; | |||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 8 | my $mcpconfig = Tapper::MCP::Config->new($self->testrun); | |||||||||||||||||||||||||||||||||||||||||||||
| 81 | 8 | my $config = $mcpconfig->create_config(); | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | 8 | ▶ | return $config if not ref($config) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 7 | my $hostname = $self->testrun->testrun_scheduling->host->name; | |||||||||||||||||||||||||||||||||||||||||||||
| 85 | 7 | my $config_file_name = "$hostname-install-".$self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 7 | my @res_reqs = $self->testrun->testrun_requested_resource; | |||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | my @resources = map { defined $_->selected_resource ? $_->selected_resource->name : 'unknown' } @res_reqs; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 7 | $retval = $mcpconfig->write_config($config, $config_file_name); | |||||||||||||||||||||||||||||||||||||||||||||
| 91 | 7 | ▶ | return $retval if $retval; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 7 | ▶ | if ($config->{autoinstall} or $mcpconfig->mcp_info->skip_install) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$config->{"autoinstall"} or $mcpconfig->mcp_info->skip_install
MC/DC100%2/2
$config->{"autoinstall"} or $mcpconfig->mcp_info->skip_install
$config->{"autoinstall"}
$mcpconfig->mcp_info->skip_install
Truth table100%3/3
A or B
A= $config->{"autoinstall"}B= $mcpconfig->mcp_info->skip_install
| |||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 2 | my $common_config = $mcpconfig->get_common_config(); | |||||||||||||||||||||||||||||||||||||||||||||
| 95 | 2 | $common_config->{hostname} = $hostname; # allows guest systems to know their host system name | |||||||||||||||||||||||||||||||||||||||||||||
| 96 | # allows guest system to know the resources that have been selected | ||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 2 | $common_config->{resources} = \@resources; | |||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 2 | my $testconfigs = $mcpconfig->get_test_config(); | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | 2 | ▶ | return $testconfigs if not ref $testconfigs eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | ▶ | for (my $i=0; $i<= $#{$testconfigs}; $i++ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 2 | my $prc_config = merge($common_config, $testconfigs->[$i]); | |||||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | $prc_config->{guest_number} = $i; | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | 2 | $prc_config->{test_type} = $mcpconfig->mcp_info->test_type; | |||||||||||||||||||||||||||||||||||||||||||||
| 106 | 2 | my $suffix = "test-prc$i"; | |||||||||||||||||||||||||||||||||||||||||||||
| 107 | 2 | $suffix .= "-".$self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 2 | $retval = $mcpconfig->write_config($prc_config, "$hostname-$suffix"); | |||||||||||||||||||||||||||||||||||||||||||||
| 110 | 2 | ▶ | return $retval if $retval; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 7 | $self->mcp_info($mcpconfig->mcp_info()); | |||||||||||||||||||||||||||||||||||||||||||||
| 114 | 7 | $config->{hostname} = $hostname; | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 7 | return $config; | |||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | sub report_mcp_results | ||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
report_mcp_results: called CC=5 SCAR=17.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 5 | my $headerlines = $self->mcp_headerlines(); | |||||||||||||||||||||||||||||||||||||||||||||
| 125 | 5 | my $mcp_results = $self->state->state_details->results(); | |||||||||||||||||||||||||||||||||||||||||||||
| 126 | 5 | my ($error, $report_id) = $self->tap_report_send($mcp_results, $headerlines); | |||||||||||||||||||||||||||||||||||||||||||||
| 127 | 5 | ▶ | if ($error) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 128 | $self->log->error('Can not send TAP report for testrun '.$self->testrun->id. | ||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | " on ".$self->cfg->{hostname}.": $report_id"); | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 5 | my $prc_count = $self->state->state_details->prc_count; | |||||||||||||||||||||||||||||||||||||||||||||
| 134 | PRC_RESULT: | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 5 | ▶ | for (my $prc_number = 0; $prc_number < $prc_count; $prc_number++) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 5 | my $prc_results = $self->state->state_details->prc_results($prc_number); | |||||||||||||||||||||||||||||||||||||||||||||
| 138 | 5 | ▶ | next PRC_RESULT if not (ref($prc_results) eq 'ARRAY' and @$prc_results); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $prc_results eq "ARRAY" and @$prc_results
MC/DC0%0/2
ref $prc_results eq "ARRAY" and @$prc_results
ref $prc_results eq "ARRAY"
@$prc_results
Truth table33%1/3
A and B
A= ref $prc_results eq "ARRAY"B= @$prc_results
| |||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $headerlines = $self->prc_headerlines($prc_number); | |||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $self->tap_report_send($prc_results, $headerlines); | |||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 5 | $self->console_stop(); | |||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 5 | $self->upload_files($report_id, $self->testrun->id ); | |||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||
| 148 | sub handle_error | ||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_error: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 1 | my ($self, $error_msg, $error_comment) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 151 | 1 | my $headerlines = $self->mcp_headerlines(); | |||||||||||||||||||||||||||||||||||||||||||||
| 152 | 1 | my $results = [{ error => 1, msg => $error_msg, comment => $error_comment}]; | |||||||||||||||||||||||||||||||||||||||||||||
| 153 | 1 | my ($error, $report_id) = $self->tap_report_send($results, $headerlines); | |||||||||||||||||||||||||||||||||||||||||||||
| 154 | 1 | $self->upload_files($report_id, $self->testrun->id); | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | return $error; | |||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | sub start_testrun | ||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_testrun: called CC=16 SCAR=36.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 7 | my ($self, $config, $revive) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 7 | my $net = Tapper::MCP::Net->new(); | |||||||||||||||||||||||||||||||||||||||||||||
| 164 | 7 | $net->cfg->{testrun_id} = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 165 | 7 | my $hostname = $self->testrun->testrun_scheduling->host->name; | |||||||||||||||||||||||||||||||||||||||||||||
| 166 | 7 | my $lc_type = lc($self->mcp_info->test_type); | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | 7 | ▶ | if($lc_type eq 'simnow'){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | $self->log->debug("Starting Simnow on $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | my $simnow_retval = $net->start_simnow($hostname); | |||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | return $self->handle_error("Starting simnow", $simnow_retval) if $simnow_retval; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 172 | elsif($lc_type eq 'ssh') { | ||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 1 | $self->log->debug("Starting SSH testrun on $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 174 | 1 | my $ssh_retval; | |||||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | ▶ | if ($config->{client_package}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 1 | $ssh_retval = $net->install_client_package($hostname, $config->{client_package}); | |||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | ▶ | return $self->handle_error("Starting Tapper on testmachine with SSH", $ssh_retval) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | if $ssh_retval; | ||||||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 1 | $ssh_retval = $net->start_ssh($hostname); | |||||||||||||||||||||||||||||||||||||||||||||
| 182 | 1 | ▶ | if ($ssh_retval) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $self->handle_error("Starting Tapper on testmachine with SSH", $ssh_retval); | |||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | return ("Starting Tapper on testmachine with SSH failed: $ssh_retval"); | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 187 | elsif($lc_type eq 'local') { | ||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 1 | $self->log->debug("Starting LOCAL testrun on $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | my $local_retval; | |||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | my $tr_id = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 191 | my $path_to_config = $self->mcp_info->skip_install ? | ||||||||||||||||||||||||||||||||||||||||||||||
| 192 | $config->{paths}{localdata_path}."/$hostname-test-prc0-$tr_id" : | ||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | ▶ | $config->{paths}{localdata_path}."/$hostname-install-$tr_id"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 1 | $local_retval = $net->start_local($path_to_config); | |||||||||||||||||||||||||||||||||||||||||||||
| 195 | 1 | ▶ | if ($local_retval) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->handle_error("Starting Tapper locally", $local_retval); | |||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | return ("Starting Tapper locally failed: $local_retval"); | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 200 | elsif($lc_type eq 'minion') { | ||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | $self->log->debug("Starting MINION testrun on $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my $local_retval; | |||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | my $tr_id = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 204 | my $path_to_config = $self->mcp_info->skip_install ? | ||||||||||||||||||||||||||||||||||||||||||||||
| 205 | $config->{paths}{localdata_path}."/$hostname-test-prc0-$tr_id" : | ||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | $config->{paths}{localdata_path}."/$hostname-install-$tr_id"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | $local_retval = $net->start_minion($path_to_config, $revive); | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | if ($local_retval) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | $self->handle_error("Starting Tapper via Minion", $local_retval); | |||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | return ("Starting Tapper via Minion failed: $local_retval"); | |||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | $self->log->debug("Returned from start_minion."); | |||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 214 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 5 | $self->log->debug("Write grub file for $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 216 | 5 | my $grub_retval = $net->write_grub_file($hostname, $config->{installer_grub}); | |||||||||||||||||||||||||||||||||||||||||||||
| 217 | 5 | ▶ | return $self->handle_error("Writing grub file", $grub_retval) if $grub_retval; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 5 | $self->log->debug("rebooting $hostname"); | |||||||||||||||||||||||||||||||||||||||||||||
| 220 | 5 | my $reboot_retval = $self->host_start(); | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | 5 | ▶ | if ($reboot_retval) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $self->handle_error("Booting machine", $reboot_retval); | |||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | return $reboot_retval; | |||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 5 | my ($error, $report) = $net->hw_report_create($self->testrun->id); | |||||||||||||||||||||||||||||||||||||||||||||
| 227 | 5 | ▶ | if ($error) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $self->log->error($report); | |||||||||||||||||||||||||||||||||||||||||||||
| 229 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 5 | $self->tap_report_away($report); | |||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 7 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||
| 238 | sub kill_process | ||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kill_process: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my ($pid) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||
| 242 | # allow testprogram to react on SIGTERM, then do SIGKILL | ||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | kill ('SIGTERM', $pid); | |||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | waitpid $pid, 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | my $grace_period = $ENV{HARNESS_ACTIVE} ? 0 : 2; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | while ( $grace_period > 0 and (kill 0, $pid) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$grace_period > 0 and kill 0, $pid
MC/DC0%0/2
$grace_period > 0 and kill 0, $pid
$grace_period > 0
kill 0, $pid
Truth table0%0/3
A and B
A= $grace_period > 0B= kill 0, $pid
| |||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | $grace_period--; | |||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | sleep 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | if (kill 0, $pid) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | kill 'SIGKILL', $pid; | |||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | waitpid $pid, 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||
| 257 | sub get_process_tree | ||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_process_tree: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | my ($pid) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | return () unless $pid && $pid > 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pid and $pid > 1
MC/DC0%0/2
$pid and $pid > 1
$pid
$pid > 1
Truth table0%0/3
A and B
A= $pidB= $pid > 1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | require Proc::Killfam; | |||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | require Proc::ProcessTable; | |||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | return Proc::Killfam::get_pids(Proc::ProcessTable->new->table, $pid); | |||||||||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||
| 269 | sub kill_process_tree | ||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kill_process_tree: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | my ($pid) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | return unless $pid && $pid > 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pid and $pid > 1
MC/DC0%0/2
$pid and $pid > 1
$pid
$pid > 1
Truth table0%0/3
A and B
A= $pidB= $pid > 1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | my @pids = get_process_tree($pid); | |||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | kill_process($_) foreach ($pid, @pids); | |||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | if (@pids) { kill_process_tree($_) foreach @pids } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||
| 281 | sub kill_local_prc_processes | ||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kill_local_prc_processes: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 6 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 6 | ▶ | if (lc($self->mcp_info->test_type) eq 'local') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 286 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 1 | my $testrun_id = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 288 | 1 | my $cmd = qq(ps auxwww | grep ' \\b[t]apper-prc-testcontrol-$testrun_id\\b' | awk '{print \$2}'); | |||||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | my $pid = qx($cmd); chomp $pid; | |||||||||||||||||||||||||||||||||||||||||||||
| 290 | 1 | ▶ | if ($pid) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | $self->log->debug("Killing pid $pid of testrun $testrun_id"); | |||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | kill_process_tree($pid); | |||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||||||
| 298 | sub cancel_minion_prc_processes | ||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cancel_minion_prc_processes: called CC=2 SCAR=10.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 6 | my ($self, $net) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 6 | ▶ | if (lc($self->mcp_info->test_type) eq 'minion') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 303 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | my $hostname = $self->testrun->testrun_scheduling->host->name; | |||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my $testrun_id = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my $local_retval = $net->stop_minion($testrun_id, $hostname); | |||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||||||
| 313 | sub wait_for_minion_testrun | ||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
wait_for_minion_testrun: called CC=2 SCAR=9.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 6 | my ($self, $net) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 6 | ▶ | if (lc($self->mcp_info->test_type) eq 'minion') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 318 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | my $hostname = $self->testrun->testrun_scheduling->host->name; | |||||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | my $testrun_id = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 321 | #my $local_retval = $net->wait_for_minion_job($testrun_id, $hostname); | ||||||||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||
| 327 | sub runtest_handling | ||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
runtest_handling: called CC=6 SCAR=19.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 7 | my ($self, $revive) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 7 | $self->console_start(); | |||||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 7 | $0 = "tapper-mcp-child-".$self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | $SIG{USR1} = sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | local $SIG{USR1} = 'ignore'; # make handler reentrant, don't handle signal twice | |||||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | my $backtrace = Devel::Backtrace->new(-start=>2, -format => '%I. %s'); | |||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | open my $fh, ">>", '/tmp/tapper-mcp-child-'.$self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | print $fh $backtrace; | |||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | close $fh; | |||||||||||||||||||||||||||||||||||||||||||||
| 341 | 7 | }; | |||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 7 | my $net = Tapper::MCP::Net->new(); | |||||||||||||||||||||||||||||||||||||||||||||
| 344 | 7 | $net->cfg->{testrun_id} = $self->testrun->id; | |||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 7 | my $config = $self->generate_configs(); | |||||||||||||||||||||||||||||||||||||||||||||
| 347 | 7 | ▶ | return $self->handle_error("Generating configs", $config) if ref $config ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 6 | ▶ | if ($config->{testrun_stop}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | my $host = $self->testrun->testrun_scheduling->host; | |||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | $host->active(0); | |||||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | $host->comment($host->comment."(deactivated by testrun".$self->testrun->id.")"); | |||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | $host->update; | |||||||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 6 | ▶ | $self->log->info("Reviving testrun ",$self->testrun->id) if $revive; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 6 | $self->state(Tapper::MCP::State->new(testrun_id => $self->testrun->id, cfg => $config)); | |||||||||||||||||||||||||||||||||||||||||||||
| 358 | 6 | $self->state->state_init($self->mcp_info->get_state_config, $revive ); | |||||||||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 6 | ▶ | if ($self->state->compare_given_state('reboot_install') == 1) { # before reboot_install? | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 6 | my $error = $self->start_testrun($config, $revive); | |||||||||||||||||||||||||||||||||||||||||||||
| 362 | 6 | ▶ | return $error if $error; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 6 | my $message = model('TestrunDB')->resultset('Message')->new | |||||||||||||||||||||||||||||||||||||||||||||
| 365 | ({ | ||||||||||||||||||||||||||||||||||||||||||||||
| 366 | message => {state => 'takeoff', | ||||||||||||||||||||||||||||||||||||||||||||||
| 367 | skip_install => $self->mcp_info->skip_install, | ||||||||||||||||||||||||||||||||||||||||||||||
| 368 | }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 369 | testrun_id => $self->testrun->id, | ||||||||||||||||||||||||||||||||||||||||||||||
| 370 | }); | ||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 6 | $message->insert; | |||||||||||||||||||||||||||||||||||||||||||||
| 372 | 6 | $self->state->update_state($message); | |||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 6 | $self->log->debug('waiting for test to finish'); | |||||||||||||||||||||||||||||||||||||||||||||
| 376 | 6 | $self->wait_for_testrun(); | |||||||||||||||||||||||||||||||||||||||||||||
| 377 | 6 | $self->cancel_minion_prc_processes($net); | |||||||||||||||||||||||||||||||||||||||||||||
| 378 | 6 | $self->wait_for_minion_testrun($net); | |||||||||||||||||||||||||||||||||||||||||||||
| 379 | 6 | $self->kill_local_prc_processes(); | |||||||||||||||||||||||||||||||||||||||||||||
| 380 | 6 | $self->report_mcp_results(); | |||||||||||||||||||||||||||||||||||||||||||||
| 381 | 6 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 20 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||
| 387 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||