Fix FIPS tests

This commit is contained in:
Martin Bartoš 2023-04-19 17:38:35 +02:00 committed by Václav Muzikář
parent c1cced9f31
commit 8d5a4f2677
2 changed files with 10 additions and 2 deletions

View file

@ -15,4 +15,6 @@ TESTS=`testsuite/integration-arquillian/tests/base/testsuites/suite.sh fips`
echo "Tests: $TESTS"
export JAVA_HOME=/etc/alternatives/java_sdk_17
set -o pipefail
./mvnw test -Dsurefire.rerunFailingTestsCount=$SUREFIRE_RERUN_FAILING_COUNT -nsu -B -Pauth-server-quarkus,auth-server-fips140-2 -Dcom.redhat.fips=false $STRICT_OPTIONS -Dtest=$TESTS -pl testsuite/integration-arquillian/tests/base | misc/log/trimmer.sh
# Profile app-server-wildfly needs to be explicitly set for FIPS tests
./mvnw test -Dsurefire.rerunFailingTestsCount=$SUREFIRE_RERUN_FAILING_COUNT -nsu -B -Pauth-server-quarkus,auth-server-fips140-2,app-server-wildfly -Dcom.redhat.fips=false $STRICT_OPTIONS -Dtest=$TESTS -pl testsuite/integration-arquillian/tests/base | misc/log/trimmer.sh

View file

@ -268,13 +268,19 @@ public class AppServerTestEnricher {
* For Fuse: precedence = 2 - app server has to be stopped
* before AuthServerTestEnricher.afterClass is executed
*/
public void stopAppServer(@Observes(precedence = 2) AfterClass event) {
public void stopAppServer(@Observes(precedence = 2) AfterClass event) throws IOException {
if (testContext.getAppServerInfo() == null) {
return; // no adapter test
}
ContainerController controller = containerConrollerInstance.get();
// remove tmp folder for JBoss based app servers for proper clean-up
if (isJBossBased()) {
final File tmpFolder = Paths.get(System.getProperty("app.server.home"), "standalone-test", "tmp").toFile();
FileUtils.deleteDirectory(tmpFolder);
}
if (controller.isStarted(testContext.getAppServerInfo().getQualifier())) {
log.info("Stopping app server: " + testContext.getAppServerInfo().getQualifier());
controller.stop(testContext.getAppServerInfo().getQualifier());