Commit c66ec54e authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(test): smaller disk on tests

parent de58169c
......@@ -312,7 +312,7 @@ for my $vm_name ( vm_names() ) {
my $vm;
eval {
$vm= $ravada->search_vm($vm_name) if $ravada;
@ARG_CREATE_DOM = ( id_iso => search_id_iso('alpine'), vm => $vm_name, id_owner => $USER->id ) if $vm;
@ARG_CREATE_DOM = ( id_iso => search_id_iso('alpine'), vm => $vm_name, id_owner => $USER->id , disk => 1024 * 1024 ) if $vm;
};
SKIP: {
......
......@@ -77,6 +77,7 @@ sub test_new_domain {
, active => $active
, id_owner => $USER->id
, vm => $BACKEND
, disk => 1024 * 1024
);
ok($domain,"Domain not created");
......
......@@ -64,6 +64,7 @@ sub test_new_domain_from_iso {
, id_iso => search_id_iso('alpine')
,vm => $BACKEND
,id_owner => $USER->id
,disk => 1024 * 1024
)
};
is(''.$@,'') or return;
......
......@@ -129,6 +129,7 @@ sub test_req_create_domain_iso {
,id_iso => search_id_iso('alpine')
,id_owner => $USER->id
,vm => $BACKEND
,disk => 1024 * 1024
);
ok($req);
ok($req->status);
......@@ -159,6 +160,7 @@ sub test_force_kvm {
,id_iso => search_id_iso('alpine')
,id_owner => $USER->id
,vm => 'kvm'
,disk => 1024 * 1024
);
ok($req);
ok($req->status);
......
......@@ -34,6 +34,9 @@ sub create_node {
my @list_nodes0 = rvd_front->list_vms;
eval { $node = $vm->new(%{$REMOTE_CONFIG}) };
warn $@ if $@;
return if !$node;
shutdown_node($node) if $node->ping && !$node->is_active();
start_node($node);
......
......@@ -46,7 +46,7 @@ for my $vm_name ( 'KVM') {
last if $node->ping;
sleep 1;
}
like($node->_data('mac'),qr([\da-f][\da-f]:[\da-f][\da-f]:\d\d:\d\d:)) or next;
like($node->_data('mac'),qr([\da-f][\da-f]:[\da-f][\da-f]:[\da-f][\da-f]:[\da-f][\da-f]:[\da-f][\da-f]:)) or next;
is( $node->is_active, 1 );
$node->shutdown();
......
......@@ -73,8 +73,10 @@ for my $vm_name ( 'Void', 'KVM') {
diag("Testing remote node in $vm_name");
my ($node1,$node2) = remote_node_2($vm_name);
ok($node2,"Expecting at least 2 nodes configured to test") or next;
clean_remote_node($node1);
clean_remote_node($node2);
clean_remote_node($node2) if $node2;
test_change_hardware($vm);
test_change_hardware($vm, $node1);
......
......@@ -40,7 +40,8 @@ sub test_swap {
name => $name
,vm => $vm_name
,@ARG_CREATE_DOM
,swap => 128*1024*1024
,swap => 1024*1024
,disk => 1024*1024
);
ok($req);
rvd_back()->_process_all_requests_dont_fork();
......@@ -537,7 +538,7 @@ for my $vm_name ( qw(KVM Void)) {
my $rvd_back = rvd_back();
my $vm= $rvd_back->search_vm($vm_name) if rvd_back();
$vm_connected = 1 if $vm;
@ARG_CREATE_DOM = ( id_iso => search_id_iso('Alpine'), vm => $vm_name, id_owner => $USER->id );
@ARG_CREATE_DOM = ( id_iso => search_id_iso('Alpine'), vm => $vm_name, id_owner => $USER->id, disk => 1024 * 1024 );
if ($vm_name eq 'KVM') {
my $iso = $vm->_search_iso($ID_ISO);
......
......@@ -84,6 +84,10 @@ sub test_list_bridges($vm) {
}
sub _expected_bridges($vm) {
my $brctl = `which brctl`;
chomp $brctl;
return if !$brctl;
my @exp_bridges = grep { defined $_ && $_ ne 'bridge' }
map { /(^\w+)\s*/; $1 }
split /\n/,`brctl show`;
......
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