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

[#202] test domain starts in same VM

parent 656f3a25
......@@ -114,8 +114,8 @@ sub test_domain_no_remote {
sub test_remove_domain_from_local {
my ($vm_name, $node, $domain_orig) = @_;
$domain_orig->shutdown_now(user_admin) if $domain_orig->is_active;
warn "Removing domain ".$domain_orig->name." from local";
my $vm = rvd_back->search_vm($vm_name);
my $domain = $vm->search_domain($domain_orig->name);
......@@ -128,7 +128,7 @@ sub test_remove_domain_from_local {
ok(!$domain2,"Expecting no domain in local");
my $domain3 = $node->search_domain($domain->name);
ok(!$domain3,"Expecting no domain in node");
ok(!$domain3,"Expecting no domain ".$domain->name." in node ".$node->name) or exit;
test_remove_domain_node($node, $domain, \@volumes);
......@@ -173,7 +173,12 @@ sub test_remove_domain_node {
}
sub test_domain_starts_in_same_vm {
my ($vm_name, $node, $domain) = @_;
my ($vm_name, $node) = @_;
my $domain = test_domain($vm_name, $node);
my $display = $domain->display(user_admin);
$domain->shutdown_now(user_admin) if $domain->is_active;
unlike($domain->_vm->host, qr/localhost/) or return;
is($domain->_vm->host, $node->host) or return;
......@@ -181,8 +186,13 @@ sub test_domain_starts_in_same_vm {
my $domain2 = rvd_back->search_domain($domain->name);
ok($domain2,"Expecting a domain called ".$domain->name) or return;
$domain2->start(user => user_admin);
is($domain2->_vm->host, $node->host);
is($domain2->display(user_admin), $display);
$domain->remove(user_admin);
}
#############################################################
clean();
......@@ -222,9 +232,7 @@ SKIP: {
my $domain3 = test_domain($vm_name, $node);
test_remove_domain($vm_name, $node, $domain3) if $domain3;
my $domain4 = test_domain($vm_name, $node);
test_domain_starts_in_same_vm($vm_name, $node, $domain4) if $domain4;
test_domain_starts_in_same_vm($vm_name, $node);
}
}
......
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