yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #88412
[Bug 1962714] Re: disable ipv6 breaks several unit tests
Reviewed: https://review.opendev.org/c/openstack/neutron/+/831490
Committed: https://opendev.org/openstack/neutron/commit/10caa1e101a04525559f104d651ab5b2cd8108c2
Submitter: "Zuul (22348)"
Branch: master
commit 10caa1e101a04525559f104d651ab5b2cd8108c2
Author: uchenily <uchenily@xxxxxxxxx>
Date: Wed Mar 2 08:16:48 2022 +0000
Mock netutils.is_ipv6_enabled() method when testing
Mock netutils.is_ipv6_enabled() to prevent unittest results from being
affected by /proc/sys/net/ipv6/conf/default/disable_ipv6 values
Closes-Bug: #1962714
Change-Id: I3b6175eb0db6e4a791f8fa686b491a448ebf4ad9
** 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/1962714
Title:
disable ipv6 breaks several unit tests
Status in neutron:
Fix Released
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
References