Commit 64c29840 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(test): better check of download test flag

parent 2c73d0dc
......@@ -1396,7 +1396,7 @@ sub start_node($node) {
$node->enabled(1);
for ( reverse 1 .. 120 ) {
my $node2 = Ravada::VM->open(id => $node->id);
last if $node2->is_active(1) && $node->ssh;
last if $node2->is_active(1) && $node->_ssh;
diag("Waiting for node ".$node2->name." active ... $_") if !($_ % 10);
$node2->disconnect();
$node2->connect();
......
......@@ -14,12 +14,6 @@ use feature qw(signatures);
use lib 't/lib';
use Test::Ravada;
if (! $ENV{TEST_DOWNLOAD}) {
diag("Skipped: enable setting environment variable TEST_DOWNLOAD");
done_testing();
exit;
}
init();
$Ravada::DEBUG=0;
......@@ -176,19 +170,26 @@ sub test_refresh_isos {
##################################################################
my $msg;
if (! $ENV{TEST_DOWNLOAD}) {
$msg = "Skipped: enable setting environment variable TEST_DOWNLOAD";
} else {
init();
}
for my $vm_name ('KVM') {
my $rvd_back = rvd_back();
add_locales();
local_urls();
my $vm = $rvd_back->search_vm($vm_name);
my $vm;
$vm = $rvd_back->search_vm($vm_name) if !$msg;
SKIP: {
my $msg = "SKIPPED: No virtual managers found";
$msg = "SKIPPED: No virtual managers found" if !$vm && !$msg;
if ($vm && $vm_name =~ /kvm/i && $>) {
$msg = "SKIPPED: Test must run as root";
$vm = undef;
}
if (!httpd_localhost()) {
if (!$msg && !httpd_localhost()) {
$vm = undef;
$msg = "SKIPPED: No http on localhost with /iso";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment