Skip to content

Commit

Permalink
Merge pull request #465 from jhuttana/ubi8-runtime-feature
Browse files Browse the repository at this point in the history
[OPENJDK-2722] Split the tests inside tests/features/java/runtime.feature to couple them with appropriate modules
  • Loading branch information
jmtd authored Mar 19, 2024
2 parents 1c3b4ad + a8ac991 commit 3f8c03b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 46 deletions.
19 changes: 19 additions & 0 deletions modules/jvm/api/tests/features/runtime.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@ubi8/openjdk-8
@ubi8/openjdk-11
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: OpenJDK Runtime tests

@ubi8
Scenario: Check JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage

@ubi8
Scenario: Check empty JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | |
Then container log should not contain -XX:MaxRAMPercentage
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,13 @@
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: Openshift OpenJDK Runtime tests
Scenario: Ensure JVM_ARGS is no longer present in the run script
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then file /usr/local/s2i/run should not contain JVM_ARGS

Scenario: Ensure JAVA_ARGS are passed through to the running java application
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test

Scenario: Ensure diagnostic options work correctly
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
And container log should contain -XX:NativeMemoryTracking=summary

@ubi8
Scenario: OPENJDK-474 to ensure JAVA_ARGS is not duplicated in the java command line
Given container is started with env
| variable | value |
| JAVA_ARGS | unique |
Then container log should not contain unique unique

@ubi8
Scenario: Check JAVA_APP_NAME can contain spaces (OPENJDK-104)
Given container is started with env
| variable | value |
| JAVA_APP_NAME | foo bar |
Then container log should not contain exec: bar': not found

@ubi8
Scenario: Check JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage

@ubi8
Scenario: Check empty JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | |
Then container log should not contain -XX:MaxRAMPercentage

Scenario: JAVA_OPTIONS sets JAVA_OPTS and overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTIONS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage
And container log should contain --show-version

@ubi8
Scenario: Check default JAVA_APP_DIR (OPENJDK-2033)
When container is ready
Expand All @@ -81,3 +35,27 @@ Feature: Openshift OpenJDK Runtime tests
| variable | value |
| JAVA_APP_DIR | /nope |
Then available container log should contain ERROR No directory /nope found for auto detection
Scenario: Ensure JVM_ARGS is no longer present in the run script
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then file /usr/local/s2i/run should not contain JVM_ARGS

Scenario: Ensure JAVA_ARGS are passed through to the running java application
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test

Scenario: Ensure diagnostic options work correctly
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
And container log should contain -XX:NativeMemoryTracking=summary

@ubi8
Scenario: OPENJDK-474 to ensure JAVA_ARGS is not duplicated in the java command line
Given container is started with env
| variable | value |
| JAVA_ARGS | unique |
Then container log should not contain unique unique
12 changes: 12 additions & 0 deletions modules/s2i/bash/tests/features/java.s2i.runtime.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ubi8/openjdk-8
@ubi8/openjdk-11
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: OpenJDK JAVA s2i Runtime tests

Scenario: JAVA_OPTIONS sets JAVA_OPTS and overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTIONS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage
And container log should contain --show-version

0 comments on commit 3f8c03b

Please sign in to comment.