Skip to content

Commit

Permalink
wip: hibernating nodes made it hang, shutdown instead
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Jul 2, 2024
1 parent fc3fe2b commit 83b1361
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions t/device/50_nodes.t
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ sub test_assign_v2($hd, $node, $number, $volatile=0) {
,login => user_admin->name
};
my $fd;
warn $n_expected;
warn Dumper(\%devices_nodes);
for my $n (1 .. $n_expected*2) {

$fd = Ravada::WebSocket::_list_host_devices(rvd_front(),$ws);
Expand All @@ -255,7 +253,6 @@ sub test_assign_v2($hd, $node, $number, $volatile=0) {
my $id_vm = $domain->_data('id_vm');
$found{$id_vm}++;

warn Dumper(\%found);
last if scalar(keys %found)>1;

}
Expand Down
6 changes: 2 additions & 4 deletions t/kvm/n10_nodes.t
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ sub test_clone_not_in_node {
my @clones;
for ( 1 .. 10 ) {
my $clone1 = $domain->clone(name => new_domain_name, user => user_admin);
diag($clone1->name);
push @clones,($clone1);
is($clone1->_vm->host, 'localhost');
eval { $clone1->start(user_admin) };
Expand Down Expand Up @@ -901,7 +902,7 @@ sub test_node_inactive($vm_name, $node) {

start_node($node);

hibernate_node($node);
shutdown_node($node);
is($node->ping, 0);
is($node->_do_is_active,0);
is($node->_data('is_active'), 0);
Expand Down Expand Up @@ -1167,9 +1168,6 @@ SKIP: {
next;
};

# remove
test_clone_not_in_node($vm_name, $node);

is($node->is_local,0,"Expecting ".$node->name." ".$node->ip." is remote" ) or BAIL_OUT();
test_already_started_hibernated($vm_name, $node);

Expand Down
8 changes: 6 additions & 2 deletions t/lib/Test/Ravada.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,11 @@ sub shutdown_node($node) {
}
sleep 1;
}
$domain_node->shutdown_now(user_admin) if $domain_node->is_active;
$domain_node->shutdown_now(user_admin);# if $domain_node->is_active;
for my $req ( $domain_node->list_requests) {
diag($req->command);
$req->_delete();
}
is($node->ping(undef,0),0);
}

Expand Down Expand Up @@ -2230,7 +2234,7 @@ sub start_node($node) {
Ravada::Request->connect_node(uid => user_admin->id
,id_node => $node->id
);
wait_request();
wait_request(check_error => 0);
eval {
$node->disconnect;
$node->clear_netssh();
Expand Down

0 comments on commit 83b1361

Please sign in to comment.