From 98d343c18b5a765828784f24dd78a0008a039d58 Mon Sep 17 00:00:00 2001 From: Bill Decoste Date: Thu, 24 Aug 2017 11:54:33 -0700 Subject: [PATCH] cloud-2003 fix inconsistencies in eap admin.sh and jdg management-realm.sh --- os-eap64-launch/added/launch/admin.sh | 2 -- os-eap7-launch/added/launch/admin.sh | 2 -- os-jdg7-launch/added/launch/management-realm.sh | 10 ++++++---- .../datagrid/7.1/datagrid-authentication.feature | 9 +++++++++ .../features/datagrid/datagrid-authentication.feature | 6 ------ 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/os-eap64-launch/added/launch/admin.sh b/os-eap64-launch/added/launch/admin.sh index 2d2ac1d4..a97d92b6 100644 --- a/os-eap64-launch/added/launch/admin.sh +++ b/os-eap64-launch/added/launch/admin.sh @@ -25,7 +25,5 @@ function configure_administration() { local mgmt_iface_replace_str="security-realm=\"ManagementRealm\"" sed -i "s|>| ${mgmt_iface_replace_str}>|" "$CONFIG_FILE" - else - sed -i "s|##MGMT_IFACE_REALM##||" "$CONFIG_FILE" fi } diff --git a/os-eap7-launch/added/launch/admin.sh b/os-eap7-launch/added/launch/admin.sh index 2d2ac1d4..a97d92b6 100644 --- a/os-eap7-launch/added/launch/admin.sh +++ b/os-eap7-launch/added/launch/admin.sh @@ -25,7 +25,5 @@ function configure_administration() { local mgmt_iface_replace_str="security-realm=\"ManagementRealm\"" sed -i "s|>| ${mgmt_iface_replace_str}>|" "$CONFIG_FILE" - else - sed -i "s|##MGMT_IFACE_REALM##||" "$CONFIG_FILE" fi } diff --git a/os-jdg7-launch/added/launch/management-realm.sh b/os-jdg7-launch/added/launch/management-realm.sh index 260d8d4a..ef03676b 100644 --- a/os-jdg7-launch/added/launch/management-realm.sh +++ b/os-jdg7-launch/added/launch/management-realm.sh @@ -9,9 +9,11 @@ function configure() { } function add_management_interface_realm() { - if [ -n "$MGMT_IFACE_REALM" ]; then - local mgmt_iface_replace_str="security-realm=\"$MGMT_IFACE_REALM\"" - fi + if [ -n "$MGMT_IFACE_REALM" ]; then + local mgmt_iface_replace_str="security-realm=\"$MGMT_IFACE_REALM\" " - sed -i "s|||" "$CONFIG_FILE" + sed -i "s|>| ${mgmt_iface_replace_str}>|" "$CONFIG_FILE" + + sed -i "s|||" "$CONFIG_FILE" + fi } diff --git a/tests/features/datagrid/7.1/datagrid-authentication.feature b/tests/features/datagrid/7.1/datagrid-authentication.feature index 37c8ecd5..c02b7fd5 100644 --- a/tests/features/datagrid/7.1/datagrid-authentication.feature +++ b/tests/features/datagrid/7.1/datagrid-authentication.feature @@ -6,3 +6,12 @@ Feature: JDG OpenShift simple authentication | variable | value | | MGMT_IFACE_REALM | ApplicationRealm | Then XML file /opt/datagrid/standalone/configuration/clustered-openshift.xml should contain value ApplicationRealm on XPATH //*[local-name()='http-interface']/@security-realm + + Scenario: check management interface security realm + When container is started with env + | variable | value | + | ADMIN_USERNAME | tombrady | + | ADMIN_PASSWORD | 5Rings!!! | + | MGMT_IFACE_REALM | ApplicationRealm | + Then XML file /opt/datagrid/standalone/configuration/clustered-openshift.xml should contain value ApplicationRealm on XPATH //*[local-name()='http-interface']/@security-realm + diff --git a/tests/features/datagrid/datagrid-authentication.feature b/tests/features/datagrid/datagrid-authentication.feature index da3283b4..f5958746 100644 --- a/tests/features/datagrid/datagrid-authentication.feature +++ b/tests/features/datagrid/datagrid-authentication.feature @@ -9,9 +9,3 @@ Feature: JDG OpenShift simple authentication Then file /opt/datagrid/standalone/configuration/application-users.properties should contain openshift=7d540d09717694371fc426a7190c6021 And file /opt/datagrid/standalone/configuration/application-roles.properties should contain openshift=REST,admin - @jboss-datagrid-7 - Scenario: check management interface security realm - When container is started with env - | variable | value | - | MGMT_IFACE_REALM | ApplicationRealm | - Then XML file /opt/datagrid/standalone/configuration/clustered-openshift.xml should contain value ApplicationRealm on XPATH //*[local-name()='http-interface']/@security-realm