Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jans-linux-setup load test data with jans-auth only #3432

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion jans-linux-setup/jans_setup/setup_app/test_data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from setup_app.utils.ldif_utils import myLdifParser, schema2json
from setup_app.pylib.schema import ObjectClass
from setup_app.pylib.ldif4.ldif import LDIFWriter

from setup_app.pylib.jproperties import Properties

class TestDataLoader(BaseInstaller, SetupUtils):

Expand Down Expand Up @@ -215,6 +215,26 @@ def load_test_data(self):

self.render_templates_folder(self.template_base, ignoredirs=ignoredirs)

if Config.get('jca_client_id') or Config.get('jca_test_client_id'):
config_oxauth_test_data_server_properties_fn = os.path.join(Config.output_dir, 'test/jans-auth/server/config-oxauth-test-data.properties')
config_oxauth_test_data_server_properties = Properties()

with open(config_oxauth_test_data_server_properties_fn, 'rb') as f:
config_oxauth_test_data_server_properties.load(f, 'utf-8')

keep_clients = config_oxauth_test_data_server_properties["test.keep.clients"].data.split(',')
keep_clients = [client_id.strip() for client_id in keep_clients]

if Config.get('jca_client_id'):
keep_clients.append(Config.jca_client_id)
if Config.get('jca_test_client_id'):
keep_clients.append(Config.jca_test_client_id)

config_oxauth_test_data_server_properties["test.keep.clients"] = ', '.join(keep_clients)

with open(config_oxauth_test_data_server_properties_fn, 'wb') as w:
config_oxauth_test_data_server_properties.store(w)

self.logIt("Loading test ldif files")
Config.pbar.progress(self.service_name, "Importing ldif files", False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sector.identifier.id.bad=840ef58d-a7d0-4986-af7b-71ed0089ce61
contact.email.1=mike@jans.org
contact.email.2=javier@jans.org

test.keep.clients=%(scim_client_id)s, %(jca_client_id)s, AB77-1A2B, 3E20, FF81-2D39, %(jca_test_client_id)s
test.keep.clients=%(scim_client_id)s, AB77-1A2B, 3E20, FF81-2D39

clientKeyStoreFile=profiles/%(hostname)s/client_keystore.p12
clientKeyStoreSecret=secret