This is an automated email from the ASF dual-hosted git repository. jungm pushed a commit to branch TOMEE-4167-security-3.0 in repository https://gitbox.apache.org/repos/asf/tomee-tck.git
commit a4566ffe0b215554e69e096bc1081acdb6650a63 Author: Markus Jung <ju...@apache.org> AuthorDate: Sat Sep 21 17:00:39 2024 +0200 scripts to execute new security TCK --- security/.gitignore | 2 + security/modifications/modify-pom.xslt | 35 ++++++++++++++ security/modifications/profile.xml | 88 ++++++++++++++++++++++++++++++++++ security/run-tck.sh | 21 ++++++++ security/setup-tck.sh | 29 +++++++++++ security/variables.sh | 18 +++++++ 6 files changed, 193 insertions(+) diff --git a/security/.gitignore b/security/.gitignore new file mode 100644 index 0000000..9e212ce --- /dev/null +++ b/security/.gitignore @@ -0,0 +1,2 @@ +jakarta-security-tck-*.zip +security-tck-*/ diff --git a/security/modifications/modify-pom.xslt b/security/modifications/modify-pom.xslt new file mode 100644 index 0000000..c1eda13 --- /dev/null +++ b/security/modifications/modify-pom.xslt @@ -0,0 +1,35 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:pom="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <xsl:output method="xml" indent="yes"/> + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="pom:profiles/pom:profile[pom:id='tomee']"> + <xsl:copy-of select="document('profile.xml')/*[not(self::comment())]"/> <!-- ignore comments to avoid incorrectly formatted xml --> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file diff --git a/security/modifications/profile.xml b/security/modifications/profile.xml new file mode 100644 index 0000000..efb6bf8 --- /dev/null +++ b/security/modifications/profile.xml @@ -0,0 +1,88 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<profile xmlns="http://maven.apache.org/POM/4.0.0"> + <id>tomee</id> + + <properties> + <glassfish.root>${project.build.directory}</glassfish.root> + </properties> + + <repositories> + <repository> + <id>apache.snapshots</id> + <url>https://repository.apache.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>apache-tomee</artifactId> + <version>${tomee.version}</version> + <type>zip</type> + <classifier>webprofile</classifier> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>arquillian-tomee-remote</artifactId> + <version>${tomee.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <argLine>-DTOMEE_LOCK_FILE=${user.dir}/.tomee-ports.lock</argLine> + <systemPropertyVariables> + <tomee.stopPort>-1</tomee.stopPort> + <tomee.httpPort>8080</tomee.httpPort> <!-- 8080 is hardcoded in openid tests --> + <tomee.httpsPort>-1</tomee.httpsPort> + <tomee.ajpPort>-1</tomee.ajpPort> + + <tomee.dir>target/tomee/server</tomee.dir> + <tomee.appWorkingDir>target/tomee/arquillian</tomee.appWorkingDir> + <tomee.cleanOnStartUp>true</tomee.cleanOnStartUp> + <tomee.classifier>webprofile</tomee.classifier> + + <!-- SSL configuration for app-openid2/app-openid3, + these tests work by deploying an openid server in a separate tomcat installation + with SSL configured using a custom certificate in a custom trustStore. + To properly run these test we need to add the trustStore to both: + - the current process that executes the tests (and will visit openid-server login page) + - tomee that invokes the deployed openid-server app --> + <javax.net.ssl.trustStore>${glassfish.root}/glassfish7/glassfish/domains/domain1/config/cacerts.jks</javax.net.ssl.trustStore> + <javax.net.ssl.trustStorePassword>changeit</javax.net.ssl.trustStorePassword> + <tomee.catalina_opts>-Djavax.net.ssl.trustStore=${glassfish.root}/glassfish7/glassfish/domains/domain1/config/cacerts.jks -Djavax.net.ssl.trustStorePassword=changeit</tomee.catalina_opts> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> +</profile> diff --git a/security/run-tck.sh b/security/run-tck.sh new file mode 100755 index 0000000..4a4c0ca --- /dev/null +++ b/security/run-tck.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +. variables.sh + +echo "Executing new TCK" +cd security-tck-$TCK_VERSION/tck +mvn clean install -pl '!old-tck,!old-tck/build,!old-tck/run' -Ptomee --fail-at-end -Dtomee.version="$TOMEE_VERSION" diff --git a/security/setup-tck.sh b/security/setup-tck.sh new file mode 100755 index 0000000..c211b05 --- /dev/null +++ b/security/setup-tck.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +. variables.sh + +# First clean up old TCK installations +rm -rf jakarta-security-tck*.zip security-tck-* + +# Download TCK, unpack and cd into it +curl -O https://download.eclipse.org/jakartaee/security/3.0/jakarta-security-tck-$TCK_VERSION.zip +unzip jakarta-security-tck-$TCK_VERSION.zip +cd security-tck-$TCK_VERSION/tck + +# Patch pom.xml with tomee profile +mv pom.xml pom.xml.original +xsltproc --output pom.xml ../../modifications/modify-pom.xslt pom.xml.original diff --git a/security/variables.sh b/security/variables.sh new file mode 100644 index 0000000..d80d648 --- /dev/null +++ b/security/variables.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TCK_VERSION=3.0.2 +TOMEE_VERSION=10.0.0-M3-SNAPSHOT