← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2054435] Re: Testing errors when using new netaddr library

 

Reviewed:  https://review.opendev.org/c/openstack/neutron/+/917260
Committed: https://opendev.org/openstack/neutron/commit/ae704369b5390d939db653c9bb0cbc965f7a761a
Submitter: "Zuul (22348)"
Branch:    master

commit ae704369b5390d939db653c9bb0cbc965f7a761a
Author: Ihar Hrachyshka <ihrachys@xxxxxxxxxx>
Date:   Fri Apr 26 22:50:10 2024 -0400

    tests: fix invalid `addr` mock values in ovs firewall suite
    
    The tests were passing a string of IPv4 address where the actual code
    was expecting a tuple of (IPv4 address, MAC address). The type of the
    `addr` changed from a string to a tuple in:
    
    I2e3aa7c400d7bb17cc117b65faaa160b41013dde
    
    but the names of variables and the test cases were not.
    
    Tests still didn't fail till recently because addr[0] resulted in the
    first character of the IPv4 address string (e.g. `1`), and was then
    interpreted by `netaddr` library as an address. This worked until
    `netaddr>=1.0` started to enforce proper formats for passed IPv4
    addresses - which broke the tests.
    
    Closes-Bug: #2054435
    Change-Id: Ib9594bc0611007efdbaf3219ccd44bbb37cfc627


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2054435

Title:
  Testing errors when using new netaddr library

Status in neutron:
  Fix Released

Bug description:
  Failures can be seen in
  neutron.tests.unit.agent.linux.openvswitch_firewall.test_firewall.TestConjIPFlowManager
  unit tests with netaddr >= 1.0.0 (see e.g.
  https://zuul.opendev.org/t/openstack/build/3f23859f8ce44ebbb41eda01b76d1d3b):

  netaddr.core.AddrFormatError: '1' is not a valid IPv4 address string!

  The code being executed is

    File "/home/zuul/src/opendev.org/openstack/neutron/neutron/agent/linux/openvswitch_firewall/firewall.py", line 426, in _update_flows_for_vlan_subr
      removed_ips = set([str(netaddr.IPNetwork(addr[0]).cidr) for addr in (
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Debugging shows that in that moment addr=="10.22.3.4", so
  addr[0]=="1", which newer netaddr complains about as invalid.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2054435/+subscriptions



References