Bug 1530131 - test_create_update_port_with_dns_domain failed with KeyError: 'dns_domain'
Summary: test_create_update_port_with_dns_domain failed with KeyError: 'dns_domain'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 12.0 (Pike)
Assignee: Slawek Kaplonski
QA Contact: Martin Kopec
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-02 07:01 UTC by jinhua li
Modified: 2022-07-09 12:41 UTC (History)
12 users (show)

Fixed In Version: openstack-neutron-11.0.4-6.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-05 18:53:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 575726 0 'None' MERGED Enable dns_domain_ports extension in tempest config 2020-05-07 06:55:44 UTC
Red Hat Issue Tracker OSP-8712 0 None None None 2022-07-09 12:41:47 UTC
Red Hat Product Errata RHSA-2018:3792 0 None None None 2018-12-05 18:53:35 UTC

Description jinhua li 2018-01-02 07:01:52 UTC
Description of problem:
There is always an error when I run "ostestr neutron.tests.tempest.api.test_ports.PortsTestJSON.test_create_update_port_with_dns_domain".

Environment:

RHOSP12
openstack-tempest-17.1.0-1.el7ost.noarch

 
I have configured the files:

[snip]
1. Add dns to extension_drivers in the [ml2] section of /etc/neutron/plugins/ml2/ml2_conf.ini
2. Edit the /etc/neutron/neutron.conf file and assign a value different to openstacklocal (its default value) to the dns_domain parameter in the [default] section.

[/snip]


The error is as below:

Captured pythonlogging:
~~~~~~~~~~~~~~~~~~~~~~~
    2018-01-02 06:31:26,313 43286 INFO     [tempest.lib.common.rest_client] Request (PortsTestJSON:test_create_update_port_with_dns_domain): 201 POST http://10.65.176.79:9696/v2.0/subnets 0.449s
    2018-01-02 06:31:26,313 43286 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
            Body: {"subnet": {"ip_version": 4, "network_id": "b8ceb8be-8285-424e-8aac-1eba296e2315", "cidr": "10.100.0.0/28", "gateway_ip": "10.100.0.1"}}
        Response - Headers: {'status': '201', u'content-length': '602', 'content-location': 'http://10.65.176.79:9696/v2.0/subnets', u'date': 'Tue, 02 Jan 2018 01:01:26 GMT', u'content-type': 'application/json', u'connection': 'close', u'x-openstack-request-id': 'req-8e4c5b1e-ff06-45ae-8020-71420e88adb8'}
            Body: {"subnet":{"service_types":[],"description":"","enable_dhcp":true,"tags":[],"network_id":"b8ceb8be-8285-424e-8aac-1eba296e2315","tenant_id":"64b3e83985194130b45d2444f6a5e8cf","created_at":"2018-01-02T01:01:26Z","dns_nameservers":[],"updated_at":"2018-01-02T01:01:26Z","gateway_ip":"10.100.0.1","ipv6_ra_mode":null,"allocation_pools":[{"start":"10.100.0.2","end":"10.100.0.14"}],"host_routes":[],"revision_number":0,"ip_version":4,"ipv6_address_mode":null,"cidr":"10.100.0.0/28","project_id":"64b3e83985194130b45d2444f6a5e8cf","id":"d11693b5-15de-4253-b286-9e8b21860d78","subnetpool_id":null,"name":""}}
    2018-01-02 06:31:26,323 43286 INFO     [tempest.lib.common.rest_client] Request (PortsTestJSON:test_create_update_port_with_dns_domain): 400 POST http://10.65.176.79:9696/v2.0/ports 0.009s
    2018-01-02 06:31:26,323 43286 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
            Body: {"port": {"network_id": "b8ceb8be-8285-424e-8aac-1eba296e2315", "dns_name": "d1", "dns_domain": "test.org."}}
        Response - Headers: {'status': '400', u'content-length': '111', 'content-location': 'http://10.65.176.79:9696/v2.0/ports', u'date': 'Tue, 02 Jan 2018 01:01:26 GMT', u'content-type': 'application/json', u'connection': 'close', u'x-openstack-request-id': 'req-077784ab-ef5b-4588-8a5b-7fe9010df8d9'}
            Body: {"NeutronError": {"message": "Unrecognized attribute(s) 'dns_domain'", "type": "HTTPBadRequest", "detail": ""}}



And according to https://docs.openstack.org/mitaka/networking-guide/config-dns-int.html, ports do not support dns_domain. So could you let me know whether I need to the additional setting for this test, or is this failure normal?


Resource	dns_name	dns_domain
Ports	Yes	No
Networks	No	Yes
Floating IPs	Yes	Yes

Comment 1 Chandan Kumar 2018-01-02 07:16:21 UTC
For running this test on tempest side, in tempest.conf under [network-feature-enabled] section make sure you include 'dns-domain-ports' in api_extensions option and make sure it is configured on the system.

Comment 2 jinhua li 2018-01-02 07:34:06 UTC
 I have included "dns-domain-ports" in tempest.conf, if this is not related to temp, and the error still exists.

Comment 3 jinhua li 2018-01-02 10:03:40 UTC
Found the new confirguration, and will have a try  
https://docs.openstack.org/neutron/pike/admin/config-dns-int.html

Comment 4 jinhua li 2018-01-04 09:20:27 UTC
Hi Chandan Kumar ,


I set the configuration as below:

1. Edit the /etc/neutron/neutron.conf file and assign a value different to openstacklocal (its default value) to the dns_domain parameter in the [default] section. As an example:

dns_domain = example.org.
2. Add dns (for the DNS Integration extension) or dns_domain_ports (for the dns_domain for ports extension) to extension_drivers in the [ml2] section of /etc/neutron/plugins/ml2/ml2_conf.ini. The following is an example:

[ml2]
extension_drivers = port_security,dns_domain_ports

And after I run "ostestr neutron.tests.tempest.api.test_ports.PortsTestJSON.test_create_update_port_with_dns_domain
"
There is another error:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tempest/common/utils/__init__.py", line 108, in wrapper
        return func(*func_args, **func_kwargs)
      File "/usr/lib/python2.7/site-packages/neutron/tests/tempest/api/test_ports.py", line 111, in test_create_update_port_with_dns_domain
        self.assertEqual('d.org.', body['dns_domain'])
    KeyError: 'dns_domain'

And I checked the log , the "dns_assignment"as below,[{"hostname":"d1","ip_address":"10.100.0.4","fqdn":"d1.example.com."}

The dns_domain name"example.com." is which I set in /etc/neutron/neutron.conf, and in the code, the dns_name should be "'test.org.'','d.org.'. 

It seems that there is something wrong with the test suite.

Comment 6 Brian Haley 2018-08-10 14:19:00 UTC
Pradipta - can you open another bug for the customer issue you described?  It seems somewhat unrelated to the original bug.

Comment 7 Brian Haley 2018-08-10 14:19:40 UTC
Chandan - can you confirm you are still working on this issue?  Thanks.

Comment 18 Martin Kopec 2018-11-28 18:03:14 UTC
The openstack-neutron-11.0.4-6.el7ost contains the fix for the issue. The package is available in RHOS-12 repositories.

Comment 20 errata-xmlrpc 2018-12-05 18:53:19 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, 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/RHSA-2018:3792


Note You need to log in before you can comment on or make changes to this bug.