Skip to content

Commit e93994c

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

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
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: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ sub test_network_interface {
220220
$is_sriov_test = "true" if caller 0 eq 'sriov_network_card_pci_passthrough';
221221
script_retry("nmap $guest -PN -p ssh | grep open", delay => 30, retry => 6, timeout => 180);
222222
if ($guest =~ /sles-16/i) {
223+
script_retry("ssh root\@$guest ip -o link | grep -i $mac", delay => 30, retry => 10, die => 0) if ($isolated == 1);
223224
$nic = script_output(qq(ssh root\@$guest ip -o link | grep -i $mac | awk '{gsub(/:/, "", \$2); print \$2}'), proceed_on_failure => 1, timeout => 60);
224225
} else {
225226
$nic = script_output "ssh root\@$guest \"grep '$mac' /sys/class/net/*/address | cut -d'/' -f5 | head -n1\"";
@@ -467,15 +468,10 @@ sub setup_vm_simple_dns_with_ip {
467468

468469
my $_dns_file = '/etc/hosts';
469470

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-
476471
script_run "sed -i '/$_vm/d' $_dns_file";
477472
assert_script_run "echo '$_ip $_vm' >> $_dns_file";
478-
assert_script_run "cp $_dns_file /etc/hosts" if (is_alp);
473+
my $guest_domain_name = $_vm . ".qe.prg2.suse.org";
474+
assert_script_run "echo '$_ip $guest_domain_name' >> $_dns_file";
479475
save_screenshot;
480476
record_info("Simple DNS setup in /etc/hosts for $_ip $_vm is successful!", script_output("cat /etc/hosts"));
481477
}

tests/virt_autotest/libvirt_isolated_virtual_network.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sub run_test {
4747
assert_script_run("virsh attach-interface $guest network vnet_isolated --model $data->{model} --mac $mac --live $data->{affecter}", 60);
4848

4949
#Wait for guests attached interface from virtual isolated network
50-
sleep 30;
50+
sleep 300;
5151
test_network_interface($guest, mac => $mac, gateway => $data->{gateway}, isolated => 1, net => $data->{net});
5252

5353
assert_script_run("virsh detach-interface $guest --mac $mac $data->{exclusive}");

0 commit comments

Comments
 (0)