From 063553406a7f3bc1a69744a0fc56abac062d9a71 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Thu, 12 Dec 2024 21:40:15 -0600 Subject: [PATCH] Fix --- src/middlewared/middlewared/plugins/test/mock.py | 4 +++- tests/api2/test_stig.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/middlewared/middlewared/plugins/test/mock.py b/src/middlewared/middlewared/plugins/test/mock.py index 0efe7bf69f909..ca97fc3c76487 100644 --- a/src/middlewared/middlewared/plugins/test/mock.py +++ b/src/middlewared/middlewared/plugins/test/mock.py @@ -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']) diff --git a/tests/api2/test_stig.py b/tests/api2/test_stig.py index 8cc69e8b1be62..465dfde914b51 100644 --- a/tests/api2/test_stig.py +++ b/tests/api2/test_stig.py @@ -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')