[test]The unit test file ovn_l3.test_plugin cannot be run alone

Bug #1958513 reported by ZhouHeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Low
Unassigned

Bug Description

python3 -m testtools.run neutron.tests.unit.services.ovn_l3.test_plugin.TestOVNL3RouterPlugin.test_schedule_unhosted_gateways
/usr/lib64/python3.6/runpy.py:125: RuntimeWarning: 'testtools.run' found in sys.modules after import of package 'testtools', but prior to execution of 'testtools.run'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
Tests running...
======================================================================
ERROR: neutron.tests.unit.services.ovn_l3.test_plugin.TestOVNL3RouterPlugin.test_schedule_unhosted_gateways
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/neutron/neutron/tests/unit/services/ovn_l3/test_plugin.py", line 61, in setUp
    cfg.CONF.set_override('max_header_size', 38, group='ml2_type_geneve')
  File "/usr/local/lib/python3.6/site-packages/oslo_config/cfg.py", line 2077, in __inner
    result = f(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/oslo_config/cfg.py", line 2460, in set_override
    opt_info = self._get_opt_info(name, group)
  File "/usr/local/lib/python3.6/site-packages/oslo_config/cfg.py", line 2869, in _get_opt_info
    group = self._get_group(group)
  File "/usr/local/lib/python3.6/site-packages/oslo_config/cfg.py", line 2838, in _get_group
    raise NoSuchGroupError(group_name)
oslo_config.cfg.NoSuchGroupError: no such group [ml2_type_geneve]

Ran 1 test in 0.074s
FAILED (failures=1)

Should add from neutron.plugins.ml2.drivers import type_geneve

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/825478

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
Revision history for this message
Oleg Bondarev (obondarev) wrote :

This could be run this way:
 "tox -epy39 tests.unit.services.ovn_l3.test_plugin"

Doesn't it work for you?

Revision history for this message
ZhouHeng (zhouhenglc) wrote :

[root@e2527900d3c2 neutron]# tox -e py36 neutron.tests.unit.services.ovn_l3.test_plugin.TestOVNL3RouterPlugin.test_schedule_unhosted_gateways
py36 create: /root/neutron/.tox/py36
py36 installdeps: -chttps://releases.openstack.org/constraints/upper/master, -r/root/neutron/requirements.txt, -r/root/neutron/test-requi

run tox, will request "releases.openstack.org", due to the regional network, it is time-consuming. Don't consider supporting testools? the modification is not complicated and has no adverse effect. It seems that other unit test files can be directly used with testtools

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.