@@ -220,6 +220,7 @@ sub test_network_interface {
220
220
$is_sriov_test = " true" if caller 0 eq ' sriov_network_card_pci_passthrough' ;
221
221
script_retry(" nmap $guest -PN -p ssh | grep open" , delay => 30, retry => 6, timeout => 180);
222
222
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);
223
224
$nic = script_output(qq( ssh root\@ $guest ip -o link | grep -i $mac | awk '{gsub(/:/, "", \$ 2); print \$ 2}') , proceed_on_failure => 1, timeout => 60);
224
225
} else {
225
226
$nic = script_output " ssh root\@ $guest \" grep '$mac ' /sys/class/net/*/address | cut -d'/' -f5 | head -n1\" " ;
@@ -467,15 +468,12 @@ sub setup_vm_simple_dns_with_ip {
467
468
468
469
my $_dns_file = ' /etc/hosts' ;
469
470
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
-
476
471
script_run " sed -i '/$_vm/d' $_dns_file" ;
477
472
assert_script_run " echo '$_ip $_vm' >> $_dns_file" ;
478
- assert_script_run " cp $_dns_file /etc/hosts" if (is_alp);
473
+ my $cmd = qq( nmcli dev show | grep DOMAIN | awk '{print \$ 2}' | uniq) ;
474
+ my $host_domain_name = script_output($cmd );
475
+ my $guest_domain_name = " $_vm.$host_domain_name " ;
476
+ assert_script_run " echo '$_ip $guest_domain_name ' >> $_dns_file" ;
479
477
save_screenshot;
480
478
record_info(" Simple DNS setup in /etc/hosts for $_ip $_vm is successful!" , script_output(" cat /etc/hosts" ));
481
479
}
0 commit comments