Skip to content

Commit

Permalink
wip: change max cpus when machine up
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Jul 19, 2023
1 parent dd91c0a commit bcb498e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions t/request/33_hw_cpu.t
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,32 @@ sub test_current_max($vm) {
wait_request();

is($domain->needs_restart,0) or exit;

# now we req increase up , it should need restart and info increases too
my $req3 = Ravada::Request->change_hardware(
hardware => 'cpu'
,id_domain => $domain->id
,uid => user_admin->id
,'data' => {
'_can_edit' => 1,
'vcpu' => {
'placement' => 'static',
'#text' => $max_cpu+1,
,'current' => 2
},
'cpu'=> $info0->{hardware}->{cpu}->[0]->{cpu}
},
);
wait_request(debug => 1);

my $domain3 = Ravada::Front::Domain->open($domain->id);
is($domain3->needs_restart,1) or exit;

my $info3 = $domain3->info(user_admin);
is($info3->{hardware}->{cpu}->[0]->{vcpu}->{current},2);
is($info3->{hardware}->{cpu}->[0]->{vcpu}->{'#text'}, $max_cpu+1);
die Dumper($info3->{hardware}->{cpu}->[0]);

$domain->remove(user_admin);
}

Expand Down

0 comments on commit bcb498e

Please sign in to comment.