Skip to content

Commit

Permalink
Merge pull request #19369 from pdostal/run_ltp
Browse files Browse the repository at this point in the history
Run ltp
  • Loading branch information
pdostal committed May 23, 2024
2 parents cc60add + b7023e3 commit 69b8e8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/publiccloud/ec2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ sub img_proof {

sub cleanup {
my ($self, $args) = @_;
#if for some reason the instance is not created everything below does not make sense to execute
return unless ($args->{my_instance} && $args->{my_instance}->{instance_id});
my $instance_id = $args->{my_instance}->{instance_id};
script_run('cd ~/terraform');
my $instance_id = script_output('terraform output -json | jq -r ".vm_name.value[0]"', proceed_on_failure => 1);
script_run('cd');

select_host_console(force => 1);

Expand Down
3 changes: 1 addition & 2 deletions tests/publiccloud/run_ltp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sub run {
$instance = $self->{my_instance} = $args->{my_instance};
$provider = $self->{provider} = $args->{my_provider}; # required for cleanup
} else {
$provider = $self->provider_factory();
$provider = $self->{provider} = $self->provider_factory(); # required for cleanup
$instance = $self->{my_instance} = $provider->create_instance(check_guestregister => is_openstack ? 0 : 1);
}

Expand Down Expand Up @@ -193,7 +193,6 @@ sub cleanup {
script_run("(cd /tmp/log_instance && tar -zcf $root_dir/instance_log.tar.gz *)");
upload_logs("$root_dir/instance_log.tar.gz", failok => 1);
}
$self->SUPER::cleanup();
}

sub gen_ltp_env {
Expand Down

0 comments on commit 69b8e8c

Please sign in to comment.