dsvm-functional can not run due to some ovs/ovn commands not found

Bug #1937039 reported by LIU Yulong
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Medium
Unassigned

Bug Description

The dsvm-functional test can not run even for those test cases not involved with OVN.

$ tox -e dsvm-functional neutron.tests.functional.db.test_migrations.TestModelsMigrationsMysql
dsvm-functional develop-inst-noop: /opt/stack/neutron
dsvm-functional installed:
...
...
=========================
Failures during discovery
=========================
--- import errors ---
Failed to import test module: neutron.tests.functional.plugins.ml2.drivers.ovn.mech_driver.ovsdb.test_impl_idl
Traceback (most recent call last):
  File "/usr/lib64/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/opt/stack/neutron/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py", line 21, in <module>
    from ovsdbapp.tests.functional import base
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/tests/functional/base.py", line 23, in <module>
    class FunctionalTestCase(base.TestCase):
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/tests/functional/base.py", line 28, in FunctionalTestCase
    remove=not bool(os.getenv('KEEP_VENV')))
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/venv.py", line 165, in __init__
    [self.SBSCHEMA, self.NBSCHEMA])
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/venv.py", line 75, in _share_path
    ", ".join(paths + (str(override),)))
Exception: Invalid directories: /usr/local/share/ovn, /usr/share/ovn, /usr/local/share/openvswitch, /usr/share/openvswitch, None

Failed to import test module: neutron.tests.functional.plugins.ml2.drivers.ovn.mech_driver.test_mech_driver
Traceback (most recent call last):
  File "/usr/lib64/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/opt/stack/neutron/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py", line 24, in <module>
    from ovsdbapp.tests.functional import base as ovs_base
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/tests/functional/base.py", line 23, in <module>
    class FunctionalTestCase(base.TestCase):
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/tests/functional/base.py", line 28, in FunctionalTestCase
    remove=not bool(os.getenv('KEEP_VENV')))
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/venv.py", line 165, in __init__
    [self.SBSCHEMA, self.NBSCHEMA])
  File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.6/site-packages/ovsdbapp/venv.py", line 75, in _share_path
    ", ".join(paths + (str(override),)))
Exception: Invalid directories: /usr/local/share/ovn, /usr/share/ovn, /usr/local/share/openvswitch, /usr/share/openvswitch, None

================================================================================
The above traceback was encountered during test discovery which imports all the found test modules in the specified test_path.
ERROR: InvocationError for command /opt/stack/neutron/.tox/dsvm-functional/bin/stestr run '--group_regex=neutron\.tests\.functional\.db\.test_migrations\.(TestModelsMigrationsPsql|TestModelsMigrationsMysql)' neutron.tests.functional.db.test_migrations.TestModelsMigrationsMysql (exited with code 100)
__________________________________________________________ summary __________________________________________________________
ERROR: dsvm-functional: commands failed

After remove the cases:
$ git status
On branch packet_rate_limit
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
 deleted: neutron/tests/functional/agent/ovn/__init__.py
 deleted: neutron/tests/functional/agent/ovn/metadata/__init__.py
 deleted: neutron/tests/functional/agent/ovn/metadata/test_metadata_agent.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/__init__.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/__init__.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/__init__.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/__init__.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/test_qos.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_maintenance.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_sync.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py
 deleted: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

The tox cases
tox -e dsvm-functional neutron.tests.functional.db.test_migrations.TestModelsMigrationsMysql
can run without errors.

Tags: ovn
Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Looking at https://opendev.org/openstack/neutron/src/commit/d48d7609f7e08e0b6425aad96d380ef331a39cac/tools/configure_for_func_testing.sh#L103 I guess this is because when we do not have "$BUILD_OVS_FROM_SOURCE" == "True" (so with system packages), ovn is not in the list of packages to install?

tags: added: ovn
Changed in neutron:
importance: Undecided → High
importance: High → Medium
Revision history for this message
Slawek Kaplonski (slaweq) wrote :

Did You run "tools/configure_for_func_testing.sh <devstack_path> -i" before running those tests? For me it always works fine after that.

Revision history for this message
Brian Haley (brian-haley) wrote :

Based on the comments from above, I'm guessing this is just a matter of running the script. If not please re-open.

Changed in neutron:
status: New → Invalid
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.