Commit 28f3dd49 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch 'develop' of https://github.com/UPC/ravada into develop

parents 0022a545 b30c58e6
......@@ -863,9 +863,3 @@ msgstr ""
msgid "Enable last for not allowed restrictions."
msgstr ""
msgid ""
msgstr ""
msgid ""
msgstr ""
\ No newline at end of file
......@@ -85,6 +85,7 @@ our %VALID_ARG = (
,remove_hardware => {uid => 1, id_domain => 1, name => 1, index => 1}
,change_hardware => {uid => 1, id_domain => 1, hardware => 1, index => 1, data => 1 }
,change_max_memory => {uid => 1, id_domain => 1, ram => 1}
,change_curr_memory => {uid => 1, id_domain => 1, ram => 1}
,enforce_limits => { timeout => 2, _force => 2 }
,refresh_machine => { id_domain => 1, uid => 1 }
,rebase_volumes => { uid => 1, id_base => 1, id_domain => 1 }
......@@ -139,7 +140,8 @@ our %COMMAND = (
}
,disk => {
limit => 1
,commands => ['prepare_base','remove_base','set_base_vm','rebase_volumes']
,commands => ['prepare_base','remove_base','set_base_vm','rebase_volumes'
, 'manage_pools']
,priority => 6
}
,important=> {
......
......@@ -6,6 +6,9 @@ use warnings;
use Data::Dumper;
use Test::More;
no warnings "experimental::signatures";
use feature qw(signatures);
use lib 't/lib';
use Test::Ravada;
......@@ -89,6 +92,42 @@ sub test_change_memory_base {
$domain->remove(user_admin);
}
sub test_req_change_mem($vm) {
my $domain = create_domain($vm);
my $max_mem = $domain->info(user_admin)->{max_mem};
my $mem = $domain->info(user_admin)->{memory};
my $new_max_mem = int($max_mem * 1.5 ) + 1;
my $new_mem = int($mem * 1.5 ) + 1;
my $req1 = Ravada::Request->change_max_memory(
uid => user_admin->id
,id_domain => $domain->id
,ram => $new_max_mem
);
my $req2 = Ravada::Request->change_curr_memory(
uid => user_admin->id
,id_domain => $domain->id
,ram => $new_max_mem
);
wait_request(check_error => 1, background => 0);
is($req1->status,'done');
is($req2->status,'done');
is($req1->error,'');
is($req2->error,'');
my $max_mem2 = $domain->info(user_admin)->{max_mem};
my $mem2 = $domain->info(user_admin)->{memory};
is($max_mem2, $new_max_mem);
is($mem2, $new_mem);
$domain->remove(user_admin);
}
####################################################################
for my $vm_name ( q(KVM) ) {
......@@ -110,6 +149,8 @@ for my $vm_name ( q(KVM) ) {
diag("Testing free mem on $vm_name");
test_req_change_mem($vm);
test_change_memory($vm, 2, 2);
test_change_memory($vm, 2, 2, 1);
......
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