Move tests into ceilometer module
Doing this allow for potential importing of the tests and is cleaner than having a side directory. Nova already does this, so let's move. Change-Id: I77fc9c5356f3962363fd355b8dbf44fbeec157ee
This commit is contained in:
parent
85e0275ce5
commit
36955618ae
@ -1,4 +1,4 @@
|
||||
[DEFAULT]
|
||||
test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION
|
||||
test_command=${PYTHON:-python} -m subunit.run discover ceilometer $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
@ -22,11 +22,10 @@ import uuid
|
||||
|
||||
from ceilometer.alarm.evaluator import combination
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.alarm.evaluator import base
|
||||
from ceilometerclient import exc
|
||||
from ceilometerclient.v2 import alarms
|
||||
|
||||
from tests.alarm.evaluator import base
|
||||
|
||||
|
||||
class TestEvaluate(base.TestEvaluatorBase):
|
||||
EVALUATOR = combination.CombinationEvaluator
|
@ -24,9 +24,9 @@ import uuid
|
||||
from ceilometer.alarm.evaluator import threshold
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.alarm.evaluator import base
|
||||
from ceilometerclient import exc
|
||||
from ceilometerclient.v2 import statistics
|
||||
from tests.alarm.evaluator import base
|
||||
|
||||
|
||||
class TestEvaluate(base.TestEvaluatorBase):
|
@ -42,8 +42,8 @@ class TestBase(db_test_base.TestBase):
|
||||
self.CONF.set_override("auth_version",
|
||||
"v2.0", group=acl.OPT_GROUP_NAME)
|
||||
self.CONF.set_override("policy_file",
|
||||
self.path_get('tests/policy.json'))
|
||||
sources_file = self.path_get('tests/sources.json')
|
||||
self.path_get('etc/ceilometer/policy.json'))
|
||||
sources_file = self.path_get('ceilometer/tests/sources.json')
|
||||
self.app = v1_app.make_app(self.CONF,
|
||||
enable_acl=False,
|
||||
attach_storage=False,
|
||||
@ -83,14 +83,12 @@ class FunctionalTest(db_test_base.TestBase):
|
||||
|
||||
PATH_PREFIX = ''
|
||||
|
||||
SOURCE_DATA = {'test_source': {'somekey': '666'}}
|
||||
|
||||
def setUp(self):
|
||||
super(FunctionalTest, self).setUp()
|
||||
self.CONF.set_override("auth_version", "v2.0",
|
||||
group=acl.OPT_GROUP_NAME)
|
||||
self.CONF.set_override("policy_file",
|
||||
self.path_get('tests/policy.json'))
|
||||
self.path_get('etc/ceilometer/policy.json'))
|
||||
self.app = self._make_app()
|
||||
|
||||
def _make_app(self, enable_acl=False):
|
@ -22,13 +22,14 @@ import json
|
||||
|
||||
import testscenarios
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.api import acl
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.publisher import rpc
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
VALID_TOKEN = '4562138218392831'
|
@ -28,8 +28,8 @@ import uuid
|
||||
import mock
|
||||
import testscenarios
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.storage.models import Alarm
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
"""
|
||||
import os
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.api import acl
|
||||
from ceilometer.api import app
|
||||
from ceilometer.openstack.common import fileutils
|
||||
@ -28,6 +27,7 @@ from ceilometer.openstack.common.fixture import config
|
||||
from ceilometer.openstack.common.fixture import moxstubout
|
||||
from ceilometer.openstack.common import gettextutils
|
||||
from ceilometer import service
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import base
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
@ -24,11 +24,12 @@ import logging
|
||||
import mock
|
||||
import testscenarios
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
@ -24,11 +24,12 @@ import logging
|
||||
import testscenarios
|
||||
import webtest.app
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.publisher import rpc
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
@ -26,10 +26,9 @@ import testscenarios
|
||||
|
||||
from ceilometer.publisher import rpc
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
from .base import FunctionalTest
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
@ -25,10 +25,9 @@ import testscenarios
|
||||
|
||||
from ceilometer.publisher import rpc
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
from .base import FunctionalTest
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -37,8 +36,6 @@ LOG = logging.getLogger(__name__)
|
||||
class TestListResources(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
SOURCE_DATA = {'test_list_resources': {}}
|
||||
|
||||
def test_empty(self):
|
||||
data = self.get_json('/resources')
|
||||
self.assertEqual([], data)
|
@ -24,12 +24,13 @@ import logging
|
||||
|
||||
import testscenarios
|
||||
|
||||
from .base import FunctionalTest
|
||||
from ceilometer.openstack.common.fixture import moxstubout
|
||||
from ceilometer.openstack.common import rpc
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
@ -21,15 +21,15 @@ import datetime
|
||||
|
||||
import testscenarios
|
||||
|
||||
from . import base
|
||||
from ceilometer.publisher import rpc
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestMaxProjectVolume(base.FunctionalTest,
|
||||
class TestMaxProjectVolume(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
PATH = '/meters/volume.size/statistics'
|
||||
@ -127,7 +127,7 @@ class TestMaxProjectVolume(base.FunctionalTest,
|
||||
self.assertEqual(data[0]['count'], 1)
|
||||
|
||||
|
||||
class TestMaxResourceVolume(base.FunctionalTest,
|
||||
class TestMaxResourceVolume(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
PATH = '/meters/volume.size/statistics'
|
||||
@ -248,7 +248,7 @@ class TestMaxResourceVolume(base.FunctionalTest,
|
||||
self.assertEqual(data[0]['count'], 1)
|
||||
|
||||
|
||||
class TestSumProjectVolume(base.FunctionalTest,
|
||||
class TestSumProjectVolume(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
PATH = '/meters/volume.size/statistics'
|
||||
@ -348,7 +348,7 @@ class TestSumProjectVolume(base.FunctionalTest,
|
||||
self.assertEqual(data[0]['count'], 1)
|
||||
|
||||
|
||||
class TestSumResourceVolume(base.FunctionalTest,
|
||||
class TestSumResourceVolume(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
PATH = '/meters/volume.size/statistics'
|
||||
@ -474,7 +474,7 @@ class TestSumResourceVolume(base.FunctionalTest,
|
||||
self.assertEqual(data[0]['count'], 1)
|
||||
|
||||
|
||||
class TestGroupByInstance(base.FunctionalTest,
|
||||
class TestGroupByInstance(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
PATH = '/meters/instance/statistics'
|
||||
@ -1219,7 +1219,7 @@ class TestGroupByInstance(base.FunctionalTest,
|
||||
u'2013-08-01T14:00:00'])
|
||||
|
||||
|
||||
class TestGroupBySource(base.FunctionalTest,
|
||||
class TestGroupBySource(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
# FIXME(terriyu): We have to put test_group_by_source in its own class
|
@ -24,7 +24,7 @@ import mock
|
||||
from ceilometer.central import manager
|
||||
from ceilometer.openstack.common.fixture import moxstubout
|
||||
from ceilometer.openstack.common import test
|
||||
from tests import agentbase
|
||||
from ceilometer.tests import agentbase
|
||||
|
||||
|
||||
class TestManager(test.BaseTestCase):
|
@ -23,7 +23,7 @@ from ceilometer.compute import manager
|
||||
from ceilometer import nova_client
|
||||
from ceilometer.openstack.common.fixture import moxstubout
|
||||
from ceilometer.openstack.common import test
|
||||
from tests import agentbase
|
||||
from ceilometer.tests import agentbase
|
||||
|
||||
|
||||
class TestManager(test.BaseTestCase):
|
@ -33,7 +33,7 @@ from ceilometer.storage.base import MultipleResultsFound
|
||||
from ceilometer.storage.base import NoResultFound
|
||||
from ceilometer.storage import impl_mongodb
|
||||
from ceilometer.tests import db as tests_db
|
||||
from tests.storage import test_storage_scenarios
|
||||
from ceilometer.tests.storage import test_storage_scenarios
|
||||
|
||||
|
||||
class MongoDBEngineTestBase(tests_db.TestBase):
|
@ -85,7 +85,7 @@ class BinApiTestCase(base.BaseTestCase):
|
||||
self.api_port = random.randint(10000, 11000)
|
||||
self.http = httplib2.Http()
|
||||
pipeline_cfg_file = self.path_get('etc/ceilometer/pipeline.yaml')
|
||||
policy_file = self.path_get('tests/policy.json')
|
||||
policy_file = self.path_get('etc/ceilometer/policy.json')
|
||||
content = "[DEFAULT]\n"\
|
||||
"rpc_backend=ceilometer.openstack.common.rpc.impl_fake\n"\
|
||||
"auth_strategy=noauth\n"\
|
@ -74,7 +74,7 @@ class ServiceRestartTest(base.BaseTestCase):
|
||||
shutil.copy(self.path_get('etc/ceilometer/pipeline.yaml'),
|
||||
self.pipeline_cfg_file)
|
||||
self.pipelinecfg_read_from_file()
|
||||
policy_file = self.path_get('tests/policy.json')
|
||||
policy_file = self.path_get('etc/ceilometer/policy.json')
|
||||
content = "[DEFAULT]\n"\
|
||||
"rpc_backend=ceilometer.openstack.common.rpc.impl_fake\n"\
|
||||
"auth_strategy=noauth\n"\
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user