Skip to content

Commit

Permalink
fix: jans-linux-setup load test data with jans-auth only (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar committed Dec 28, 2022
1 parent 6ad166a commit f696fee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
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

0 comments on commit f696fee

Please sign in to comment.