From 0a18e2a7178a0280d9dbe9462c6a2d99eb2fff91 Mon Sep 17 00:00:00 2001 From: Jonas Bardino Date: Fri, 29 May 2026 22:40:12 +0200 Subject: [PATCH] Add a few more user state dirs made by actual user creation and importantly expected e.g. during useradm operations like edit_user, delete_user, etc. and therefore difficult to do without when adding test coverage a.o. in #561. Introduce two more common DNs used across tests: Other User and No Such User. Polish a long comment with some typos and incomplete ending. --- tests/support/usersupp.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/support/usersupp.py b/tests/support/usersupp.py index 65a02fa4a..4fcf68413 100644 --- a/tests/support/usersupp.py +++ b/tests/support/usersupp.py @@ -38,6 +38,8 @@ TEST_USER_DN = '/C=DK/ST=NA/L=NA/O=Test Org/OU=NA/CN=Test User/emailAddress=test@example.com' +OTHER_USER_DN = '/C=DK/ST=NA/L=NA/O=Other Org/OU=NA/CN=Other User/emailAddress=other@example.com' +NO_SUCH_USER_DN = '/C=DK/ST=NA/L=NA/O=No Such Org/OU=NA/CN=No Such User/emailAddress=nosuchuser@example.com' _FIXTURE_NAME_BY_USER_DN = { TEST_USER_DN: 'MiG-users.db--example' @@ -120,6 +122,15 @@ def _provision_test_user_dirs(testcase, distinguished_name): with open(test_user_settings_file, 'wb') as outfile: pickle.dump({}, outfile) + # create the test user cache, resource pending and mrsl files sub dirs + for sub in (self.configuration.user_cache, + self.configuration.resource_pending, + self.configuration.mrsl_files_dir): + conf_user_sub = os.path.normpath(sub) + test_user_sub_dir = os.path.join( + conf_user_sub, test_client_dir_name) + os.makedirs(test_user_sub_dir) + return test_user_dir @staticmethod @@ -134,8 +145,8 @@ def _provision_test_users(testcase, *distinguished_names): that the user db will be populated from arbitrary data and thus the test dependent upon this is less strongly assured, but if (as is the expectation) the basic operations are validated with - "indenpdent" data i.e. conained within fixtures as opposed to - generated by logic that extended tests which need + "independent" data i.e. contained within fixtures as opposed to + generated by logic that extended tests will need. """ conf_user_db_home = UserAssertMixin._provision_user_db_dir(testcase)