Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Dec 13, 2024
1 parent 5d4f8e9 commit 0635534
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/middlewared/middlewared/plugins/test/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ async def set_mock_role(self):
if 'MOCK' in self.middleware.role_manager.roles:
return

self.middleware.role_manager.roles['MOCK'] = Role(stig=None)
# There are no STIG requirements specified for MOCK role here because
# we need to be able to mock methods in CI testing while under STIG restrictions
self.middleware.role_manager.roles['MOCK'] = Role()
self.middleware.role_manager.register_method(method_name='test.test1', roles=['MOCK'])
self.middleware.role_manager.register_method(method_name='test.test2', roles=['MOCK'])

Expand Down
4 changes: 3 additions & 1 deletion tests/api2/test_stig.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def setup_stig():
finally:
# Drop assurance level so that we can remove mock
# reliably
c.call('auth.set_authenticator_assurance_level', 'LEVEL_1')
call('system.security.configure_stig', {'enable_gpos_stig': False})
aal = call('auth.get_authenticator_assurance_level')
assert aal == 'LEVEL_1'


@pytest.fixture(scope='function')
Expand Down

0 comments on commit 0635534

Please sign in to comment.