summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2022-06-17 12:04:20 +0100
committerStephen Finucane <sfinucan@redhat.com>2022-06-17 14:34:32 +0100
commit30fa47f98ade92a38715ae8fffa4ce6a6d73c962 (patch)
treed9fb7bece6d7c09b531771b254365db931ca5ccf
parent7c2d0f589c8daf5c65a80ed20d1e7fbfcc282312 (diff)
downloadkeystone-30fa47f98ade92a38715ae8fffa4ce6a6d73c962.tar.gz
Ignore UserWarning for scope checks during test runs
Keystone's API policy rules are defaulting to system scope. Scope checks are disabled by default in oslo.policy, but if you hit the API with a token that doesn't match the scope, it generates a UserWarning, for every policy check on that request. This is pretty annoying, so just filter those warnings during our test runs. Change-Id: I150b8fa19d4ec1582234caa4c25db905e6403590 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
-rw-r--r--keystone/tests/unit/ksfixtures/warnings.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/keystone/tests/unit/ksfixtures/warnings.py b/keystone/tests/unit/ksfixtures/warnings.py
index 9e3a9c4d4..43519925f 100644
--- a/keystone/tests/unit/ksfixtures/warnings.py
+++ b/keystone/tests/unit/ksfixtures/warnings.py
@@ -35,6 +35,23 @@ class WarningsFixture(fixtures.Fixture):
module='^keystone\\.',
)
+ warnings.filterwarnings(
+ 'ignore',
+ message=(
+ 'Policy enforcement is depending on the value of '
+ '(token|group_ids). '
+ 'This key is deprecated. Please update your policy '
+ 'file to use the standard policy values.'
+ ),
+ )
+
+ # NOTE(stephenfin): Ignore scope check UserWarnings from oslo.policy.
+ warnings.filterwarnings(
+ 'ignore',
+ message="Policy .* failed scope check",
+ category=UserWarning,
+ )
+
# TODO(stephenfin): This will be fixed once we drop sqlalchemy-migrate
warnings.filterwarnings(
'ignore',