test_linux_net.LinuxNetTest.test__arp_filtering unit test fails

Bug #1832352 reported by Hamdy Khader
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-vif
Fix Released
High
Hamdy Khader

Bug Description

Unit test "vif_plug_ovs.tests.unit.test_linux_net.LinuxNetTest.test__arp_filtering" fails because of
issue in mocking "open" built in function.

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/hamdyk/hamdy/PycharmProjects/ovs-dpdk/os-vif/.tox/py27/lib/python3.4/site-packages/mock/mock.py", line 1330, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/hamdyk/hamdy/PycharmProjects/ovs-dpdk/os-vif/vif_plug_ovs/tests/unit/test_linux_net.py", line 85, in test__arp_filtering'
    b' mock_open.side_effect = mock.mock_open(read_data=mock.Mock())'
    b' File "/home/hamdyk/hamdy/PycharmProjects/ovs-dpdk/os-vif/.tox/py27/lib/python3.4/site-packages/mock/mock.py", line 2517, in mock_open'
    b' _read_data = _to_stream(read_data)'
    b' File "/home/hamdyk/hamdy/PycharmProjects/ovs-dpdk/os-vif/.tox/py27/lib/python3.4/site-packages/mock/mock.py", line 2502, in _to_stream'
    b' return io.StringIO(read_data)'
    b'TypeError: initial_value must be str or None, not Mock'
    b

Hamdy Khader (hamdyk)
Changed in os-vif:
assignee: nobody → Hamdy Khader (hamdyk)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-vif (master)

Fix proposed to branch: master
Review: https://review.opendev.org/664583

Changed in os-vif:
status: New → In Progress
Revision history for this message
sean mooney (sean-k-mooney) wrote :

setting this to high as it will block other patche form merging

there are actully 2 bug

the one you are fixing and also your python2.7 env is actully using python3.4

i am fixing the second issue as a sperate bug.

Changed in os-vif:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-vif (master)

Reviewed: https://review.opendev.org/664583
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=1eef2d8a583d251523b02f2fa8a80f946b75d5b1
Submitter: Zuul
Branch: master

commit 1eef2d8a583d251523b02f2fa8a80f946b75d5b1
Author: Hamdy Khader <email address hidden>
Date: Tue Jun 11 15:24:54 2019 +0300

    Fix mock of built in "open" function in unit tests

    Closes-Bug: #1832352
    Change-Id: I37ac054bf8a7ae78492f2c1923ff9dad6a702d9d

Changed in os-vif:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-vif (stable/stein)

Reviewed: https://review.opendev.org/665196
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=6e6c0f630005bcdac5d0ecde35ef32dfedad923f
Submitter: Zuul
Branch: stable/stein

commit 6e6c0f630005bcdac5d0ecde35ef32dfedad923f
Author: Hamdy Khader <email address hidden>
Date: Tue Jun 11 15:24:54 2019 +0300

    Fix mock of built in "open" function in unit tests

    Closes-Bug: #1832352
    Change-Id: I37ac054bf8a7ae78492f2c1923ff9dad6a702d9d
    (cherry picked from commit 1eef2d8a583d251523b02f2fa8a80f946b75d5b1)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.17.0

This issue was fixed in the openstack/os-vif 1.17.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.15.2

This issue was fixed in the openstack/os-vif 1.15.2 release.

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.