diff --git a/.coveragerc b/.coveragerc index 17649503..07df79df 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = *cdn/openstack* +omit = *poppy/openstack* [report] exclude_lines = diff --git a/HACKING.rst b/HACKING.rst index 0158bfb8..c766e970 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -86,7 +86,7 @@ Template:: \n {{third-party lib imports in human alphabetical order}} \n - {{cdn imports in human alphabetical order}} + {{poppy imports in human alphabetical order}} \n \n {{begin your code}} @@ -102,9 +102,9 @@ Example:: import eventlet - import cdn.common - from cdn import test - import cdn.storage.cassandra + import poppy.common + from poppy import test + import poppy.storage.cassandra More Import Examples @@ -112,11 +112,11 @@ More Import Examples **INCORRECT** :: - import cdn.transport.wsgi as wsgi + import poppy.transport.wsgi as wsgi **CORRECT** :: - from cdn.transport import wsgi + from poppy.transport import wsgi Docstrings ---------- diff --git a/README.rst b/README.rst index 5fb35dc1..4105b549 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,16 @@ -CDN +Poppy ======= -Content Delivery Network Management as a Service +CDN Provider Management as a Service Note: This is a work in progress and is not currently recommended for production use. -What is CDN +What is Poppy ============ Users have come to expect exceptional speed in their applications, websites, and video experiences. Because of this, using a CDN has become standard for companies, no matter their size. -CDN will take all the guess work out of the CDN market for our users. CDN will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API. +Poppy will take all the guess work out of the CDN market for our users. Poppy will give them a consistently speedy experience from integrated partners, with an easy to use RESTful API. Vendor lock-in to a particular CDN provider is removed by abstracting away the plethora of vendor API's available. This means that a customer only has to integrate with one CDN API, and reap the benefits of using multiple providers. @@ -39,10 +39,10 @@ Features + Set Restrictions on who can access cached content -What CDN is not +What Poppy is not ---------------------- -CDN does not run its own Edge Cache or POP servers. This is purely a management API to abstract away the myriad of CDN providers on the market. +Poppy does not run its own Edge Cache or POP servers. This is purely a management API to abstract away the myriad of CDN providers on the market. @@ -53,38 +53,38 @@ Getting Started not all of these steps are required. It is assumed you have `CassandraDB` installed and running. -1. From your home folder create the ``~/.cdn`` folder and clone the repo:: +1. From your home folder create the ``~/.poppy`` folder and clone the repo:: $ cd $ mkdir .cdn $ git clone https://github.com/rackerlabs/cdn.git -2. Copy the CDN config files to the directory ``~/.cdn``:: +2. Copy the Poppy config files to the directory ``~/.poppy``:: - $ cp cdn/etc/cdn.conf ~/.cdn/cdn.conf - $ cp cdn/etc/logging.conf ~/.cdn/logging.conf + $ cp poppy/etc/cdn.conf ~/.poppy/poppy.conf + $ cp poppy/etc/logging.conf ~/.poppy/logging.conf 3. Find the ``[drivers:storage:cassandradb]`` section in - ``~/.cdn/cdn.conf`` and modify the URI to point + ``~/.poppy/poppy.conf`` and modify the URI to point to your local casssandra cluster:: [drivers:storage:cassandra] cluster = "localhost" - keyspace = cdn + keyspace = poppy 4. By using cassandra storage plugin, you will need to create the default keyspace "cdn" on your cassandra host/cluster. So log into cqlsh, do:: - cqlsh> CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; + cqlsh> CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ; 5. For logging, find the ``[DEFAULT]`` section in - ``~/.cdn/cdn.conf`` and modify as desired:: + ``~/.poppy/poppy.conf`` and modify as desired:: log_file = server.log 6. Change directories back to your local copy of the repo:: - $ cd cdn + $ cd poppy 7. Install general requirements:: @@ -93,7 +93,7 @@ installed and running. Install Requirements for each Provider configured:: - $ pip install -r cdn/providers/fastly/requirements.txt + $ pip install -r poppy/providers/fastly/requirements.txt Run the following so you can see the results of any changes you make to the code without having to reinstall the package each time:: @@ -101,14 +101,11 @@ installed and running. $ pip install -e . - Installing the fastly client library may have issues. Copy the `README.md` file to `README` and try again. +8. Start the Poppy server:: + $ poppy-server -8. Start the CDN server:: - - $ cdn-server - -9. Test out that CDN is working by requesting the home doc (with a sample project ID):: +9. Test out that Poppy is working by requesting the home doc (with a sample project ID):: $ curl -i -X GET http://0.0.0.0:8888/v1.0/123 @@ -143,7 +140,7 @@ Mac OSX 3. Create a Keyspace with Replication:: - CREATE KEYSPACE cdn WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; + CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; 4. Import the Cassandra Schema to set up the required tables that CDN will need:: @@ -160,7 +157,7 @@ First install the additional requirements:: And then run tests:: - $ tox -e py27 + $ tox .. _`CassandraDB` : http://cassandra.apache.org diff --git a/docker/api-cdn/Dockerfile b/docker/api-cdn/Dockerfile index 7547d742..c41be806 100644 --- a/docker/api-cdn/Dockerfile +++ b/docker/api-cdn/Dockerfile @@ -1,11 +1,11 @@ ## -## CDN API +## Poppy ## ## # The following files should exist in this folder before running Dockerfile # - docker_rsa (private key) -> public key should be published to the private git repo -# - cdn.conf (desired configuration for cdn api) +# - poppy.conf (desired configuration for poppy api) # - logging.conf (desired logging configuration file) @@ -43,28 +43,28 @@ RUN echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config RUN touch /root/.ssh/known_hosts # Pull project -RUN git clone git@github.com:rackerlabs/cdn /home/cdn +RUN git clone git@github.com:rackerlabs/cdn /home/poppy # Install Requirements -RUN sudo pip install -r /home/cdn/requirements/requirements.txt +RUN sudo pip install -r /home/poppy/requirements/requirements.txt -RUN sudo pip install -e /home/cdn/. +RUN sudo pip install -e /home/poppy/. # Set up the configuration files -ADD ./cdn.conf /etc/cdn.conf +ADD ./poppy.conf /etc/poppy.conf ADD ./logging.conf /etc/logging.conf ADD ./uwsgi.ini /root/uwsgi.ini # create uwsgi log directory -RUN mkdir -p /var/log/cdn -RUN chmod -R +w /var/log/cdn +RUN mkdir -p /var/log/poppy +RUN chmod -R +w /var/log/poppy # create uwsgi pid directory -RUN mkdir -p /var/run/cdn -RUN chmod -R +w /var/run/cdn +RUN mkdir -p /var/run/poppy +RUN chmod -R +w /var/run/poppy #RUN /usr/local/bin/uwsgi --ini /root/uwsgi.ini -# Start CDN +# Start Poppy EXPOSE 80 CMD ["/usr/local/bin/uwsgi", "--ini", "/root/uwsgi.ini"] diff --git a/docker/api-cdn/cdn.conf b/docker/api-cdn/cdn.conf index e98fa7a1..e6c4567f 100644 --- a/docker/api-cdn/cdn.conf +++ b/docker/api-cdn/cdn.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log ;auth_strategy = @@ -40,14 +40,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "" diff --git a/docker/api-cdn/logging.conf b/docker/api-cdn/logging.conf index 990cee07..a1bd37ce 100644 --- a/docker/api-cdn/logging.conf +++ b/docker/api-cdn/logging.conf @@ -14,12 +14,12 @@ handlers=devel [logger_server] level=DEBUG handlers=devel -qualname=cdn-server +qualname=poppy-server [logger_combined] level=DEBUG handlers=devel -qualname=cdn-combined +qualname=poppy-combined [handler_production] class=handlers.SysLogHandler @@ -31,7 +31,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) class=FileHandler level=DEBUG formatter=normal_with_name -args=('cdn.log', 'w') +args=('poppy.log', 'w') [handler_devel] class=StreamHandler diff --git a/docker/api-cdn/uwsgi.ini b/docker/api-cdn/uwsgi.ini index cc3cf486..5c0d1a23 100644 --- a/docker/api-cdn/uwsgi.ini +++ b/docker/api-cdn/uwsgi.ini @@ -1,14 +1,14 @@ [uwsgi] master = true -chdir = /home/cdn/ +chdir = /home/poppy/ workers = 4 http-socket = 0.0.0.0:80 -logger = file:/var/log/cdn/cdn.log -pidfile = /var/run/cdn/cdn.pid +logger = file:/var/log/poppy/poppy.log +pidfile = /var/run/poppy/poppy.pid die-on-term = true enable-threads = true buffer-size = 32768 max-requests = 15000 no-orphans = true vacuum = true -module = cdn.transport.falcon.app:app \ No newline at end of file +module = poppy.transport.falcon.app:app \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 1735a57c..5a1508ec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ source-dir = doc/source [entry_points] console_scripts = - cdn-server = poppy.cmd.server:run + poppy-server = poppy.cmd.server:run cdn.transport = falcon = poppy.transport.falcon:Driver diff --git a/tests/api/README.rst b/tests/api/README.rst index 8ed5d16f..2ed9bb52 100644 --- a/tests/api/README.rst +++ b/tests/api/README.rst @@ -4,7 +4,7 @@ API Tests The API tests + test an actual API against a running environment. + are black box tests -+ can be used to test any running instance of cdn server (dev, test, prod, local ++ can be used to test any running instance of poppy server (dev, test, prod, local instance, containerized instance) @@ -17,13 +17,13 @@ To run the tests 2. Set the following environment variables:: - export CAFE_CONFIG_FILE_PATH=~/.cdn/tests.conf - export CAFE_ROOT_LOG_PATH=~/.cdn/logs - export CAFE_TEST_LOG_PATH=~/.cdn/logs + export CAFE_CONFIG_FILE_PATH=~/.poppy/tests.conf + export CAFE_ROOT_LOG_PATH=~/.poppy/logs + export CAFE_TEST_LOG_PATH=~/.poppy/logs 3. Copy the api.conf file to the path set by CAFE_CONFIG_FILE_PATH:: - cp tests/etc/api.conf ~/.cdn/tests.conf + cp tests/etc/api.conf ~/.poppy/tests.conf 4. Once you are ready to run the tests:: diff --git a/tests/api/base.py b/tests/api/base.py index beb14858..a4520387 100644 --- a/tests/api/base.py +++ b/tests/api/base.py @@ -36,7 +36,7 @@ class TestBase(fixtures.BaseTestFixture): @classmethod def setUpClass(cls): - cls.conf_file = 'cdn_mockdb.conf' + cls.conf_file = 'poppy_mockdb.conf' super(TestBase, cls).setUpClass() @@ -56,14 +56,14 @@ class TestBase(fixtures.BaseTestFixture): cls.server_config = config.CDNServerConfig() if cls.server_config.run_server: - conf_path = os.environ["CDN_TESTS_CONFIGS_DIR"] + conf_path = os.environ["POPPY_TESTS_CONFIGS_DIR"] config_file = os.path.join(conf_path, cls.conf_file) conf = cfg.ConfigOpts() - conf(project='cdn', prog='cdn', args=[], + conf(project='poppy', prog='poppy', args=[], default_config_files=[config_file]) - cdn_server = server.CDNServer() - cdn_server.start(conf) + poppy_server = server.CDNServer() + poppy_server.start(conf) def assertSchema(self, response_json, expected_schema): """Verify response schema aligns with the expected schema.""" diff --git a/tests/api/utils/config.py b/tests/api/utils/config.py index e98314d5..5747186e 100644 --- a/tests/api/utils/config.py +++ b/tests/api/utils/config.py @@ -16,23 +16,23 @@ from cafe.engine.models import data_interfaces -class CDNConfig(data_interfaces.ConfigSectionInterface): - """Defines the config values for cdn.""" - SECTION_NAME = 'cdn' +class PoppyConfig(data_interfaces.ConfigSectionInterface): + """Defines the config values for poppy.""" + SECTION_NAME = 'poppy' @property def base_url(self): - """CDN endpoint.""" + """poppy endpoint.""" return self.get('base_url') -class CDNServerConfig(data_interfaces.ConfigSectionInterface): - """Defines the config values for starting (or not) a cdn server""" - SECTION_NAME = 'cdn_server' +class PoppyServerConfig(data_interfaces.ConfigSectionInterface): + """Defines the config values for starting (or not) a poppy server""" + SECTION_NAME = 'poppy_server' @property def run_server(self): - """Boolean value indicating whether to start CDN server.""" + """Boolean value indicating whether to start poppy server.""" return self.get_boolean('run_server') diff --git a/tests/api/utils/server.py b/tests/api/utils/server.py index e8d36640..bf83380c 100644 --- a/tests/api/utils/server.py +++ b/tests/api/utils/server.py @@ -17,13 +17,13 @@ import abc import multiprocessing import six -from cdn import bootstrap +from poppy import bootstrap @six.add_metaclass(abc.ABCMeta) class Server(object): - name = "cdn-server" + name = "poppy-server" def __init__(self): self.process = None @@ -88,7 +88,7 @@ class Server(object): class CDNServer(Server): - name = "cdn-server" + name = "poppy-server" def get_target(self, conf): server = bootstrap.Bootstrap(conf) diff --git a/tests/base.py b/tests/base.py index 2326618d..656500aa 100644 --- a/tests/base.py +++ b/tests/base.py @@ -33,7 +33,7 @@ class TestCase(testtools.TestCase): def setUp(self): super(TestCase, self).setUp() - self.useFixture(fixtures.FakeLogger('cdn')) + self.useFixture(fixtures.FakeLogger('poppy')) if self.config_file: self.conf = self.load_conf(self.config_file) diff --git a/tests/etc/api.conf b/tests/etc/api.conf index d99a8875..f5e97132 100644 --- a/tests/etc/api.conf +++ b/tests/etc/api.conf @@ -7,8 +7,8 @@ username={user name of the cloud account} api_key={api key for this user name} base_url=https://identity.api.rackspacecloud.com/v2.0 -[cdn] +[poppy] base_url=https//0.0.0.0:8888 -[cdn_server] +[poppy_server] run_server=True diff --git a/tests/etc/cdn_mockdb.conf b/tests/etc/cdn_mockdb.conf index 1c3de368..08b11d53 100644 --- a/tests/etc/cdn_mockdb.conf +++ b/tests/etc/cdn_mockdb.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log ;auth_strategy = @@ -42,14 +42,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "localhost" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "MYAPIKEY" \ No newline at end of file diff --git a/tests/etc/functional.conf b/tests/etc/functional.conf index d985db28..95b8c217 100644 --- a/tests/etc/functional.conf +++ b/tests/etc/functional.conf @@ -1,6 +1,6 @@ # By default, this should live in one of: -# ~/.cdn/cdn.conf -# /etc/cdn/cdn.conf +# ~/.poppy/poppy.conf +# /etc/poppy/poppy.conf [DEFAULT] # Show more verbose log output (sets INFO log level output) @@ -10,7 +10,7 @@ ;debug = False # Log to this file -log_file = cdn.log +log_file = poppy.log # ================= Syslog Options ============================ @@ -40,14 +40,14 @@ port = 8888 [drivers:storage:mongodb] uri = mongodb://localhost -database = cdn +database = poppy [drivers:storage:cassandra] cluster = "localhost" -keyspace = cdn +keyspace = poppy [drivers:storage:mockdb] -database = cdn +database = poppy [drivers:provider:fastly] apikey = "MYAPIKEY" \ No newline at end of file diff --git a/tests/functional/transport/pecan/base.py b/tests/functional/transport/pecan/base.py index 9ca0ef85..c44d64d9 100644 --- a/tests/functional/transport/pecan/base.py +++ b/tests/functional/transport/pecan/base.py @@ -18,7 +18,7 @@ import os from oslo.config import cfg import webtest -from cdn import bootstrap +from poppy import bootstrap from tests.functional import base @@ -33,9 +33,9 @@ class BaseFunctionalTest(base.TestCase): )))) conf_path = os.path.join(tests_path, 'etc', 'default_functional.conf') cfg.CONF(args=[], default_config_files=[conf_path]) - cdn_wsgi = bootstrap.Bootstrap(cfg.CONF).transport.app + poppy_wsgi = bootstrap.Bootstrap(cfg.CONF).transport.app - self.app = webtest.TestApp(cdn_wsgi) + self.app = webtest.TestApp(poppy_wsgi) FunctionalTest = BaseFunctionalTest diff --git a/tests/functional/transport/pecan/controllers/test_services.py b/tests/functional/transport/pecan/controllers/test_services.py index 454d2689..f9ea1043 100644 --- a/tests/functional/transport/pecan/controllers/test_services.py +++ b/tests/functional/transport/pecan/controllers/test_services.py @@ -18,7 +18,7 @@ import json import pecan from webtest import app -from cdn.transport.pecan.controllers import base as c_base +from poppy.transport.pecan.controllers import base as c_base from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/pecan/controllers/test_v1_controller.py b/tests/functional/transport/pecan/controllers/test_v1_controller.py index b845b6d5..1f154541 100644 --- a/tests/functional/transport/pecan/controllers/test_v1_controller.py +++ b/tests/functional/transport/pecan/controllers/test_v1_controller.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.manager.default import v1 +from poppy.manager.default import v1 from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/pecan/hooks/test_context.py b/tests/functional/transport/pecan/hooks/test_context.py index 8e26dfa5..82639a8a 100644 --- a/tests/functional/transport/pecan/hooks/test_context.py +++ b/tests/functional/transport/pecan/hooks/test_context.py @@ -15,7 +15,7 @@ import uuid -from cdn.manager.default import v1 +from poppy.manager.default import v1 from tests.functional.transport.pecan import base diff --git a/tests/functional/transport/validator/test_service_validation.py b/tests/functional/transport/validator/test_service_validation.py index b8450e3a..10c23bfe 100644 --- a/tests/functional/transport/validator/test_service_validation.py +++ b/tests/functional/transport/validator/test_service_validation.py @@ -22,13 +22,13 @@ import sys import pecan from webtest import app -from cdn.common import errors -from cdn.transport.validators import helpers -from cdn.transport.validators.schemas import service -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import exceptions -from cdn.transport.validators.stoplight import helpers as stoplight_helpers -from cdn.transport.validators.stoplight import rule +from poppy.common import errors +from poppy.transport.validators import helpers +from poppy.transport.validators.schemas import service +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import exceptions +from poppy.transport.validators.stoplight import helpers as stoplight_helpers +from poppy.transport.validators.stoplight import rule from tests.functional import base # for pecan testing app diff --git a/tests/functional/transport/validator/test_stoplight_validation.py b/tests/functional/transport/validator/test_stoplight_validation.py index 9e8b3424..e18da1df 100644 --- a/tests/functional/transport/validator/test_stoplight_validation.py +++ b/tests/functional/transport/validator/test_stoplight_validation.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.transport.validators.stoplight import decorators -from cdn.transport.validators.stoplight import exceptions -from cdn.transport.validators.stoplight import rule +from poppy.transport.validators.stoplight import decorators +from poppy.transport.validators.stoplight import exceptions +from poppy.transport.validators.stoplight import rule from test_service_validation import BaseTestCase # TODO(tonytan4ever): We probably want to move this to a diff --git a/tests/unit/common/test_decorators.py b/tests/unit/common/test_decorators.py index 1526c144..d1ca04c8 100644 --- a/tests/unit/common/test_decorators.py +++ b/tests/unit/common/test_decorators.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from cdn.common import decorators +from poppy.common import decorators from tests.unit import base diff --git a/tests/unit/manager/default/test_driver.py b/tests/unit/manager/default/test_driver.py index 0693d51a..858abeb9 100644 --- a/tests/unit/manager/default/test_driver.py +++ b/tests/unit/manager/default/test_driver.py @@ -17,14 +17,14 @@ import mock from oslo.config import cfg -from cdn.manager.default import driver -from cdn.manager.default import services +from poppy.manager.default import driver +from poppy.manager.default import services from tests.unit import base class DefaultManagerDriverTests(base.TestCase): - @mock.patch('cdn.storage.base.driver.StorageDriverBase') - @mock.patch('cdn.provider.base.driver.ProviderDriverBase') + @mock.patch('poppy.storage.base.driver.StorageDriverBase') + @mock.patch('poppy.provider.base.driver.ProviderDriverBase') def setUp(self, mock_storage, mock_provider): super(DefaultManagerDriverTests, self).setUp() diff --git a/tests/unit/manager/default/test_services.py b/tests/unit/manager/default/test_services.py index 9fc7a00b..a0ad6738 100644 --- a/tests/unit/manager/default/test_services.py +++ b/tests/unit/manager/default/test_services.py @@ -17,14 +17,14 @@ import mock from oslo.config import cfg -from cdn.manager.default import driver -from cdn.manager.default import services +from poppy.manager.default import driver +from poppy.manager.default import services from tests.unit import base class DefaultManagerServiceTests(base.TestCase): - @mock.patch('cdn.storage.base.driver.StorageDriverBase') - @mock.patch('cdn.provider.base.driver.ProviderDriverBase') + @mock.patch('poppy.storage.base.driver.StorageDriverBase') + @mock.patch('poppy.provider.base.driver.ProviderDriverBase') def setUp(self, mock_driver, mock_provider): super(DefaultManagerServiceTests, self).setUp() diff --git a/tests/unit/model/helpers/test_cachingrule.py b/tests/unit/model/helpers/test_cachingrule.py index 60c06748..97481f51 100644 --- a/tests/unit/model/helpers/test_cachingrule.py +++ b/tests/unit/model/helpers/test_cachingrule.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import cachingrule +from poppy.model.helpers import cachingrule from tests.unit import base diff --git a/tests/unit/model/helpers/test_domain.py b/tests/unit/model/helpers/test_domain.py index 162c6667..f2632daf 100644 --- a/tests/unit/model/helpers/test_domain.py +++ b/tests/unit/model/helpers/test_domain.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import domain +from poppy.model.helpers import domain from tests.unit import base diff --git a/tests/unit/model/helpers/test_link.py b/tests/unit/model/helpers/test_link.py index 730d20d3..4982b214 100644 --- a/tests/unit/model/helpers/test_link.py +++ b/tests/unit/model/helpers/test_link.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import link +from poppy.model.helpers import link from tests.unit import base diff --git a/tests/unit/model/helpers/test_origin.py b/tests/unit/model/helpers/test_origin.py index d26ce9ca..09bc6479 100644 --- a/tests/unit/model/helpers/test_origin.py +++ b/tests/unit/model/helpers/test_origin.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import origin +from poppy.model.helpers import origin from tests.unit import base diff --git a/tests/unit/model/helpers/test_restriciton.py b/tests/unit/model/helpers/test_restriciton.py index 2b63351e..3e79bc1d 100644 --- a/tests/unit/model/helpers/test_restriciton.py +++ b/tests/unit/model/helpers/test_restriciton.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import restriction +from poppy.model.helpers import restriction from tests.unit import base diff --git a/tests/unit/model/helpers/test_rule.py b/tests/unit/model/helpers/test_rule.py index b5bae795..329036b3 100644 --- a/tests/unit/model/helpers/test_rule.py +++ b/tests/unit/model/helpers/test_rule.py @@ -16,7 +16,7 @@ import ddt -from cdn.model.helpers import rule +from poppy.model.helpers import rule from tests.unit import base diff --git a/tests/unit/model/test_service.py b/tests/unit/model/test_service.py index 7c53b27b..53deefcc 100644 --- a/tests/unit/model/test_service.py +++ b/tests/unit/model/test_service.py @@ -16,9 +16,9 @@ import ddt -from cdn.model.helpers import domain -from cdn.model.helpers import origin -from cdn.model import service +from poppy.model.helpers import domain +from poppy.model.helpers import origin +from poppy.model import service from tests.unit import base diff --git a/tests/unit/provider/fastly/test_driver.py b/tests/unit/provider/fastly/test_driver.py index b91ef5bf..c8c9f095 100644 --- a/tests/unit/provider/fastly/test_driver.py +++ b/tests/unit/provider/fastly/test_driver.py @@ -16,7 +16,7 @@ import fastly import mock -from cdn.provider.fastly import driver +from poppy.provider.fastly import driver from oslo.config import cfg from tests.unit import base @@ -55,7 +55,7 @@ class TestDriver(base.TestCase): client = provider.client() self.assertNotEquals(client, None) - @mock.patch('cdn.provider.fastly.controllers.ServiceController') + @mock.patch('poppy.provider.fastly.controllers.ServiceController') @mock.patch.object(driver, 'FASTLY_OPTIONS', new=FASTLY_OPTIONS) def test_service_controller(self, MockController): provider = driver.CDNProvider(self.conf) diff --git a/tests/unit/provider/fastly/test_services.py b/tests/unit/provider/fastly/test_services.py index 33dd5f02..98d7d734 100644 --- a/tests/unit/provider/fastly/test_services.py +++ b/tests/unit/provider/fastly/test_services.py @@ -18,7 +18,7 @@ import fastly import mock import random -from cdn.provider.fastly import services +from poppy.provider.fastly import services from tests.unit import base @@ -29,8 +29,8 @@ class TestServices(base.TestCase): @mock.patch('fastly.FastlyConnection') @mock.patch('fastly.FastlyService') @mock.patch('fastly.FastlyVersion') - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_create(self, service_json, mock_connection, mock_service, mock_version, mock_controllerclient, mock_driver): @@ -122,8 +122,8 @@ class TestServices(base.TestCase): @mock.patch('fastly.FastlyConnection') @mock.patch('fastly.FastlyService') - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_delete(self, mock_connection, mock_service, mock_client, mock_driver): driver = mock_driver() @@ -155,8 +155,8 @@ class TestServices(base.TestCase): controller.client.delete_service.assert_called_once_with(service.id) self.assertIn('domain', resp[driver.provider_name]) - @mock.patch('cdn.provider.fastly.services.ServiceController.client') - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.services.ServiceController.client') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') @ddt.file_data('data_service.json') def test_update(self, mock_get_client, mock_driver, service_json): service_name = 'whatsitnamed' @@ -166,7 +166,7 @@ class TestServices(base.TestCase): resp = controller.update(service_name, service_json) self.assertIn('domain', resp[driver.provider_name]) - @mock.patch('cdn.provider.fastly.driver.CDNProvider') + @mock.patch('poppy.provider.fastly.driver.CDNProvider') def test_client(self, mock_driver): driver = mock_driver() controller = services.ServiceController(driver) diff --git a/tests/unit/provider/mock/test_mock_driver.py b/tests/unit/provider/mock/test_mock_driver.py index f7ff75cc..e0d9ad7d 100644 --- a/tests/unit/provider/mock/test_mock_driver.py +++ b/tests/unit/provider/mock/test_mock_driver.py @@ -15,7 +15,7 @@ from oslo.config import cfg -from cdn.provider.mock import driver +from poppy.provider.mock import driver from tests.unit import base diff --git a/tests/unit/storage/cassandra/test_driver.py b/tests/unit/storage/cassandra/test_driver.py index a40b8b85..cd44afdb 100644 --- a/tests/unit/storage/cassandra/test_driver.py +++ b/tests/unit/storage/cassandra/test_driver.py @@ -18,15 +18,15 @@ import mock from oslo.config import cfg -from cdn.storage.cassandra import driver -from cdn.storage.cassandra import services +from poppy.storage.cassandra import driver +from poppy.storage.cassandra import services from tests.unit import base CASSANDRA_OPTIONS = [ cfg.ListOpt('cluster', default='mock_ip', help='Cassandra Cluster contact points'), - cfg.StrOpt('keyspace', default='mock_cdn', + cfg.StrOpt('keyspace', default='mock_poppy', help='Keyspace for all queries made in session'), ] @@ -44,7 +44,7 @@ class CassandraStorageServiceTests(base.TestCase): self.assertEquals(self.cassandra_driver.cassandra_conf['cluster'], ['mock_ip']) self.assertEquals(self.cassandra_driver.cassandra_conf.keyspace, - 'mock_cdn') + 'mock_poppy') def test_is_alive(self): self.assertEquals(self.cassandra_driver.is_alive(), True) @@ -52,7 +52,7 @@ class CassandraStorageServiceTests(base.TestCase): @mock.patch.object(cassandra.cluster.Cluster, 'connect') def test_connection(self, mock_cluster): self.cassandra_driver.connection() - mock_cluster.assert_called_with('mock_cdn') + mock_cluster.assert_called_with('mock_poppy') def test_service_controller(self): sc = self.cassandra_driver.service_controller @@ -64,4 +64,4 @@ class CassandraStorageServiceTests(base.TestCase): @mock.patch.object(cassandra.cluster.Cluster, 'connect') def test_service_database(self, mock_cluster): self.cassandra_driver.service_database - mock_cluster.assert_called_with('mock_cdn') + mock_cluster.assert_called_with('mock_poppy') diff --git a/tests/unit/storage/cassandra/test_services.py b/tests/unit/storage/cassandra/test_services.py index 50839438..1b775e92 100644 --- a/tests/unit/storage/cassandra/test_services.py +++ b/tests/unit/storage/cassandra/test_services.py @@ -19,8 +19,8 @@ import mock from oslo.config import cfg -from cdn.storage.cassandra import driver -from cdn.storage.cassandra import services +from poppy.storage.cassandra import driver +from poppy.storage.cassandra import services from tests.unit import base diff --git a/tests/unit/storage/mockdb/test_mockdb_driver.py b/tests/unit/storage/mockdb/test_mockdb_driver.py index 6509158b..e8aa9b24 100644 --- a/tests/unit/storage/mockdb/test_mockdb_driver.py +++ b/tests/unit/storage/mockdb/test_mockdb_driver.py @@ -15,7 +15,7 @@ from oslo.config import cfg -from cdn.storage.mockdb import driver +from poppy.storage.mockdb import driver from tests.unit import base diff --git a/tests/unit/test_bootstrap.py b/tests/unit/test_bootstrap.py index adfdab8e..170d1b68 100644 --- a/tests/unit/test_bootstrap.py +++ b/tests/unit/test_bootstrap.py @@ -18,7 +18,7 @@ import os import mock from oslo.config import cfg -from cdn import bootstrap +from poppy import bootstrap from tests.unit import base @@ -32,7 +32,7 @@ class TestBootStrap(base.TestCase): bootstrap_obj = bootstrap.Bootstrap(cfg.CONF) - mock_path = 'cdn.transport.pecan.driver.simple_server' + mock_path = 'poppy.transport.pecan.driver.simple_server' with mock.patch(mock_path) as mocked_module: mock_server = mock.Mock() mocked_module.make_server = mock.Mock(return_value=mock_server) diff --git a/tests/unit/transport/pecan/test_driver.py b/tests/unit/transport/pecan/test_driver.py index cb4bad09..2c1fea62 100644 --- a/tests/unit/transport/pecan/test_driver.py +++ b/tests/unit/transport/pecan/test_driver.py @@ -18,7 +18,7 @@ import os import mock from oslo.config import cfg -from cdn.transport import pecan +from poppy.transport import pecan from tests.unit import base @@ -32,7 +32,7 @@ class PecanTransportDriverTest(base.TestCase): conf_path = os.path.join(tests_path, 'etc', 'default_functional.conf') cfg.CONF(args=[], default_config_files=[conf_path]) - mock_path = 'cdn.transport.pecan.driver.simple_server' + mock_path = 'poppy.transport.pecan.driver.simple_server' with mock.patch(mock_path) as mocked_module: mock_server = mock.Mock() mocked_module.make_server = mock.Mock(return_value=mock_server) diff --git a/tox.ini b/tox.ini index 28c7330b..3179e67d 100644 --- a/tox.ini +++ b/tox.ini @@ -35,4 +35,4 @@ builtins = __CDN_SETUP__ exclude = .venv*,venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv [hacking] -import_exceptions = cdn.openstack.common.gettextutils._ +import_exceptions = poppy.openstack.common.gettextutils._