From 492aefd7c853ab11e7ef2b6579c7f92a69e24801 Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Tue, 26 Dec 2023 12:19:28 +0530 Subject: [PATCH] Reintroduce strict regex for extra_dhcp_opt test This is partial revert of [1]. The issue got triggered as by default dhcp_domain is set to 'novalocal' in nova and dhclient includes that local domain when setting up resolv.conf as part of [2]. To have predictable domain only derived as part of neutron configuration the job unset's dhcp_domain in nova conf. [1] https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/904331 [2] https://bugzilla.redhat.com/show_bug.cgi?id=637763 Change-Id: Id5966cc7447a688ad1a1a8800993096d18f29194 --- .../tests/scenario/test_extra_dhcp_opts.py | 6 +----- zuul.d/master_jobs.yaml | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) 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 6498761..0caff3a 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 @@ -241,11 +241,7 @@ class ExtraDhcpOptionsTest(base.BaseTempestTestCase): # ipv4.domain is expected vm_resolv_conf = vm_ssh_client.exec_command( "sudo dhclient && cat /etc/resolv.conf") - # (rsafrono) for some reason with devstack there is sometimes one more - # entry in the 'search' line, a char 'n' before the end of the line - # causing the test to fail. Changing the regex to be less stict - # in order to unblock the gates. - self.assertIsNotNone(re.search(r'^search\s+{}\s+'.format(domain_value), + self.assertIsNotNone(re.search(r'^search\s+{}$'.format(domain_value), vm_resolv_conf, re.MULTILINE)) diff --git a/zuul.d/master_jobs.yaml b/zuul.d/master_jobs.yaml index fcd5032..8825458 100644 --- a/zuul.d/master_jobs.yaml +++ b/zuul.d/master_jobs.yaml @@ -184,6 +184,9 @@ $NEUTRON_DHCP_CONF: agent: availability_zone: nova + $NOVA_CONF: + api: + dhcp_domain: '' test-config: $TEMPEST_CONFIG: neutron_plugin_options: