From 89909366548d8ffeaec92e2da3b1b6d847c261d0 Mon Sep 17 00:00:00 2001 From: mchyzer Date: Wed, 13 May 2020 11:26:26 -0400 Subject: [PATCH] 2.5.28 release --- .../test/grouperContainerUnitTest.sh | 7 +++--- .../test/grouperContainerUnitTestDaemon.sh | 7 ++---- .../grouperContainerUnitTestQuickstart.sh | 4 ++-- .../test/grouperContainerUnitTestScim.sh | 4 ++-- .../test/grouperContainerUnitTestUi.sh | 8 +++++-- ...rouperContainerUnitTestUiDifferentPorts.sh | 11 ++++++--- .../grouperContainerUnitTestUiSubimage.sh | 4 ++-- ...ouperContainerUnitTestUiSubimageNonroot.sh | 4 ++-- .../test/grouperContainerUnitTestWs.sh | 6 +++-- .../tomee/conf/Catalina/localhost/grouper.xml | 2 +- container_files/usr-local-bin/libraryPrep.sh | 7 +++++- .../usr-local-bin/librarySetupFilesTomcat.sh | 24 ++++++++++++++++++- 12 files changed, 62 insertions(+), 26 deletions(-) diff --git a/container_files/tier-support/test/grouperContainerUnitTest.sh b/container_files/tier-support/test/grouperContainerUnitTest.sh index f1dfce8d..34d3828a 100644 --- a/container_files/tier-support/test/grouperContainerUnitTest.sh +++ b/container_files/tier-support/test/grouperContainerUnitTest.sh @@ -1,15 +1,16 @@ #!/bin/bash -if [ "$#" -ne 3 ]; then - echo "You must enter exactly 3 command line arguments: container-name, image-name and container version, e.g. grouper-test my-grouper-2.5.27:latest 2.5.27" +if [ "$#" -ne 4 ]; then + echo "You must enter exactly 4 command line arguments: container-name, image-name, container version, and grouper version, e.g. grouper-test my-grouper-2.5.27:latest 2.5.27 2.5.27" exit 1 fi -expectedSuccesses=521 +expectedSuccesses=528 export containerName=$1 export imageName=$2 export containerVersion=$3 +export grouperVersion=$4 export globalSleepSecondsAfterRun=5 export globalExitOnError=false diff --git a/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh b/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh index f43a0583..bb8e5507 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestDaemon.sh @@ -23,12 +23,9 @@ testContainerDaemon() { assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" - assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" - assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" - assertFileContains /etc/httpd/conf/httpd.conf "Listen 80" assertFileNotContains /opt/tier-support/supervisord.conf "program:shibbolethsp" assertFileContains /opt/tier-support/supervisord.conf "program:tomee" assertFileNotContains /opt/tier-support/supervisord.conf "program:httpd" diff --git a/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh b/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh index 40ec9a9c..7bdbe426 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestQuickstart.sh @@ -24,8 +24,8 @@ testContainerQuickstart() { assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" diff --git a/container_files/tier-support/test/grouperContainerUnitTestScim.sh b/container_files/tier-support/test/grouperContainerUnitTestScim.sh index 0bdde3a9..20467d63 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestScim.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestScim.sh @@ -23,8 +23,8 @@ testContainerScim() { assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileNotExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" diff --git a/container_files/tier-support/test/grouperContainerUnitTestUi.sh b/container_files/tier-support/test/grouperContainerUnitTestUi.sh index eed5ef84..a731a646 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUi.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUi.sh @@ -23,8 +23,8 @@ testContainerUi() { assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" @@ -38,6 +38,8 @@ testContainerUi() { assertFileContains /etc/httpd/conf.d/ssl-enabled.conf cachain.pem assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf /etc/pki/tls/certs/localhost.crt + assertFileContains /opt/tomee/conf/Catalina/localhost/grouper.xml 'cookies="true"' + assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j.properties "/tmp/logpipe" assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j.properties "grouper-ui;" @@ -88,6 +90,8 @@ testContainerUi() { assertNotListeningOnPort 80 assertListeningOnPort 8009 assertNotListeningOnPort 9001 + assertListeningOnPort 8080 + #assertListeningOnPort 8005 } diff --git a/container_files/tier-support/test/grouperContainerUnitTestUiDifferentPorts.sh b/container_files/tier-support/test/grouperContainerUnitTestUiDifferentPorts.sh index 28f98614..7f67341e 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUiDifferentPorts.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUiDifferentPorts.sh @@ -12,17 +12,20 @@ testContainerUiDifferentPorts() { echo echo '################' echo Running container as ui with self signed cert with different ports - echo "docker run --detach --name $containerName --publish 443:443 -e GROUPER_APACHE_AJP_TIMEOUT_SECONDS=2999 -e GROUPER_SELF_SIGNED_CERT=true -e GROUPER_APACHE_SSL_PORT=444 -e GROUPER_APACHE_NONSSL_PORT=81 $imageName ui" + echo "docker run --detach --name $containerName --publish 443:443 -e GROUPER_APACHE_AJP_TIMEOUT_SECONDS=2999 -e GROUPER_SELF_SIGNED_CERT=true -e GROUPER_APACHE_SSL_PORT=444 -e GROUPER_APACHE_NONSSL_PORT=81 -e GROUPER_TOMCAT_HTTP_PORT=8600 -e GROUPER_TOMCAT_AJP_PORT=8601 -e GROUPER_TOMCAT_SHUTDOWN_PORT=8602 $imageName ui" echo '################' echo - docker run --detach --name $containerName --publish 443:443 -e GROUPER_APACHE_AJP_TIMEOUT_SECONDS=2999 -e GROUPER_SELF_SIGNED_CERT=true -e GROUPER_APACHE_SSL_PORT=444 -e GROUPER_APACHE_NONSSL_PORT=81 $imageName ui + docker run --detach --name $containerName --publish 443:443 -e GROUPER_APACHE_AJP_TIMEOUT_SECONDS=2999 -e GROUPER_SELF_SIGNED_CERT=true -e GROUPER_APACHE_SSL_PORT=444 -e GROUPER_APACHE_NONSSL_PORT=81 -e GROUPER_TOMCAT_HTTP_PORT=8600 -e GROUPER_TOMCAT_AJP_PORT=8601 -e GROUPER_TOMCAT_SHUTDOWN_PORT=8602 $imageName ui sleep $globalSleepSecondsAfterRun assertEnvVar GROUPER_APACHE_NONSSL_PORT "81" assertEnvVar GROUPER_APACHE_SSL_PORT "444" assertEnvVar GROUPER_APACHE_AJP_TIMEOUT_SECONDS "2999" + assertEnvVar GROUPER_TOMCAT_HTTP_PORT "8600" + assertEnvVar GROUPER_TOMCAT_AJP_PORT "8601" + assertEnvVar GROUPER_TOMCAT_SHUTDOWN_PORT "8602" assertFileContains /etc/httpd/conf.d/grouper-www.conf "2999" assertFileNotContains /etc/httpd/conf.d/grouper-www.conf "3600" @@ -43,7 +46,9 @@ testContainerUiDifferentPorts() { assertListeningOnPort 81 assertNotListeningOnPort 443 assertNotListeningOnPort 80 - assertListeningOnPort 8009 + assertListeningOnPort 8600 + assertListeningOnPort 8601 + #assertListeningOnPort 8602 assertNotListeningOnPort 9001 diff --git a/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh b/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh index 82e58052..84e9ecbe 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUiSubimage.sh @@ -37,8 +37,8 @@ testContainerUiSubimage() { assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" diff --git a/container_files/tier-support/test/grouperContainerUnitTestUiSubimageNonroot.sh b/container_files/tier-support/test/grouperContainerUnitTestUiSubimageNonroot.sh index 4ff2f451..a156cf0e 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestUiSubimageNonroot.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestUiSubimageNonroot.sh @@ -38,8 +38,8 @@ testContainerUiSubimageNonroot() { assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j.properties "/tmp/logpipe" assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j.properties "grouper-ui;" diff --git a/container_files/tier-support/test/grouperContainerUnitTestWs.sh b/container_files/tier-support/test/grouperContainerUnitTestWs.sh index 4b4e9b8f..ea1c9695 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestWs.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestWs.sh @@ -23,8 +23,8 @@ testContainerWs() { assertFileExists /opt/grouper/grouperWebapp/WEB-INF/lib/axis2-kernel-1.6.4.jar assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libScim/stax-api-1.0-2.jar assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/stax-api-1.0-2.jar - assertFileNotExists /opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-2.5.27.jar - assertFileExists /opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-2.5.27.jar + assertFileNotExists "/opt/grouper/grouperWebapp/WEB-INF/lib/grouper-messaging-activemq-$grouperVersion.jar" + assertFileExists "/opt/grouper/grouperWebapp/WEB-INF/libUiAndDaemon/grouper-messaging-activemq-$grouperVersion.jar" assertFileContains /etc/httpd/conf.d/ssl-enabled.conf "Listen 443 https" assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf "__" @@ -37,6 +37,8 @@ testContainerWs() { assertFileNotContains /etc/httpd/conf.d/ssl-enabled.conf cachain.pem assertFileContains /etc/httpd/conf.d/ssl-enabled.conf /etc/pki/tls/certs/localhost.crt + assertFileContains /opt/tomee/conf/Catalina/localhost/grouper-ws.xml 'cookies="false"' + assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j.properties "grouper-ws;" assertFileContains /etc/httpd/conf.d/grouper-www.conf "3600" diff --git a/container_files/tomee/conf/Catalina/localhost/grouper.xml b/container_files/tomee/conf/Catalina/localhost/grouper.xml index 46298e8f..66652991 100644 --- a/container_files/tomee/conf/Catalina/localhost/grouper.xml +++ b/container_files/tomee/conf/Catalina/localhost/grouper.xml @@ -1,3 +1,3 @@ - + diff --git a/container_files/usr-local-bin/libraryPrep.sh b/container_files/usr-local-bin/libraryPrep.sh index ca39bfbb..3addb031 100644 --- a/container_files/usr-local-bin/libraryPrep.sh +++ b/container_files/usr-local-bin/libraryPrep.sh @@ -156,7 +156,11 @@ prep_finishBegin() { if [ -z "$GROUPER_GSH_CHECK_USER" ] ; then export GROUPER_GSH_CHECK_USER=true; fi if [ -z "$GROUPER_GSH_USER" ] ; then export GROUPER_GSH_USER=tomcat; fi - if [ -z "$GROUPER_RUN_TOMCAT_NOT_SUPERVISOR" ]; then export GROUPER_RUN_TOMCAT_NOT_SUPERVISOR=false; fi + if [ -z "$GROUPER_RUN_TOMCAT_NOT_SUPERVISOR" ]; then export GROUPER_RUN_TOMCAT_NOT_SUPERVISOR=false; fi + + if [ -z "$GROUPER_TOMCAT_HTTP_PORT" ]; then export GROUPER_TOMCAT_HTTP_PORT=8080; fi + if [ -z "$GROUPER_TOMCAT_AJP_PORT" ]; then export GROUPER_TOMCAT_AJP_PORT=8009; fi + if [ -z "$GROUPER_TOMCAT_SHUTDOWN_PORT" ]; then export GROUPER_TOMCAT_SHUTDOWN_PORT=8005; fi } @@ -166,6 +170,7 @@ prep_finishEnd() { if [ -z "$GROUPER_TOMCAT_CONTEXT" ] ; then export GROUPER_TOMCAT_CONTEXT=grouper; fi if [ -z "$GROUPER_LOG_PREFIX" ]; then export GROUPER_LOG_PREFIX=grouper; fi if [ -z "$GROUPER_MAX_MEMORY" ]; then export GROUPER_MAX_MEMORY=1500m; fi + if [ -z "$GROUPER_CONTEXT_COOKIES" ]; then export GROUPER_CONTEXT_COOKIES=true; fi } diff --git a/container_files/usr-local-bin/librarySetupFilesTomcat.sh b/container_files/usr-local-bin/librarySetupFilesTomcat.sh index 48f31989..5fb657f8 100644 --- a/container_files/usr-local-bin/librarySetupFilesTomcat.sh +++ b/container_files/usr-local-bin/librarySetupFilesTomcat.sh @@ -5,6 +5,22 @@ setupFilesTomcat() { setupFilesTomcat_supervisor setupFilesTomcat_authn setupFilesTomcat_context + setupFilesTomcat_ports +} + +setupFilesTomcat_ports() { + + if [ "$GROUPER_TOMCAT_HTTP_PORT" != "8080" ]; then + sed -i "s|8080|$GROUPER_TOMCAT_HTTP_PORT|g" /opt/tomee/conf/server.xml + fi + + if [ "$GROUPER_TOMCAT_AJP_PORT" != "8009" ]; then + sed -i "s|8009|$GROUPER_TOMCAT_AJP_PORT|g" /opt/tomee/conf/server.xml + fi + + if [ "$GROUPER_TOMCAT_SHUTDOWN_PORT" != "8005" ]; then + sed -i "s|8005|$GROUPER_TOMCAT_SHUTDOWN_PORT|g" /opt/tomee/conf/server.xml + fi } setupFilesTomcat_context() { @@ -14,7 +30,7 @@ setupFilesTomcat_context() { # ws only and scim only dont have cookies if [ "$GROUPER_CONTEXT_COOKIES" = "false" ] then - sed -i "s|__GROUPER_CONTEXT_COOKIES__|cookies="false"|g" /opt/tomee/conf/Catalina/localhost/grouper.xml + sed -i "s|__GROUPER_CONTEXT_COOKIES__|$GROUPER_CONTEXT_COOKIES|g" /opt/tomee/conf/Catalina/localhost/grouper.xml else sed -i "s|__GROUPER_CONTEXT_COOKIES__||g" /opt/tomee/conf/Catalina/localhost/grouper.xml fi @@ -42,6 +58,10 @@ setupFilesTomcat_context() { sed -i "s|__GROUPER_PROXY_PASS__|$GROUPER_PROXY_PASS|g" /etc/httpd/conf.d/ssl-enabled.conf sed -i "s|__GROUPERSCIM_PROXY_PASS__|$GROUPERSCIM_PROXY_PASS|g" /etc/httpd/conf.d/grouper-www.conf sed -i "s|__GROUPERWS_PROXY_PASS__|$GROUPERWS_PROXY_PASS|g" /etc/httpd/conf.d/grouper-www.conf + if [ "$GROUPER_TOMCAT_AJP_PORT" != "8009" ]; then + sed -i "s|:8009/|:$GROUPER_TOMCAT_AJP_PORT/|g" /etc/httpd/conf.d/grouper-www.conf + fi + fi } @@ -81,6 +101,7 @@ setupFilesTomcat_unsetAll() { unset -f setupFilesTomcat_authn unset -f setupFilesTomcat_context unset -f setupFilesTomcat_logging + unset -f setupFilesTomcat_ports unset -f setupFilesTomcat_supervisor unset -f setupFilesTomcat_unsetAll @@ -92,6 +113,7 @@ setupFilesTomcat_exportAll() { export -f setupFilesTomcat_authn export -f setupFilesTomcat_context export -f setupFilesTomcat_logging + export -f setupFilesTomcat_ports export -f setupFilesTomcat_supervisor export -f setupFilesTomcat_unsetAll