简体   繁体   English

无法运行OpenStack Nova的单元测试

[英]Unable to run unit tests for openstack nova

I was able to create the virtual environment for nova to run Unit tests. 我能够为nova创建虚拟环境以运行单元测试。 At least it said so. 至少它是这样说的。

Nova development environment setup is complete.
Nova development uses virtualenv to track and manage Python dependencies
while in development and testing.
To activate the Nova virtualenv for the extent of your current shell
session you can run:
.....

But when i tried to run the particular unit test cases, eg: 但是,当我尝试运行特定的单元测试用例时,例如:

./run_tests.sh test_libvirt ./run_tests.sh test_libvirt

it's failing saying : 没说:

Running `tools/with_venv.sh python -m nova.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 0  test_libvirt'`

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/chinmay/nova/nova/openstack/common/lockutils.py", line 29, in <module>
    from oslo.config import cfg
**ImportError: No module named config**
Ran 0 tests in 0.006s
OK

Is the virtaul environment not set properly ? 虚拟环境设置不正确吗? oslo.config in in the env. oslo.config在环境中。 i did source .venv/bin/activate and tried again, but the same result. 我没有source .venv/bin/activate并再次尝试,但结果相同。

Am i missing something here? 我在这里想念什么吗?

Please remove oslo.config and install it again in your virtual environment. 请删除oslo.config并将其重新安装在您的虚拟环境中。 This might solve your problem :) 这可能会解决您的问题:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM