Bug 2249407 - Type error when importing StatelessSecGroupDualStackDHCPv6StatelessTest when firewall driver is openvswitch
Summary: Type error when importing StatelessSecGroupDualStackDHCPv6StatelessTest when ...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-neutron-tests-tempest
Version: 17.1 (Wallaby)
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: ---
Assignee: Roman Safronov
QA Contact: Roman Safronov
URL:
Whiteboard:
Depends On:
Blocks: 2227138
TreeView+ depends on / blocked
 
Reported: 2023-11-12 21:48 UTC by Roman Safronov
Modified: 2024-03-28 18:57 UTC (History)
4 users (show)

Fixed In Version: python-neutron-tests-tempest-2.1.0-17.1.20230906160845.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 900772 0 None NEW Fix importing security group tests 2023-11-14 13:32:18 UTC
Red Hat Issue Tracker OSP-30374 0 None None None 2023-11-12 21:50:02 UTC

Description Roman Safronov 2023-11-12 21:48:40 UTC
Description of problem:

Type error occurs on attempt to load StatelessSecGroupDualStackDHCPv6StatelessTest, see below
The issue is a regression comparing to RHOS-17.1-RHEL-9-20231102.n.1

Failed to import test module: neutron_tempest_plugin.scenario.test_security_groups
Traceback (most recent call last):
  File "/usr/lib64/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/usr/lib/python3.9/site-packages/neutron_tempest_plugin/scenario/test_security_groups.py", line 1191, in <module>
    class StatelessSecGroupDualStackDHCPv6StatelessTest(
TypeError: function() argument 'code' must be code, not str


Version-Release number of selected component (if applicable):
RHOS-17.1-RHEL-9-20231110.n.1
python3-neutron-tests-tempest-2.1.0-17.1.20230906160844.021ce91.el9ost.noarch

How reproducible:
always, when tempest.conf contains  firewall_driver = openvswitch  under neutron_plugin_options

Steps to Reproduce:
1. Deploy ovs environment. Note the issue is related to environment with openvswitch firewall driver but it's not mandatory to have neutron with this firewall driver in order to reproduce the issue, see steps below.
2. Install tempest and upstream neutron-tempest-plugin (python3-neutron-tests-tempest rpm) and create tempest workspace (e.g. in ~/tempest-dir )
3. Configure tempest, make sure that tempest conf contains firewall_driver = openvswitch
4. Try to run test under StatelessSecGroupDualStackDHCPv6StatelessTest, e.g.

python3 -m testtools.run neutron_tempest_plugin.scenario.test_security_groups.StatelessSecGroupDualStackDHCPv6StatelessTest

or just execute 'stestr list' in ~/tempest-dir in order to list all available tempest tests


Actual results:
Importing of test module: neutron_tempest_plugin.scenario.test_security_groups fails because of   StatelessSecGroupDualStackDHCPv6StatelessTest (see traceback above)

Expected results:
No type error when importing class StatelessSecGroupDualStackDHCPv6StatelessTest , it's possible to run tests

Additional info:

Comment 2 Roman Safronov 2023-11-13 10:14:09 UTC
a possible solution https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/900772

Comment 5 Denise Hughes 2024-03-26 21:35:01 UTC
Adding PM ack since this was already approved by TRAC

Comment 9 Roman Safronov 2024-03-28 18:57:13 UTC
Verified on RHOS-17.1-RHEL-9-20240320.n.1 with python3-neutron-tests-tempest-2.1.0-17.1.20230906160845.el9ost.noarch
Verified that the issue does not occur


Note You need to log in before you can comment on or make changes to this bug.