Tempest test PortsIpV6TestJSON.test_update_port_with_security_group_and_extra_attributes failed due to fixed_ips field not updated

Bug #1604923 reported by Vedamurthy Joshi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0.2.x
Won't Fix
Undecided
Unassigned
R3.0.3.x
Won't Fix
Undecided
Unassigned
R3.1
Fix Committed
High
Sahil Sabharwal
R3.2
Fix Committed
High
Sahil Sabharwal
R4.1
New
Undecided
Nagendra Prasath
Trunk
Fix Committed
High
Sahil Sabharwal

Bug Description

R3.0.2.0 Build 52 Liberty

Tempest test tempest.api.network.test_ports.PortsIpV6TestJSON.test_update_port_with_security_group_and_extra_attributes fails with below exception :
----------
The port update is updating subnet_id in the fixed_ips field and asserts if it has not happened

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tempest/api/network/test_ports.py", line 314, in test_update_port_with_security_group_and_extra_attributes
    [data_utils.rand_name('secgroup')])
  File "/usr/local/lib/python2.7/dist-packages/tempest/api/network/test_ports.py", line 305, in _update_port_with_security_groups
    port_show['fixed_ips'][0]['subnet_id'])
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 348, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 433, in assertThat
    raise mismatch_error
MismatchError: !=:
reference = u'04777df1-2f2e-457f-be9f-bda33b47b13f'
actual = u'501adb1d-6db8-4d86-8e37-0852439a8d1e'

-----------

root@nodeb5:/var/log/neutron# neutron port-show 3b3d5169-6b39-4f72-b286-65e1fbdd1c32
+---------------------+--------------------------------------------------------------------------------+
| Field | Value |
+---------------------+--------------------------------------------------------------------------------+
| admin_state_up | False |
| binding:vif_details | {"port_filter": true} |
| binding:vif_type | vrouter |
| binding:vnic_type | normal |
| device_id | |
| device_owner | |
| fixed_ips | {"subnet_id": "501adb1d-6db8-4d86-8e37-0852439a8d1e", "ip_address": "2003::3"} |
| id | 3b3d5169-6b39-4f72-b286-65e1fbdd1c32 |
| mac_address | 02:3b:3d:51:69:6b |
| name | tempest-port--444854566 |
| network_id | c578cf3f-ca36-4aeb-ac40-c877efc54d1d |
| security_groups | ce3ca78c-e915-41fa-a6f6-ca748243ea26 |
| status | DOWN |
| tenant_id | 464d4e927fa04f30bfc7e301701fba56 |
+---------------------+--------------------------------------------------------------------------------+
root@nodeb5:/var/log/neutron# neutron subnet-list | grep 04777df1
| 04777df1-2f2e-457f-be9f-bda33b47b13f | | 2003:0:0:1::/64 | {"start": "2003:0:0:1::2", "end": "2003::1:ffff:ffff:ffff:fffe"} |
root@nodeb5:/var/log/neutron#

