Skip to content

Commit b826bac

Browse files
committed
Deploy sles16 guest system with br0 for virtual network runs
https://progress.opensuse.org/issues/188127
1 parent 21f2541 commit b826bac

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

data/virt_autotest/guest_params_xml_files/sles_16_64_kvm_hvm_x86_64_agama_online_iso.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<guest_storage_backing_format/>
4343
<guest_storage_others>driver.name=qemu,target.dev=vda,target.bus=virtio,bus=virtio,cache=none</guest_storage_others>
4444
<guest_network_type>bridge</guest_network_type>
45-
<guest_network_mode>bridge</guest_network_mode>
45+
<guest_network_mode>host</guest_network_mode>
4646
<guest_network_device/>
4747
<guest_network_others/>
4848
<guest_netaddr/>

lib/virt_autotest/virtual_network_utils.pm

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,15 +467,12 @@ sub setup_vm_simple_dns_with_ip {
467467

468468
my $_dns_file = '/etc/hosts';
469469

470-
# Workaround for directly editing file issue: resource busy
471-
if (is_alp) {
472-
$_dns_file = '/etc/hosts.wip';
473-
assert_script_run "cp /etc/hosts $_dns_file";
474-
}
475-
476470
script_run "sed -i '/$_vm/d' $_dns_file";
477471
assert_script_run "echo '$_ip $_vm' >> $_dns_file";
478-
assert_script_run "cp $_dns_file /etc/hosts" if (is_alp);
472+
my $cmd = qq(nmcli dev show | grep DOMAIN | awk '{print \$2}' | uniq);
473+
my $host_domain_name = script_output($cmd);
474+
my $guest_domain_name = "$_vm.$host_domain_name";
475+
assert_script_run "echo '$_ip $guest_domain_name' >> $_dns_file";
479476
save_screenshot;
480477
record_info("Simple DNS setup in /etc/hosts for $_ip $_vm is successful!", script_output("cat /etc/hosts"));
481478
}

0 commit comments

Comments
 (0)