← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1962714] [NEW] disable ipv6 breaks several unit tests

 

Public bug reported:

Recently, our CI/CD environment changed, and ipv6 was disabled by
default, which caused some unit tests to fail.


$ cat /proc/sys/net/ipv6/conf/default/disable_ipv6
0
$ tox -e py3 neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager

======
Totals
======
Ran: 8 tests in 0.5640 sec.
 - Passed: 8
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 1.0939 sec.



$ echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
$ tox -e py3 neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager

==============================
Failed 3 tests - output below:
==============================

neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_and_enable_metadata
--------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
    return f(self, *args, **kwargs)

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3212, in test_setup_reserved_and_enable_metadata
    self._test_setup_reserved(enable_isolated_metadata=True,

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
    mgr.driver.init_l3.assert_called_with('ns-XXX',

      File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
    raise AssertionError(_error_message()) from cause

    AssertionError: expected call not found.
Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')


neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_with_force_metadata_enable
---------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
    return f(self, *args, **kwargs)

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3206, in test_setup_reserved_with_force_metadata_enable
    self._test_setup_reserved(force_metadata=True)

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
    mgr.driver.init_l3.assert_called_with('ns-XXX',

      File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
    raise AssertionError(_error_message()) from cause

    AssertionError: expected call not found.
Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')


neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_with_isolated_metadata_enable
------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
    return f(self, *args, **kwargs)

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3200, in test_setup_reserved_with_isolated_metadata_enable
    self._test_setup_reserved(enable_isolated_metadata=True)

      File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
    mgr.driver.init_l3.assert_called_with('ns-XXX',

      File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
    raise AssertionError(_error_message()) from cause

    AssertionError: expected call not found.
Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')


======
Totals
======
Ran: 8 tests in 0.4921 sec.
 - Passed: 5
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 3
Sum of execute time for each test: 0.8743 sec.

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: unittest

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

Title:
  disable ipv6 breaks  several unit tests

Status in neutron:
  New

Bug description:
  Recently, our CI/CD environment changed, and ipv6 was disabled by
  default, which caused some unit tests to fail.

  
  $ cat /proc/sys/net/ipv6/conf/default/disable_ipv6
  0
  $ tox -e py3 neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager

  ======
  Totals
  ======
  Ran: 8 tests in 0.5640 sec.
   - Passed: 8
   - Skipped: 0
   - Expected Fail: 0
   - Unexpected Success: 0
   - Failed: 0
  Sum of execute time for each test: 1.0939 sec.



  
  $ echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
  $ tox -e py3 neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager

  ==============================
  Failed 3 tests - output below:
  ==============================

  neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_and_enable_metadata
  --------------------------------------------------------------------------------------------------

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):

        File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
      return f(self, *args, **kwargs)

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3212, in test_setup_reserved_and_enable_metadata
      self._test_setup_reserved(enable_isolated_metadata=True,

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
      mgr.driver.init_l3.assert_called_with('ns-XXX',

        File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
      raise AssertionError(_error_message()) from cause

      AssertionError: expected call not found.
  Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
  Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')

  
  neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_with_force_metadata_enable
  ---------------------------------------------------------------------------------------------------------

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):

        File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
      return f(self, *args, **kwargs)

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3206, in test_setup_reserved_with_force_metadata_enable
      self._test_setup_reserved(force_metadata=True)

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
      mgr.driver.init_l3.assert_called_with('ns-XXX',

        File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
      raise AssertionError(_error_message()) from cause

      AssertionError: expected call not found.
  Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
  Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')

  
  neutron.tests.unit.agent.linux.test_dhcp.TestDeviceManager.test_setup_reserved_with_isolated_metadata_enable
  ------------------------------------------------------------------------------------------------------------

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):

        File "/root/work/neutron-community/neutron/tests/base.py", line 183, in func
      return f(self, *args, **kwargs)

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3200, in test_setup_reserved_with_isolated_metadata_enable
      self._test_setup_reserved(enable_isolated_metadata=True)

        File "/root/work/neutron-community/neutron/tests/unit/agent/linux/test_dhcp.py", line 3186, in _test_setup_reserved
      mgr.driver.init_l3.assert_called_with('ns-XXX',

        File "/usr/lib/python3.8/unittest/mock.py", line 913, in assert_called_with
      raise AssertionError(_error_message()) from cause

      AssertionError: expected call not found.
  Expected: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32', 'fe80::a9fe:a9fe/64'], namespace='qdhcp-ns')
  Actual: init_l3('ns-XXX', ['192.168.0.6/24', 'fdca:3ba5:a17a:4ba3::2/64', '169.254.169.254/32'], namespace='qdhcp-ns')


  ======
  Totals
  ======
  Ran: 8 tests in 0.4921 sec.
   - Passed: 5
   - Skipped: 0
   - Expected Fail: 0
   - Unexpected Success: 0
   - Failed: 3
  Sum of execute time for each test: 0.8743 sec.

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



Follow ups