Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/jvm/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

# OPENJDK-3695: force +x for scripts
chmod 0755 /opt/jboss/container/java/jvm/*
3 changes: 3 additions & 0 deletions modules/jvm/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ artifacts:
- path: artifacts/jvm
dest: /opt/jboss/container/java/jvm

execute:
- script: configure.sh

modules:
install:
- name: jboss.container.user
Expand Down
9 changes: 9 additions & 0 deletions modules/jvm/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: test file properties for JVM module

@ubi9
Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
Then available container log should contain /opt/jboss/container/java/jvm/debug-options -rwxr-xr-x
And available container log should contain /opt/jboss/container/java/jvm/java-default-options -rwxr-xr-x
5 changes: 5 additions & 0 deletions modules/maven/s2i/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

# OPENJDK-3695: force +x for scripts
chmod 0755 /usr/libexec/s2i/save-artifacts
3 changes: 3 additions & 0 deletions modules/maven/s2i/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ modules:
- name: jboss.container.maven.default
- name: jboss.container.util.logging

execute:
- script: configure.sh

packages:
install:
- tar
Expand Down
10 changes: 10 additions & 0 deletions modules/maven/s2i/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: test file properties for Maven S2I module

# builder-only test
@ubi9/openjdk-17
@ubi9/openjdk-21
Scenario: Ensure save-artifacts script is executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /usr/local/s2i -type f -printf "%f %M\n" |
Then available container log should contain save-artifacts -rwxr-xr-x
3 changes: 3 additions & 0 deletions modules/run/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ else
javasecurity="${JAVA_HOME}/conf/security/java.security"
fi
sed -i 's/\(networkaddress.cache.negative.ttl\)=[0-9]\+$/\1=0/' "$javasecurity"

# OPENJDK-3695: force +x for scripts
chmod 0755 /opt/jboss/container/java/run/run-java.sh
5 changes: 5 additions & 0 deletions modules/run/tests/features/run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ Feature: OpenJDK run script tests
| JAVA_OPTS_APPEND | -Djavax.net.ssl.trustStorePassword=sensitiveString |
Then container log should not contain sensitiveString

Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
Then available container log should contain /opt/jboss/container/java/run/run-java.sh -rwxr-xr-x
5 changes: 5 additions & 0 deletions modules/s2i/bash/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

# OPENJDK-3695: force +x for scripts
chmod 0755 /usr/local/s2i/{assemble,run,usage}
3 changes: 3 additions & 0 deletions modules/s2i/bash/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ artifacts:
dest: /usr/local/s2i
- path: artifacts/opt
dest: /opt/jboss/container/java/s2i

execute:
- script: configure.sh
12 changes: 12 additions & 0 deletions modules/s2i/bash/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# builder-only test
@ubi9/openjdk-17
@ubi9/openjdk-21
Feature: OpenJDK S2I bash module tests

Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /usr/local/s2i/ -type f -printf "%h/%f %M\n" |
Then available container log should contain run -rwxr-xr-x
And available container log should contain assemble -rwxr-xr-x
And available container log should contain usage -rwxr-xr-x
Loading