Add unit tests for disabled endpoints in catalog

There were no tests that show how disabled endpoints are dealt
with in the catalog backend or when getting or validating a
token.

Change-Id: I42ba07e2e7a9c95469b3f2a741a809756cda9361
Related-Bug: #1273867
Fix include only enabled endpoints in catalog

The server was returning disabled endpoints in the catalog for a
token response. The server should not return disabled endpoints
in the catalog.

Change-Id: Ibaa54eb827846a613fe8c9eced6ae79a8abbfff2
Partial-Bug: #1273867
Fix db_version failed with wrong arguments

The `keystone-manage db_version` command was failing with an error
like

 TypeError: db_version() takes exactly 2 arguments (1 given)

This is because an engine wasn't being passed to db_version().

Change-Id: I20b4cb10f9c83fc672de2838bac8236938b92e32
Closes-Bug: #1284341
remove hardcoded SQL queries in tests

There are several occurrences of hardcoded SQL queries in tests.
Due to variations in databases these queries might not work all
the time, and should be replaced by queries built with sqlalchemy.

Change-Id: Id0198ea03087ab4acc7eebf0e4d12a37e3437382
Closes-Bug: #1287637
Cleanup backends after each test

Instance variables lingering around after a test completes can waste a
significant amount of memory during a long test run. This commit adds a
general helper method that can be used by add test classes to clean up
instance variables.

Change-Id: Ie7554f4c2e6e80540ea9f393f29b0eb15cacdf8c
Cleanup of instance attrs in core tests

This will cleanup the instance attributes added by setUps in
keystone.tests.core.

Change-Id: Iba820cbd33403c75291f04fd330bf343721e590b
Cleans up test data from limit tests

Change-Id: Ibd10e800b3108bfbb5bce076d3c1566cac3eb138
Cleanup fixture data added to test instances

Change-Id: I1c8f603dc520f2483630a902a4f93fd5f04b05b4
Cleanup keystoneclient tests

I remove redundant calls to load backends and initialize the database to
hopefully make these tests a little faster. I also added some cleanup
for instance attributes to help with memory consumption.

Change-Id: If2afec11266e0cd4cd132800259c4d4f84644600
Very minor cleanup to default_fixtures

The import wasn't being used so I removed it. Fixed a minor whitespace
issue.

Change-Id: I240250a45ab9e233964869e571b7ee84b03c7c74
Enforce groups presence for federated authn

Check whether all the groups issued by the RuleProcessor are present in
the backend. The request is rejected with an authentication error if no
groups are issued. If any of the issued groups are not found in the
backend, an unexpected error (500) is returned with a message explaining
which group was not found. Also, this policy is applied when an unscoped
token is being scoped.

Change-Id: I8b843fc567892289fba4c04b7e8b1dfd63d1e9ca
Closes-bug: #1290258
Remove unnecessary oauth1.Manager constructions

There's an oauth1.Manager kept in the global dependency that's
created when the oauth1 extension is loaded due to being in the
paste pipeline, so there's no need to create more of them.

Closes-Bug: #1291705
Change-Id: I78e19e3b165b4cd503e2da6a135daa54e98de599
Updated from global requirements

Change-Id: I1733a270d488b807183c6ff29226a93fd994e741
Merge "Cleanup backends after each test"
Merge "Cleanup of instance attrs in core tests"
Merge "Cleans up test data from limit tests"
Merge "Cleanup fixture data added to test instances"
Merge "Cleanup keystoneclient tests"
Merge "Very minor cleanup to default_fixtures"
Merge "Enforce groups presence for federated authn"