Bug 1893668

Summary: Neutron - “dns_name” is set to None when the “dns” extension is missing
Product: Red Hat OpenStack Reporter: Arkady Shtempler <ashtempl>
Component: python-networking-ovnAssignee: Slawek Kaplonski <skaplons>
Status: CLOSED ERRATA QA Contact: Maor <mblue>
Severity: medium Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: apevec, chrisw, ekuris, lhh, majopela, scohen
Target Milestone: gaKeywords: Reopened, Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-networking-ovn-7.3.1-1.20210409093429.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-04 16:50:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Arkady Shtempler 2020-11-02 10:37:55 UTC
### Scenario ###
1) Deploy Overcloud without DNS Neutron Plugin Extension.
Do not include the template needed: virt/dns.yaml with the following content:
parameter_defaults:
    ExtraConfig:
        neutron::dns_domain: openstackgate.local
    NeutronPluginExtensions: qos,port_security,dns

2) Install neutron-tempest-plugin and run: “test_create_update_port_with_dns_name” with:
python3 -m testtools.run neutron_tempest_plugin.api.test_ports.PortsTestJSON.test_create_update_port_with_dns_name


### Actual Result ###
1) Tempest test fails(as expected) with:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-
    return func(*func_args, **func_kwargs)
  File "/home/stack/neutron-tempest-
    self.assertEqual('d1', body['dns_name'])
  File "/usr/lib/python3.6/site-
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3.6/site-
    raise mismatch_error
testtools.matchers._impl.

2) It looks like a given "dns_name" is simply ignored by Neutron and the reason for that is unknown, there is nothing logged on that in neutron logs.

3) API response code is 201 and no error in response body. 
According to API response payload, “dns_name” is actually empty
2020-11-01 10:37:46,251 943702 DEBUG    [tempest.lib.common.rest_
        Body: {"port": {"network_id": "6859d4d1-429a-4b78-8d6e- "dns_name": "d1"}}
    Response - Headers: {'content-type': 'application/json', 'content-length': '877', 'x-openstack-request-id': 'req-f50a1e45-6d93-41f0-aaf8-http://10.0.0.120:9696/v2.0/'}
        Body: b'{"port":{"id":"b1e03f0f-dns_name":"",
}}}


### Expected Result ###
When DNS extension is not set/configured/installed we would expect that the API will fail with 4XX status code + appropriate Error message in response body.

Comment 1 Slawek Kaplonski 2020-11-30 22:04:01 UTC
I found out that this is an issue with ovn_l3 service plugin which loads 'dns-integration' API extension always. As this extension is loaded, it provides "dns_name" attribute so neutron knows it and that's why it don't returns 400 Bad request.
I reported u/s bug for that and proposed fix already. All is linked in that BZ.

Comment 8 errata-xmlrpc 2021-09-15 07:09:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:3483