Refactoring structure of rally/verification

Removing the verifiers directory to make the code more readable and reduce
unnecessary complexity

Change-Id: I2f1c4b7fe3ce9372b6d422c1d3c00e8128f59865
This commit is contained in:
Prabhjyot Singh Sodhi 2015-01-02 01:03:29 -08:00
parent 98119d774e
commit 835aaa767d
30 changed files with 40 additions and 40 deletions

View File

@ -22,7 +22,7 @@ from rally import deploy
from rally import exceptions from rally import exceptions
from rally import log as logging from rally import log as logging
from rally import objects from rally import objects
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -23,8 +23,8 @@ from rally.common.i18n import _
from rally.common import utils from rally.common import utils
from rally import exceptions from rally import exceptions
from rally import log as logging from rally import log as logging
from rally.verification.verifiers.tempest import config from rally.verification.tempest import config
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -24,7 +24,7 @@ from rally.benchmark import types as types
from rally.common.i18n import _ from rally.common.i18n import _
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
class ValidationResult(object): class ValidationResult(object):

View File

@ -31,8 +31,8 @@ from rally import db
from rally import exceptions from rally import exceptions
from rally import objects from rally import objects
from rally.openstack.common import cliutils as common_cliutils from rally.openstack.common import cliutils as common_cliutils
from rally.verification.verifiers.tempest import diff from rally.verification.tempest import diff
from rally.verification.verifiers.tempest import json2html from rally.verification.tempest import json2html
class VerifyCommands(object): class VerifyCommands(object):

View File

@ -22,7 +22,7 @@ import sys
from rally.cmd import cliutils from rally.cmd import cliutils
from rally.cmd import envutils from rally.cmd import envutils
from rally import db from rally import db
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
class DBCommands(object): class DBCommands(object):

View File

@ -15,7 +15,7 @@
import json import json
import compare2html from rally.verification.tempest import compare2html
class Diff(object): class Diff(object):

View File

