aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-03-08 02:31:57 +0000
committerLinda Wang <wangwulin@huawei.com>2017-03-08 09:06:15 +0000
commitd3c6a95ea4b35c01b20d24c14acfaf4260d063a4 (patch)
tree404d9cdbd5434a9938e706dc41ce6aef6ecdd191
parentc31ad6a2bb181cce941c18e008efa0d44a7dc60a (diff)
Bugfix: modify test_prepare_env to make verify job successful
Functest verify job failed due to that test_prepare_env.py mistook one function of ft_utils.execute_command_raise. Change-Id: Ib3b8ca807308bf5c6d250e7debb4c9e1e106e3d1 Signed-off-by: Linda Wang <wangwulin@huawei.com>
-rw-r--r--functest/tests/unit/ci/test_prepare_env.py8
-rwxr-xr-xrun_unit_tests.sh8
2 files changed, 10 insertions, 6 deletions
diff --git a/functest/tests/unit/ci/test_prepare_env.py b/functest/tests/unit/ci/test_prepare_env.py
index 41b3f6a1..540501ff 100644
--- a/functest/tests/unit/ci/test_prepare_env.py
+++ b/functest/tests/unit/ci/test_prepare_env.py
@@ -236,8 +236,10 @@ class PrepareEnvTesting(unittest.TestCase):
@mock.patch('functest.ci.prepare_env.os_utils.get_credentials_for_rally')
@mock.patch('functest.ci.prepare_env.logger.info')
+ @mock.patch('functest.ci.prepare_env.ft_utils.execute_command_raise')
@mock.patch('functest.ci.prepare_env.ft_utils.execute_command')
- def test_install_rally(self, mock_exec, mock_logger_info, mock_os_utils):
+ def test_install_rally(self, mock_exec, mock_exec_raise, mock_logger_info,
+ mock_os_utils):
mock_os_utils.return_value = self._get_rally_creds()
@@ -252,12 +254,12 @@ class PrepareEnvTesting(unittest.TestCase):
cmd = "rally deployment create --file=rally_conf.json --name="
cmd += CONST.rally_deployment_name
error_msg = "Problem while creating Rally deployment"
- mock_exec.assert_any_call(cmd, error_msg=error_msg)
+ mock_exec_raise.assert_any_call(cmd, error_msg=error_msg)
cmd = "rally deployment check"
error_msg = ("OpenStack not responding or "
"faulty Rally deployment.")
- mock_exec.assert_any_call(cmd, error_msg=error_msg)
+ mock_exec_raise.assert_any_call(cmd, error_msg=error_msg)
cmd = "rally deployment list"
error_msg = ("Problem while listing "
diff --git a/run_unit_tests.sh b/run_unit_tests.sh
index 8e02880a..e0660910 100755
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -26,9 +26,10 @@ pip install $WORKSPACE
#install releng
cd $WORKSPACE/../
-git clone https://gerrit.opnfv.org/gerrit/releng
-pip install releng/modules/
-rm -fr releng
+rm -rf releng-unittests
+git clone https://gerrit.opnfv.org/gerrit/releng releng-unittests
+pip install releng-unittests/modules/
+rm -fr releng-unittests
cd $WORKSPACE
export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
@@ -39,6 +40,7 @@ nosetests --with-xunit \
--with-coverage \
--cover-erase \
--cover-tests \
+ --cover-package=functest.ci \
--cover-package=functest.cli \
--cover-package=functest.core.testcase_base \
--cover-package=functest.opnfv_tests.sdn.odl.odl \