Fixes InvalidBenchmarkConfig error while running tempest scenario
Change-Id: Id7d0fce04e978a684bc87fb3297b2010d8361972 Closes-Bug: #1372784
This commit is contained in:
parent
cb5c679cc6
commit
61dfb24c5f
@ -294,8 +294,7 @@ def tempest_tests_exists(config, clients, task):
|
||||
return ValidationResult(False,
|
||||
"Parameter 'test_name' or 'test_names' should "
|
||||
"be specified.")
|
||||
|
||||
verifier = tempest.Tempest(task.deployment_uuid)
|
||||
verifier = tempest.Tempest(task["deployment_uuid"])
|
||||
if not verifier.is_installed():
|
||||
verifier.install()
|
||||
if not verifier.is_configured():
|
||||
|
@ -20,6 +20,7 @@ from novaclient import exceptions as nova_exc
|
||||
from rally.benchmark import validation
|
||||
from rally import consts
|
||||
from rally import exceptions
|
||||
from rally import objects
|
||||
from tests import test
|
||||
|
||||
|
||||
@ -291,15 +292,22 @@ class ValidatorsTestCase(test.TestCase):
|
||||
self.assertFalse(result.is_valid, result.msg)
|
||||
|
||||
@mock.patch("rally.benchmark.validation.tempest.Tempest")
|
||||
def test_tempest_tests_exists(self, mock_tempest):
|
||||
task = mock.MagicMock()
|
||||
task.deployment_uuid = "uuid"
|
||||
|
||||
@mock.patch("rally.objects.task.db.task_create")
|
||||
def test_tempest_tests_exists(self, mock_create, mock_tempest):
|
||||
mock_create.return_value = {
|
||||
'status': 'init',
|
||||
'deployment_uuid': 'deployment-uuid',
|
||||
'verification_log': '',
|
||||
'uuid': 'task-uuid',
|
||||
'created_at': '',
|
||||
'failed': False,
|
||||
'tag': '',
|
||||
'id': 42}
|
||||
mock_tempest().is_installed.return_value = False
|
||||
mock_tempest().is_configured.return_value = False
|
||||
mock_tempest().discover_tests.return_value = set([
|
||||
"tempest.api.a", "tempest.api.b", "tempest.api.c"])
|
||||
|
||||
task = objects.Task(deployment_uuid='deployment-uuid')
|
||||
validator = self._unwrap_validator(validation.tempest_tests_exists)
|
||||
|
||||
result = validator({"args": {"test_name": "a"}}, None, task)
|
||||
|
Loading…
Reference in New Issue
Block a user