diff --git a/rally/orchestrator/api.py b/rally/orchestrator/api.py index 3ffe26f5da..6754c1e8b6 100644 --- a/rally/orchestrator/api.py +++ b/rally/orchestrator/api.py @@ -143,9 +143,9 @@ def verify(deploy_id, set_name, regex): verification = objects.Verification(deployment_uuid=deploy_id) verifier = tempest.Tempest(deploy_id, verification=verification) if not verifier.is_installed(): - print("Tempest is not installed for specified deployment. " - "Please use 'rally-manage tempest install'") - return + print("Tempest is not installed for specified deployment.") + print("Installing Tempest for deployment %s" % deploy_id) + verifier.install() LOG.info("Starting verification of deployment: %s" % deploy_id) verification.set_running() diff --git a/tests/orchestrator/test_api.py b/tests/orchestrator/test_api.py index f24ab0bb12..b5cdf1ab11 100644 --- a/tests/orchestrator/test_api.py +++ b/tests/orchestrator/test_api.py @@ -225,3 +225,16 @@ class APITestCase(test.TestCase): self.tempest.is_installed.assert_called_once_with() self.tempest.verify.assert_called_once_with(set_name='smoke', regex=None) + + @mock.patch('rally.orchestrator.api.objects.Verification') + @mock.patch('rally.verification.verifiers.tempest.tempest.Tempest') + def test_verify_tempest_not_installed(self, mock_tempest, + mock_verification): + mock_tempest.return_value = self.tempest + self.tempest.is_installed.return_value = False + api.verify(self.deploy_uuid, 'smoke', None) + + self.tempest.is_installed.assert_called_once_with() + self.tempest.install.assert_called_once_with() + self.tempest.verify.assert_called_once_with(set_name='smoke', + regex=None)