diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_extra_dhcp_opts.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_extra_dhcp_opts.py index 0caff3a..a9ca403 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_extra_dhcp_opts.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_extra_dhcp_opts.py @@ -226,7 +226,7 @@ class ExtraDhcpOptionsTest(base.BaseTempestTestCase): # ipv4.domain is not expected vm_resolv_conf = vm_ssh_client.exec_command( "sudo dhclient && cat /etc/resolv.conf") - self.assertIsNone(re.search(r'^search\s+{}$'.format(domain_value), + self.assertIsNone(re.search(r'^search\s+{}\s+'.format(domain_value), vm_resolv_conf, re.MULTILINE)) @@ -241,7 +241,10 @@ class ExtraDhcpOptionsTest(base.BaseTempestTestCase): # ipv4.domain is expected vm_resolv_conf = vm_ssh_client.exec_command( "sudo dhclient && cat /etc/resolv.conf") - self.assertIsNotNone(re.search(r'^search\s+{}$'.format(domain_value), + # (rsafrono) this regex will work reliably even in case dhcp_domain in + # nova.conf is defined, i.e. not an empty value. Helps to stabilize + # the test on podified environments. + self.assertIsNotNone(re.search(r'^search\s+{}\s+'.format(domain_value), vm_resolv_conf, re.MULTILINE))