Move 'tests' directory into 'keystone' package

Similar to a range of other components (e.g. glance,nova,...) and recent
reviews by Monty.

Running individual tests can be done like this:

./run_tests.sh keystone.tests.test_drivers

Change-Id: I2482a48322150e5eb09b703326a94d8283f1c75b
This commit is contained in:
Sascha Peilicke 2013-01-21 15:34:42 +01:00 committed by Monty Taylor
parent 361f6fe111
commit 14e090154c
82 changed files with 54 additions and 59 deletions

2
.gitignore vendored
View File

@ -24,6 +24,6 @@ build/
dist/ dist/
etc/keystone.conf etc/keystone.conf
etc/logging.conf etc/logging.conf
tests/tmp/ keystone/tests/tmp/
.project .project
.pydevproject .pydevproject

View File

@ -16,7 +16,7 @@ include etc/*
include httpd/* include httpd/*
graft bin graft bin
graft doc graft doc
graft tests graft keystone/tests
graft tools graft tools
graft examples graft examples
recursive-include keystone *.json *.xml *.cfg *.pem README *.po *.pot *.sql recursive-include keystone *.json *.xml *.cfg *.pem README *.po *.pot *.sql

View File

@ -133,8 +133,8 @@ Test Structure
-------------- --------------
``./run_test.sh`` uses its python cohort (``run_tests.py``) to iterate ``./run_test.sh`` uses its python cohort (``run_tests.py``) to iterate
through the ``tests`` directory, using Nosetest to collect the tests and through the ``keystone/tests`` directory, using Nosetest to collect the tests
invoke them using an OpenStack custom test running that displays the tests and invoke them using an OpenStack custom test running that displays the tests
as well as the time taken to run those tests. as well as the time taken to run those tests.
Not all of the tests in the tests directory are strictly unit tests. Keystone Not all of the tests in the tests directory are strictly unit tests. Keystone
@ -223,9 +223,9 @@ and set environment variables ``KEYSTONE_IDENTITY_BACKEND=ldap`` and
``KEYSTONE_CLEAR_LDAP=yes`` in your ``localrc`` file. ``KEYSTONE_CLEAR_LDAP=yes`` in your ``localrc`` file.
The unit tests can be run against a live server with The unit tests can be run against a live server with
``tests/_ldap_livetest.py``. The default password is ``test`` but if you have ``keystone/tests/_ldap_livetest.py``. The default password is ``test`` but if you have
installed devstack with a different LDAP password, modify the file installed devstack with a different LDAP password, modify the file
``tests/backend_liveldap.conf`` to reflect your password. ``keystone/tests/backend_liveldap.conf`` to reflect your password.
Building the Documentation Building the Documentation

View File

@ -22,7 +22,7 @@ from keystone.common import ldap as ldap_common
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone.identity.backends import ldap as identity_ldap from keystone.identity.backends import ldap as identity_ldap
from keystone import test from keystone.tests import core as test
import test_backend_ldap import test_backend_ldap

View File

@ -21,7 +21,7 @@ import ldap.modlist
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone import identity from keystone import identity
from keystone import test from keystone.tests import core as test
import _ldap_livetest import _ldap_livetest

View File

@ -34,3 +34,4 @@ driver = keystone.policy.backends.sql.Policy
[trust] [trust]
driver = keystone.trust.backends.sql.Trust driver = keystone.trust.backends.sql.Trust

View File

@ -57,9 +57,9 @@ from keystone import trust
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
ROOTDIR = os.path.dirname(os.path.abspath(os.curdir)) ROOTDIR = os.path.dirname(os.path.abspath('..'))
VENDOR = os.path.join(ROOTDIR, 'vendor') VENDOR = os.path.join(ROOTDIR, 'vendor')
TESTSDIR = os.path.join(ROOTDIR, 'tests') TESTSDIR = os.path.join(ROOTDIR, 'keystone', 'tests')
ETCDIR = os.path.join(ROOTDIR, 'etc') ETCDIR = os.path.join(ROOTDIR, 'etc')
TMPDIR = os.path.join(TESTSDIR, 'tmp') TMPDIR = os.path.join(TESTSDIR, 'tmp')

View File

@ -16,7 +16,7 @@ import copy
import datetime import datetime
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone import auth from keystone import auth
from keystone import config from keystone import config

View File

@ -16,7 +16,7 @@
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone import auth from keystone import auth
from keystone import exception from keystone import exception

View File

@ -17,7 +17,7 @@
import datetime import datetime
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone.catalog import core from keystone.catalog import core
from keystone import config from keystone import config

View File

@ -15,10 +15,9 @@
# under the License. # under the License.
import uuid import uuid
from keystone import test
from keystone import exception from keystone import exception
from keystone import identity from keystone import identity
from keystone.tests import core as test
import default_fixtures import default_fixtures
import test_backend import test_backend

View File

@ -23,7 +23,7 @@ from keystone.common import sql
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone import identity from keystone import identity
from keystone import test from keystone.tests import core as test
import default_fixtures import default_fixtures
import test_backend import test_backend

View File

@ -20,7 +20,7 @@ import uuid
import memcache import memcache
from keystone import test from keystone.tests import core as test
from keystone.common import utils from keystone.common import utils
from keystone import exception from keystone import exception

View File

@ -16,7 +16,7 @@
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone.identity.backends import pam as identity_pam from keystone.identity.backends import pam as identity_pam

View File

@ -18,11 +18,10 @@ import uuid
import sqlalchemy import sqlalchemy
from keystone import test
from keystone.common import sql from keystone.common import sql
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone.tests import core as test
import default_fixtures import default_fixtures
import test_backend import test_backend

View File

@ -16,7 +16,7 @@
import os import os
from keystone import test from keystone.tests import core as test
from keystone import exception from keystone import exception

View File

@ -18,7 +18,7 @@
import os import os
import shutil import shutil
from keystone import test from keystone.tests import core as test
from keystone.common import openssl from keystone.common import openssl
from keystone import exception from keystone import exception

View File

@ -1,4 +1,4 @@
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone import exception from keystone import exception

View File

@ -20,7 +20,7 @@ import uuid
from lxml import etree from lxml import etree
import webtest import webtest
from keystone import test from keystone.tests import core as test
from keystone.common import extension from keystone.common import extension
from keystone.common import serializer from keystone.common import serializer

View File

@ -16,7 +16,7 @@
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone.contrib import ec2 from keystone.contrib import ec2
from keystone.contrib import s3 from keystone.contrib import s3

View File

@ -17,7 +17,7 @@
from keystone.contrib import stats from keystone.contrib import stats
from keystone import config from keystone import config
from keystone import test from keystone.tests import core as test
CONF = config.CONF CONF = config.CONF

View File

@ -16,7 +16,7 @@
import uuid import uuid
from keystone import test from keystone.tests import core as test
from keystone.common import wsgi from keystone.common import wsgi
from keystone import config from keystone import config

View File

@ -21,7 +21,7 @@ try:
except ImportError: except ImportError:
from pysqlite2 import dbapi2 as dbapi from pysqlite2 import dbapi2 as dbapi
from keystone import test from keystone.tests import core as test
from keystone.catalog.backends import templated as catalog_templated from keystone.catalog.backends import templated as catalog_templated
from keystone.common.sql import legacy from keystone.common.sql import legacy

View File

@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from keystone import test from keystone.tests import core as test
from keystone.common import environment from keystone.common import environment
from keystone import config from keystone import config

View File

@ -17,11 +17,10 @@
import uuid import uuid
import webob import webob
from keystone import test
from keystone import config from keystone import config
from keystone.openstack.common import jsonutils from keystone.openstack.common import jsonutils
from keystone.openstack.common import timeutils from keystone.openstack.common import timeutils
from keystone.tests import core as test
import default_fixtures import default_fixtures

View File

@ -16,10 +16,9 @@
import uuid import uuid
from keystone import test
from keystone.common import sql from keystone.common import sql
from keystone import config from keystone import config
from keystone.tests import core as test
import test_keystoneclient import test_keystoneclient

View File

@ -16,7 +16,7 @@
import webob import webob
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone import middleware from keystone import middleware

View File

@ -2,7 +2,7 @@
import os import os
import webtest import webtest
from keystone import test from keystone.tests import core as test
def _generate_paste_config(): def _generate_paste_config():

View File

@ -15,6 +15,6 @@ driver = keystone.trust.backends.kvs.Trust
driver = keystone.token.backends.kvs.Token driver = keystone.token.backends.kvs.Token
[signing] [signing]
certfile = ../examples/pki/certs/signing_cert.pem certfile = ../../examples/pki/certs/signing_cert.pem
keyfile = ../examples/pki/private/signing_key.pem keyfile = ../../examples/pki/private/signing_key.pem
ca_certs = ../examples/pki/certs/cacert.pem ca_certs = ../../examples/pki/certs/cacert.pem

View File

@ -19,7 +19,7 @@ import StringIO
import tempfile import tempfile
import urllib2 import urllib2
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone import exception from keystone import exception

View File

@ -17,7 +17,7 @@
import copy import copy
from keystone.common import serializer from keystone.common import serializer
from keystone import test from keystone.tests import core as test
class XmlSerializerTestCase(test.TestCase): class XmlSerializerTestCase(test.TestCase):

View File

@ -14,7 +14,7 @@
import webob import webob
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone import exception from keystone import exception

View File

@ -14,7 +14,7 @@
from keystone.common import sql from keystone.common import sql
from keystone import test from keystone.tests import core as test
class CallbackMonitor: class CallbackMonitor:

View File

@ -15,8 +15,8 @@
# under the License. # under the License.
""" """
To run these tests against a live database: To run these tests against a live database:
1. Modify the file `tests/backend_sql.conf` to use the connection for your 1. Modify the file `keystone/tests/backend_sql.conf` to use the connection for
live database your live database
2. Set up a blank, live database. 2. Set up a blank, live database.
3. run the tests using 3. run the tests using
./run_tests.sh -N test_sql_upgrade ./run_tests.sh -N test_sql_upgrade
@ -32,7 +32,7 @@ import uuid
from migrate.versioning import api as versioning_api from migrate.versioning import api as versioning_api
import sqlalchemy import sqlalchemy
from keystone import test from keystone.tests import core as test
from keystone.common import sql from keystone.common import sql
from keystone.common.sql import migration from keystone.common.sql import migration

View File

@ -18,7 +18,7 @@
import os import os
import ssl import ssl
from keystone import test from keystone.tests import core as test
from keystone.common import environment from keystone.common import environment
from keystone import config from keystone import config

View File

@ -15,7 +15,7 @@
from keystone.common import wsgi from keystone.common import wsgi
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone import test from keystone.tests import core as test
CONF = config.CONF CONF = config.CONF

View File

@ -17,7 +17,7 @@
import uuid import uuid
from keystone import exception from keystone import exception
from keystone import test from keystone.tests import core as test
from keystone import token from keystone import token

View File

@ -16,7 +16,7 @@
import webob import webob
from keystone import test from keystone.tests import core as test
from keystone import middleware from keystone import middleware

View File

@ -29,7 +29,7 @@
# 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 keystone import test from keystone.tests import core as test
from keystone.common import utils from keystone.common import utils

View File

@ -4,13 +4,12 @@ import uuid
from lxml import etree from lxml import etree
import webtest import webtest
from keystone import test
from keystone import auth from keystone import auth
from keystone.common import serializer from keystone.common import serializer
from keystone import config from keystone import config
from keystone.openstack.common import timeutils from keystone.openstack.common import timeutils
from keystone.policy.backends import rules from keystone.policy.backends import rules
from keystone.tests import core as test
import test_content_types import test_content_types

View File

@ -19,7 +19,7 @@ from keystone import auth
from keystone.common import cms from keystone.common import cms
from keystone import config from keystone import config
from keystone import exception from keystone import exception
from keystone import test from keystone.tests import core as test
import test_v3 import test_v3

View File

@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from keystone import test from keystone.tests import core as test
from keystone import config from keystone import config
from keystone import controllers from keystone import controllers

View File

@ -14,11 +14,10 @@
# 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 keystone import test
from keystone.common import wsgi from keystone.common import wsgi
from keystone import exception from keystone import exception
from keystone.openstack.common import jsonutils from keystone.openstack.common import jsonutils
from keystone.tests import core as test
class FakeApp(wsgi.Application): class FakeApp(wsgi.Application):

View File

View File

@ -95,10 +95,10 @@ fi
function cleanup_test_db { function cleanup_test_db {
# Default test settings will leave around some test*.db files # Default test settings will leave around some test*.db files
# TODO(termie): this could probably be moved into tests/__init__.py # TODO(termie): this could probably be moved into keystone/tests/__init__.py
# but there have been some issues with creating that # but there have been some issues with creating that
# file for some users # file for some users
rm -f tests/test*.db rm -f keystone/tests/*.db
} }
function run_tests { function run_tests {

View File

@ -64,4 +64,4 @@ detailed-errors=1
cover-package = keystone cover-package = keystone
cover-html = true cover-html = true
cover-erase = true cover-erase = true
where=tests where=keystone/tests