Unverified Commit fd786236 authored by Francesc Guasch's avatar Francesc Guasch Committed by GitHub
Browse files

smbios hostname (#1148)

* test(KVM): change smbios on rename
* fix(KVM): change smbios on rename

fiuxes issue #1146
parent 6801dbe5
......@@ -1431,6 +1431,11 @@ sub rename {
my $new_name = $args{name};
$self->domain->rename($new_name);
my $doc = XML::LibXML->load_xml(string => $self->domain->get_xml_description);
$self->_vm->_xml_add_sysinfo_entry($doc, hostname => $new_name);
my $new_domain = $self->_vm->vm->define_domain($doc->toString);
$self->domain($new_domain);
}
=head2 disk_size
......
......@@ -19,7 +19,7 @@ our $XML = XML::LibXML->new();
###################################################################################3
sub test_sysinfo($domain) {
sub test_sysinfo($domain, $domain_name=$domain->name) {
my $doc = $XML->load_xml(string => $domain->domain->get_xml_description())
or die "ERROR: $!\n";
......@@ -45,7 +45,6 @@ sub test_sysinfo($domain) {
}
ok($hostname,"Expecting a hostname entry in ".$oemstrings->toString) and do {
my $hostname_text = $hostname->textContent();
my $domain_name = $domain->name;
like($hostname_text, qr{^hostname: $domain_name$});
};
}
......@@ -72,11 +71,19 @@ SKIP: {
my $domain = create_domain($vm);
test_sysinfo($domain);
my $rename = new_domain_name;
$domain->rename(name => $rename, user => user_admin);
test_sysinfo($domain, $rename);
$domain = Ravada::Domain->open($domain->id);
test_sysinfo($domain, $rename);
my $clone_name = new_domain_name;
my $clone = $domain->clone(
name => new_domain_name
name => $clone_name
,user => user_admin
);
test_sysinfo($clone);
test_sysinfo($clone, $clone_name);
}
......
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