Test code :

        subnet_1 = self.create_subnet(self.network)
        self.addCleanup(self.subnets_client.delete_subnet, subnet_1['id'])
        fixed_ip_1 = [{'subnet_id': subnet_1['id']}]

        security_groups_list = list()
        sec_grps_client = self.security_groups_client
        for name in security_groups_names:
            group_create_body = sec_grps_client.create_security_group(
                name=name)
            self.addCleanup(self.security_groups_client.delete_security_group,
                            group_create_body['security_group']['id'])
            security_groups_list.append(group_create_body['security_group']
                                        ['id'])
        # Create a port
        sec_grp_name = data_utils.rand_name('secgroup')
        security_group = sec_grps_client.create_security_group(
            name=sec_grp_name)
        self.addCleanup(self.security_groups_client.delete_security_group,
                        security_group['security_group']['id'])
        post_body = {
            "name": data_utils.rand_name('port-'),
            "security_groups": [security_group['security_group']['id']],
            "network_id": self.network['id'],
            "admin_state_up": True,
            "fixed_ips": fixed_ip_1}
        body = self.ports_client.create_port(**post_body)
        self.addCleanup(self.ports_client.delete_port, body['port']['id'])
        port = body['port']

        # Update the port with security groups
        subnet_2 = self.create_subnet(self.network)
        fixed_ip_2 = [{'subnet_id': subnet_2['id']}]
        update_body = {"name": data_utils.rand_name('port-'),
                       "admin_state_up": False,
                       "fixed_ips": fixed_ip_2,
                       "security_groups": security_groups_list}
        body = self.ports_client.update_port(port['id'], **update_body)
        port_show = body['port']
        # Verify the security groups and other attributes updated to port
        exclude_keys = set(port_show).symmetric_difference(update_body)
        exclude_keys.add('fixed_ips')
        exclude_keys.add('security_groups')
        self.assertThat(port_show, custom_matchers.MatchesDictExceptForKeys(
                        update_body, exclude_keys))
        self.assertEqual(fixed_ip_2[0]['subnet_id'],
                         port_show['fixed_ips'][0]['subnet_id']) <<<<<<< Fails here

        for security_group in security_groups_list:
            self.assertIn(security_group, port_show['security_groups'])

Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Sachin Bansal (sbansal) → ssabharwal@juniper.net (ssabharwal)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/25851
Submitter: <email address hidden> (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/25852
Submitter: <email address hidden> (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/25852
Committed: http://github.org/Juniper/contrail-controller/commit/1186806ca380041a29bff9ee34f1896184962cc7
Submitter: Zuul
Branch: R3.1

commit 1186806ca380041a29bff9ee34f1896184962cc7
Author: Sahil Sabharwal <email address hidden>
Date: Tue Nov 8 17:18:15 2016 -0800

Default ip_family is set to None instead of ipv4

Change-Id: I5638fafa75f6930016185a50ad77b24a1bc4645f
Closes-Bug: 1604923

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/25890
Submitter: <email address hidden> (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/25851
Committed: http://github.org/Juniper/contrail-controller/commit/b2484e174db0f7653c40c1fd261ed357626fadab
Submitter: Zuul
Branch: master

commit b2484e174db0f7653c40c1fd261ed357626fadab
Author: Sahil Sabharwal <email address hidden>
Date: Tue Nov 8 16:59:19 2016 -0800

Default ip_family is set to None instead of ipv4

Change-Id: Id9d1973228d8fd7de9700cd1b9923aa0d8fa6e86
Closes-Bug: 1604923

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/25890
Committed: http://github.org/Juniper/contrail-controller/commit/59a628df4dcd96a01e7a4276615abcfb90662eed
Submitter: Zuul
Branch: R3.2

commit 59a628df4dcd96a01e7a4276615abcfb90662eed
Author: Sahil Sabharwal <email address hidden>
Date: Tue Nov 8 16:59:19 2016 -0800

Default ip_family is set to None instead of ipv4

Change-Id: Id9d1973228d8fd7de9700cd1b9923aa0d8fa6e86
Closes-Bug: 1604923

tags: added: osp7-cert osp8-cert rhosp-tempest
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :

Same situation with R4.0 and OSPD10. build CB-25 (rhel7.0 + newton)

failed tests:
tempest.api.network.test_ports.PortsIpV6TestJSON.test_update_port_with_security_group_and_extra_attributes [37.879211s] ... FAILED
tempest.api.network.test_ports.PortsTestJSON.test_update_port_with_security_group_and_extra_attributes [37.766608s] ... FAILED
tempest.api.network.test_ports.PortsIpV6TestJSON.test_update_port_with_two_security_groups_and_extra_attributes [47.380204s] ... FAILED
tempest.api.network.test_ports.PortsTestJSON.test_update_port_with_two_security_groups_and_extra_attributes [44.559044s] ... FAILED

Revision history for this message
Andrey Pavlov (apavlov-e) wrote :

all four tests are failed in one common function that is in description

Traceback (most recent call last):
  File "tempest/api/network/test_ports.py", line 317, in test_update_port_with_security_group_and_extra_attributes
    [data_utils.rand_name('secgroup')])
  File "tempest/api/network/test_ports.py", line 306, in _update_port_with_security_groups
    port_show['fixed_ips'][0]['subnet_id'])
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'76ae26af-33b2-47c5-83e2-80b231b08ac6'
actual = u'5c9cae50-e698-4864-9c5e-f7bc52c93f79'

Jeba Paulaiyan (jebap)
no longer affects: juniperopenstack/r4.0
Revision history for this message
tikitavi (rtikitavi) wrote :

Same situation with R4.1 and OSPD10.

tempest.api.network.test_ports.PortsTestJSON.test_update_port_with_two_security_groups_and_extra_attributes
tempest.api.network.test_ports.PortsTestJSON.test_update_port_with_security_group_and_extra_attributes
tempest.api.network.test_ports.PortsIpV6TestJSON.test_update_port_with_two_security_groups_and_extra_attributes
tempest.api.network.test_ports.PortsIpV6TestJSON.test_update_port_with_security_group_and_extra_attributes

Traceback (most recent call last):
  File "tempest/api/network/test_ports.py", line 326, in test_update_port_with_two_security_groups_and_extra_attributes
    data_utils.rand_name('secgroup')])
  File "tempest/api/network/test_ports.py", line 306, in _update_port_with_security_groups
    port_show['fixed_ips'][0]['subnet_id'])
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = u'4b0ae9f5-9bfd-4b30-9f0d-ce42365c10c6'
actual = u'5b0fbc80-4d48-468c-ab82-16e366383b4f'

Jeba Paulaiyan (jebap)
no longer affects: juniperopenstack/r4.1
shajuvk (shajuvk)
tags: added: rhosp
removed: rhosp-tempest
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.