Avoid rbac defaults conflict in functional tests

RBAC defaults for enforce_scope and enforce_new_defaults for
placement service is False. Nova is setting them for Nova service
to True in https://review.opendev.org/c/openstack/nova/+/866218

Placement tests fixture are used in Nova functional tests and
setting the rbac defaults causing placement to run with defaults
of what Nova is setting. To avoid this conflict, in placement
tests fixture, we need to set enforce_scope and enforce_new_defaults
to the same value it is for placement service.

Needed-By: https://review.opendev.org/c/openstack/nova/+/866218
Change-Id: I7e94d107962efdd7779733375327f5c8248c7087
This commit is contained in:
Ghanshyam Mann 2023-01-08 01:06:10 -06:00
parent 1c8afcd3f1
commit ff8bee1fbc
1 changed files with 8 additions and 1 deletions

View File

@ -70,7 +70,14 @@ class PlacementFixture(fixtures.Fixture):
if self.db:
self.useFixture(db_fixture.Database(self.conf_fixture,
set_config=True))
policy_opts.set_defaults(self.conf_fixture.conf)
# NOTE(gmann): Set enforce_scope and enforce_new_defaults to the
# same value it is for placement service. We need to explicitly set
# it here because this fixture is called by Nova functional tests and
# Nova default of these config options is changed to True. To avoid
# Placement service running with what Nova using in functional tests
# we need to set them to False here.
policy_opts.set_defaults(self.conf_fixture.conf, enforce_scope=False,
enforce_new_defaults=False)
self.conf_fixture.config(group='api', auth_strategy='noauth2')
self.conf_fixture.conf([], default_config_files=[])