Commit 0f83af9b authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#71] replicated the double PCI address problem

parent 97f9c75a
......@@ -223,10 +223,26 @@ sub _check_disk {
sub _check_create_domain {
my $self = shift;
my %args = @_;
$self->_check_readonly(@_);
$self->_check_require_base(@_);
$self->_check_memory(@_);
$self->_check_disk(@_);
}
sub _check_require_base {
my $self = shift;
my %args = @_;
return if !$args{id_base};
my $base = $self->search_domain_by_id($args{id_base});
die "ERROR: Domain ".$self->name." is not base"
if !$base->is_base();
}
1;
......@@ -81,14 +81,34 @@ for my $vm_name (reverse sort @VMS) {
skip $msg,10 if !$vm;
my $domain = test_create_domain($vm_name);
eval { $domain->start($USER) if !$domain->is_active() };
is($@,'');
ok($domain->is_active);
$domain->shutdown_now($USER);
my @domain = ( $domain);
for my $n ( 1 .. 3 ) {
my $name_clone = new_domain_name();
my $clone = $domain->clone(name => $name_clone, user => $USER);
ok($clone,"Expecting new cloned domain");
my $clone1;
my $base = $domain[$n-1];
eval { $clone1 = $base->clone(name => $name_clone, user => $USER) };
ok(!$@,"Expecting error='', got='".($@ or '')."'");
ok($clone1,"Expecting new cloned domain from ".$base->name) or last;
my $clone2 = $RVD_FRONT->search_domain($name_clone);
ok($clone,"Expecting new cloned domain ".$name_clone);
$clone1->shutdown_now($USER) if $clone1->is_active();
eval { $clone1->start($USER) };
is($@,'');
ok($clone1->is_active);
my $clone1b = $RVD_FRONT->search_domain($name_clone);
ok($clone1b,"Expecting new cloned domain ".$name_clone);
$clone1->shutdown_now($USER) if $clone1->is_active;
ok(!$clone1->is_active);
push @domain,($clone1);
}
}
}
......
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