Skip to content

Commit

Permalink
[UPC#441] test copy non base domain
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Nov 27, 2017
1 parent a99ca7c commit a177a1d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t/vm/45_vol_swap.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sub test_domain_with_swap {
name => new_domain_name
,user => user_admin
);
is($clone->is_base,1);
is($clone->is_base,0);

$clone2->start(user_admin);
$clone2->shutdown_now(user_admin);
Expand Down
31 changes: 31 additions & 0 deletions t/vm/c10_copy.t
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,35 @@ sub test_copy_change_ram {
$base->remove(user_admin);
}

sub test_copy_req_nonbase {
my $vm_name = shift;
my $domain = create_domain($vm_name);

my $name_copy = new_domain_name();

my $req;
eval { $req = Ravada::Request->clone(
id_domain => $domain->id
, name => $name_copy
, uid => user_admin->id
);
};
is($@,'') or return;
is($req->status(),'requested');
rvd_back->_process_all_requests_dont_fork();
is($req->status(),'done');
is($req->error,'');

my $copy = rvd_back->search_domain($name_copy);
ok($copy,"[$vm_name] Expecting domain $name_copy");

is($domain->is_base,1);

$copy->remove(user_admin);
$domain->remove(user_admin);

}

##########################################################################3

clean();
Expand All @@ -182,6 +211,8 @@ for my $vm_name ('Void', 'KVM') {
test_copy_request($vm_name);

test_copy_change_ram($vm_name);

test_copy_req_nonbase($vm_name);
}

}
Expand Down

0 comments on commit a177a1d

Please sign in to comment.