Start using to oslotest

oslotest provides a BaseTestCase class then enables proper capturing of
stdout, stderr and logging streams during a test run. We will take
advantage of this capability in the near future.

Change-Id: I16761053f631e709224eee813dc0f423f06c8870
Removes the use of mutables as default args

Automatic enforcement of this rule is added in:
https://review.openstack.org/78119

bp more-code-style-automation

Change-Id: I184105a456e9beae3cb3d6716b974ba52ef8bdad
Use assertIsNone when comparing against None

Automatic enforcement of this rule is added in:
https://review.openstack.org/78119

bp more-code-style-automation

Change-Id: I3969d7595494d5df5bdb072234f2facc6000ab30
Allows override of stdout/stderr/log capturing

During a test run stdout, stderr and log messages are being captured. If
the test fails all three will be printed out so that can be inspected.
Each stream has an environment variable that can be used to stop it from
being printed at the end of a test run by setting its value to 0. This
is in line with what many of the other project are already doing.

Environment variables:

 - OS_STDOUT_CAPTURE for stdout
 - OS_STDERR_CAPTURE for stderr
 - OS_LOG_CAPTURE for logging

Change-Id: I2fed99069950b839e060297026c8e06cbd45bb98
Use CMS to generate sample tokens

This is preparing for compressed tokens.  We don't want anything in the
keystone server tree that assumes it knows the formats of the token.
This uses the CMS code to preduce the sample data.

Change-Id: I6bf9c0f8df2e2e6d53fef4ecbcca87b9f9af4e6b
Use in-memory SQLite for testing

Use the in-memory sqlite db for testing. Changes have been made to
populate data for in-memory databases differently as there are now
no longer any migrations being used to create the schema when
in-memory SQLite is used (with exception of the explicit migration
test cases). The most notible case where the creation of the schema
differs from using the migrations, is the creation of the default
domain. Typically this has been done by migration 008. The restful
test cases now properly populate the default domain explicitly if
needed.

As part of this patch to ensure extensions received the correct
schema additions, the EXTENSION_NAME property is now used in the
test case to do migrations when not utilizing in-memory SQLite.

The model for ROLE table in assignment did not properly indicate
that the name column was "unique" (as would be the case using the
migrations). This unique column identifier is needed since the
migration no longer occurs (it becomes even more important that
the models match).

To support proper testing, the revoke tests in test_v3_auth now
provide thier own load_sample_data method and re-use the already
defined admin role based upon the super() call.

Change-Id: I4cd08cdf3fa9c7b3265223d1baf6d3cf0d1c12dd
Use in-memory SQLite for sql migration tests

Use the new in-memory SQLite support for the migration tests by
default.

Change-Id: I3ef3a6ff5442ebbad039ddb7936095c389454a9e
Refactor LDAP API

The fake LDAP API must emulate the python-ldap API as much as possible
otherwise much of the LDAP testing is invalid. The python-ldap API
only accepts utf-8 encoded strings. However, the fake LDAP API accepts
any Python type therefore properly handling type conversion into and
out of the LDAP API is not exercised by the fake LDAP API during
testing. Currently type conversion is done inside the LdapWrapper
which calls the python-ldap API, this means unicode issues only appear
when testing with a live LDAP server.

LdapWrapper and FakeLdap logically are two different providers of the
same API, as such they should behave identically. Which LDAP API is
used at run time a configurable option.

We need a mechanism by which we can substitute an LDAP API and then
wrap the calls to that API with type conversions. Type conversion
wrapping replaces the Python types used in Keystone with the types
needed for the LDAP API, calls the LDAP API, and then type converts
the results back from LDAP to those used by Keystone.

This patch establishes an LDAP API interface (LDAPHandler), modifies
fake LDAP to support it, replaces LdapWrapper with the interface
(invoking python-ldap) and adds another LDAPHandler instance which
will be the common location for type conversions prior to calling the
configured LDAP interface. See the LDAPHandler class definition for
details).

This patch is exclusively a refactoring patch anticipating a
subsequent patch to properly handle unicode values. There is no
significant change in functionality with this patch, it is just
refactoring to more cleanly seperate API boundaries. A few tests which
exercised unicode were disabled in this patch because they will not
work until the next patch which adds back in correct unicode
handling. The idea here is to separate out the refactoring needed to
support unicode from the actual unicode changes, this should make
reviewing easier.

Partial-Bug: 1172106
Change-Id: I7db24040689245a616332b08744f40ab8381579d
Remove noqa form import _s

Some files had noqa on the import _ line. This isn't necessary
so remove it.

Change-Id: Ic9784f2fda7fbe2595b3a85535bf815ecd10dfff
Merge "Remove noqa form import _s"
Merge "Refactor LDAP API"
Merge "Start using to oslotest"
Merge "Allows override of stdout/stderr/log capturing"
Merge "Removes the use of mutables as default args"
Merge "Use CMS to generate sample tokens"
Imported Translations from Transifex

Change-Id: I80ac7e161265e55ef496ab1c2c43b71789ab126e
Merge "Use assertIsNone when comparing against None"