为什么murano-test-runner连接到keystone?

时间:2017-03-16 08:10:29

标签: unit-testing openstack

我为我的软件包“kubernetes-cluster”添加了一些单元测试,遵循Tomcat Package(参见:https://github.com/openstack/murano-apps/blob/master/Tomcat/package/Classes/TomcatTest.yaml)。

然后,用命令运行它(没有--config-file, - os-auth-url,路径/ etc / murano /中没有murano.conf):

murano-test-runner -v io.murano.apps.docker.kubernetes.KuryrCluster io.murano.test.KuryrClusterTest -l /my-packages and core-library/local/path

我收到了错误消息:

2017-03-16 07:39:49.978 | 2017-03-16 07:42:50.773 1697 ERROR murano.cmd.test_runner [-] Command failed: 'NoneType' object has no attribute 'replace'
2017-03-16 07:39:49.978 | Traceback (most recent call last):
2017-03-16 07:39:49.978 |   File "/home/jenkins/workspace/murano-programming-language-unit-test/.tox/murano-test-runner/lib/python2.7/site-packages/murano/cmd/test_runner.py", line 374, in main
2017-03-16 07:39:49.978 |     exit_code = test_runner.run_tests()
2017-03-16 07:39:49.978 |   File "/home/jenkins/workspace/murano-programming-language-unit-test/.tox/murano-test-runner/lib/python2.7/site-packages/murano/cmd/test_runner.py", line 213, in run_tests
2017-03-16 07:39:49.978 |     ks_opts = self._validate_keystone_opts(self.args)
2017-03-16 07:39:49.978 |   File "/home/jenkins/workspace/murano-programming-language-unit-test/.tox/murano-test-runner/lib/python2.7/site-packages/murano/cmd/test_runner.py", line 195, in _validate_keystone_opts
2017-03-16 07:39:49.979 |     ks_opts[param] = ks_opts[param].replace('v2.0', 'v3')
2017-03-16 07:39:49.979 | AttributeError: 'NoneType' object has no attribute 'replace'
2017-03-16 07:39:49.979 | 
2017-03-16 07:39:49.979 | Command failed: 'NoneType' object has no attribute 'replace'

我只想检查我的单元测试是否正确写入muranoPL,如pep8或py27。 如果没有连接到keystone服务器和中子服务器,我可以像tox -e murano-test-runner一样运行tox -e py27吗?如果不能,为什么?如果我可以,怎么样?模拟keystoneclient和neutronclient?或其他方式? 有人能帮帮我吗?感谢。

1 个答案:

答案 0 :(得分:0)

我嘲笑:

keystoneclient.v3.Client(and deal with auth_uri.replace('v2.0', 'v3') AttributeError Exception) murano.engine.system.net_explorer.NetworkExplorer._get_client

然后murano-test-runner可以在没有config-opts os- *或config-file

的情况下运行