@ -11,7 +11,7 @@
# under the License. # under the License.
from rally.ui import utils as ui_utils from rally.ui import utils as ui_utils
from rally.verification.verifiers.tempest import subunit2json from rally.verification.tempest import subunit2json
STATUS_MAP = {subunit2json.STATUS_PASS: "pass", STATUS_MAP = {subunit2json.STATUS_PASS: "pass",

View File

@ -25,8 +25,8 @@ from rally.common.i18n import _
from rally.common import utils from rally.common import utils
from rally import exceptions from rally import exceptions
from rally import log as logging from rally import log as logging
from rally.verification.verifiers.tempest import config from rally.verification.tempest import config
from rally.verification.verifiers.tempest import subunit2json from rally.verification.tempest import subunit2json
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,13 +19,13 @@ import mock
from rally.benchmark.context import tempest from rally.benchmark.context import tempest
from rally import exceptions from rally import exceptions
from rally.verification.verifiers.tempest import config from rally.verification.tempest import config
from rally.verification.verifiers.tempest import tempest as tempest_verifier from rally.verification.tempest import tempest as tempest_verifier
from tests.unit import test from tests.unit import test
CONTEXT = "rally.benchmark.context.tempest" CONTEXT = "rally.benchmark.context.tempest"
TEMPEST = "rally.verification.verifiers.tempest.tempest" TEMPEST = "rally.verification.tempest.tempest"
class TempestContextTestCase(test.TestCase): class TempestContextTestCase(test.TestCase):

View File

@ -16,10 +16,10 @@
import mock import mock
from rally.benchmark.scenarios.tempest import tempest from rally.benchmark.scenarios.tempest import tempest
from rally.verification.verifiers.tempest import tempest as verifier from rally.verification.tempest import tempest as verifier
from tests.unit import test from tests.unit import test
VERIFIER = "rally.verification.verifiers.tempest.tempest" VERIFIER = "rally.verification.tempest.tempest"
TS = "rally.benchmark.scenarios.tempest" TS = "rally.benchmark.scenarios.tempest"

View File

@ -20,7 +20,7 @@ from novaclient import exceptions as nova_exc
from rally.benchmark import validation from rally.benchmark import validation
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
from tests.unit import test from tests.unit import test

View File

@ -175,7 +175,7 @@ class VerifyCommandsTestCase(test.TestCase):
@mock.patch("rally.cmd.commands.verify.open", create=True) @mock.patch("rally.cmd.commands.verify.open", create=True)
@mock.patch("rally.db.verification_result_get") @mock.patch("rally.db.verification_result_get")
@mock.patch("rally.verification.verifiers.tempest.json2html.HtmlOutput") @mock.patch("rally.verification.tempest.json2html.HtmlOutput")
def test_results_with_output_html_and_output_file(self, def test_results_with_output_html_and_output_file(self,
mock_html, mock_html,
mock_db_result_get, mock_db_result_get,
@ -267,7 +267,7 @@ class VerifyCommandsTestCase(test.TestCase):
@mock.patch("rally.cmd.commands.verify.open", create=True) @mock.patch("rally.cmd.commands.verify.open", create=True)
@mock.patch("rally.db.verification_result_get") @mock.patch("rally.db.verification_result_get")
@mock.patch(("rally.verification.verifiers.tempest." @mock.patch(("rally.verification.tempest."
"compare2html.create_report"), return_value="") "compare2html.create_report"), return_value="")
def test_compare_with_output_html_and_output_file(self, def test_compare_with_output_html_and_output_file(self,
mock_compare2html_create, mock_compare2html_create,

View File

@ -53,7 +53,7 @@ class TempestCommandsTestCase(test.TestCase):
@mock.patch("rally.cmd.manage.db.deployment_get", @mock.patch("rally.cmd.manage.db.deployment_get",
return_value={"uuid": "e24b5af0-0e2a-4a70-9443-b30a88ab152e"}) return_value={"uuid": "e24b5af0-0e2a-4a70-9443-b30a88ab152e"})
@mock.patch("rally.verification.verifiers.tempest.tempest.Tempest") @mock.patch("rally.verification.tempest.tempest.Tempest")
def test_install(self, mock_tempest, mock_d_get): def test_install(self, mock_tempest, mock_d_get):
deployment_id = mock_d_get.return_value["uuid"] deployment_id = mock_d_get.return_value["uuid"]
mock_tempest.return_value = self.tempest mock_tempest.return_value = self.tempest

View File

@ -17,7 +17,7 @@ import mock
from rally import objects from rally import objects
from tests.unit import test from tests.unit import test
from tests.unit.verification.verifiers import fakes from tests.unit.verification import fakes
class VerificationTestCase(test.TestCase): class VerificationTestCase(test.TestCase):

View File

@ -224,7 +224,7 @@ class APITestCase(test.TestCase):
@mock.patch("rally.objects.Deployment.get") @mock.patch("rally.objects.Deployment.get")
@mock.patch("rally.api.objects.Verification") @mock.patch("rally.api.objects.Verification")
@mock.patch("rally.verification.verifiers.tempest.tempest.Tempest") @mock.patch("rally.verification.tempest.tempest.Tempest")
def test_verify(self, mock_tempest, mock_verification, mock_d_get): def test_verify(self, mock_tempest, mock_verification, mock_d_get):
mock_d_get.return_value = {"uuid": self.deploy_uuid} mock_d_get.return_value = {"uuid": self.deploy_uuid}
@ -238,7 +238,7 @@ class APITestCase(test.TestCase):
@mock.patch("rally.api.objects.Deployment.get") @mock.patch("rally.api.objects.Deployment.get")
@mock.patch("rally.api.objects.Verification") @mock.patch("rally.api.objects.Verification")
@mock.patch("rally.verification.verifiers.tempest.tempest.Tempest") @mock.patch("rally.verification.tempest.tempest.Tempest")
def test_verify_tempest_not_installed(self, mock_tempest, def test_verify_tempest_not_installed(self, mock_tempest,
mock_verification, mock_d_get): mock_verification, mock_d_get):
mock_d_get.return_value = {"uuid": self.deploy_uuid} mock_d_get.return_value = {"uuid": self.deploy_uuid}

View File

@ -12,7 +12,7 @@
import mock import mock
from rally.verification.verifiers.tempest import compare2html from rally.verification.tempest import compare2html
from tests.unit import test from tests.unit import test

View File

@ -18,7 +18,7 @@ import os
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from rally.verification.verifiers.tempest import config from rally.verification.tempest import config
from tests.unit import fakes from tests.unit import fakes
from tests.unit import test from tests.unit import test
@ -31,7 +31,7 @@ class ConfigTestCase(test.TestCase):
@mock.patch("rally.osclients.Clients.services", @mock.patch("rally.osclients.Clients.services",
return_value={"test_service_type": "test_service"}) return_value={"test_service_type": "test_service"})
@mock.patch("rally.osclients.Clients.verified_keystone") @mock.patch("rally.osclients.Clients.verified_keystone")
@mock.patch("rally.verification.verifiers.tempest.config.os.path.isfile", @mock.patch("rally.verification.tempest.config.os.path.isfile",
return_value=True) return_value=True)
def setUp(self, mock_isfile, mock_verified_keystone, mock_services, def setUp(self, mock_isfile, mock_verified_keystone, mock_services,
mock_get): mock_get):
@ -57,8 +57,8 @@ class ConfigTestCase(test.TestCase):
("use_stderr", "False")) ("use_stderr", "False"))
return [item for item in items if item not in defaults] return [item for item in items if item not in defaults]
@mock.patch("rally.verification.verifiers.tempest.config.requests") @mock.patch("rally.verification.tempest.config.requests")
@mock.patch("rally.verification.verifiers.tempest.config.os.rename") @mock.patch("rally.verification.tempest.config.os.rename")
@mock.patch("six.moves.builtins.open") @mock.patch("six.moves.builtins.open")
def test__load_img_success(self, mock_open, mock_rename, mock_requests): def test__load_img_success(self, mock_open, mock_rename, mock_requests):
mock_result = mock.MagicMock() mock_result = mock.MagicMock()
@ -72,7 +72,7 @@ class ConfigTestCase(test.TestCase):
CONF.image.cirros_image)) CONF.image.cirros_image))
mock_requests.get.assert_called_once_with(cirros_url, stream=True) mock_requests.get.assert_called_once_with(cirros_url, stream=True)
@mock.patch("rally.verification.verifiers.tempest.config.requests") @mock.patch("rally.verification.tempest.config.requests")
def test__load_img_notfound(self, mock_requests): def test__load_img_notfound(self, mock_requests):
mock_result = mock.MagicMock() mock_result = mock.MagicMock()
mock_result.status_code = 404 mock_result.status_code = 404
@ -93,7 +93,7 @@ class ConfigTestCase(test.TestCase):
}]} }]}
self.assertEqual(self.conf_generator._get_url(service), url) self.assertEqual(self.conf_generator._get_url(service), url)
@mock.patch("rally.verification.verifiers.tempest.config.TempestConf" @mock.patch("rally.verification.tempest.config.TempestConf"
"._get_url") "._get_url")
def test__set_boto(self, mock_get_url): def test__set_boto(self, mock_get_url):
url = "test_url" url = "test_url"
@ -206,9 +206,9 @@ class ConfigTestCase(test.TestCase):
self.conf_generator.conf.get("compute", self.conf_generator.conf.get("compute",
"ssh_connect_method")) "ssh_connect_method"))
@mock.patch("rally.verification.verifiers.tempest.config.os.path.exists", @mock.patch("rally.verification.tempest.config.os.path.exists",
return_value=False) return_value=False)
@mock.patch("rally.verification.verifiers.tempest.config.os.makedirs") @mock.patch("rally.verification.tempest.config.os.makedirs")
def test__set_default(self, mock_makedirs, mock_exists): def test__set_default(self, mock_makedirs, mock_exists):
self.conf_generator._set_default() self.conf_generator._set_default()
lock_path = os.path.join(self.conf_generator.data_path, "lock_files_%s" lock_path = os.path.join(self.conf_generator.data_path, "lock_files_%s"
@ -273,7 +273,7 @@ class ConfigTestCase(test.TestCase):
self.conf_generator.conf.get("network", self.conf_generator.conf.get("network",
"default_network")) "default_network"))
@mock.patch("rally.verification.verifiers.tempest.config.requests") @mock.patch("rally.verification.tempest.config.requests")
def test__set_service_available(self, mock_requests): def test__set_service_available(self, mock_requests):
mock_result = mock.MagicMock() mock_result = mock.MagicMock()
mock_result.status_code = 404 mock_result.status_code = 404
@ -289,7 +289,7 @@ class ConfigTestCase(test.TestCase):
self.conf_generator.conf.items("service_available")) self.conf_generator.conf.items("service_available"))
self.assertEqual(sorted(expected), sorted(options)) self.assertEqual(sorted(expected), sorted(options))
@mock.patch("rally.verification.verifiers.tempest.config.requests") @mock.patch("rally.verification.tempest.config.requests")
def test__set_service_available_horizon(self, mock_requests): def test__set_service_available_horizon(self, mock_requests):
mock_result = mock.MagicMock() mock_result = mock.MagicMock()
mock_result.status_code = 200 mock_result.status_code = 200

View File

@ -9,7 +9,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally.verification.verifiers.tempest import diff from rally.verification.tempest import diff
from tests.unit import test from tests.unit import test

View File

@ -12,10 +12,10 @@
import mock import mock
from rally.verification.verifiers.tempest import json2html from rally.verification.tempest import json2html
from tests.unit import test from tests.unit import test
BASE = "rally.verification.verifiers.tempest" BASE = "rally.verification.tempest"
class HtmlOutputTestCase(test.TestCase): class HtmlOutputTestCase(test.TestCase):

View File

@ -23,12 +23,12 @@ from oslo.serialization import jsonutils
import testtools import testtools
from rally import exceptions from rally import exceptions
from rally.verification.verifiers.tempest import subunit2json from rally.verification.tempest import subunit2json
from rally.verification.verifiers.tempest import tempest from rally.verification.tempest import tempest
from tests.unit import test from tests.unit import test
TEMPEST_PATH = "rally.verification.verifiers.tempest" TEMPEST_PATH = "rally.verification.tempest"
class BaseTestCase(test.TestCase): class BaseTestCase(test.TestCase):