Skip to content

Commit be9e76d

Browse files
committed
[OPENJDK-2824] Test binary-s2i on a non-owned directory
Add a test which ensures s2i binary-build works with a destination directory not owned by UID 185 (/var/tmp), which means the running process does not have permission to change its timestamps, simulating a random UID and the permissions on /deployments. Signed-off-by: Jonathan Dowland <[email protected]>
1 parent 682cb1e commit be9e76d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

modules/s2i/core/api/tests/features/s2i-core.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,14 @@ Feature: Openshift S2I tests
77
Scenario: run an s2i build and check that /tmp/src has been removed afterwards
88
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple
99
Then run stat /tmp/src in container and immediately check its output does not contain File:
10+
11+
# OPENJDK-2824 - ensure binary-only s2i doesn't try to change timestamps of
12+
# S2I_TARGET_DEPLOYMENTS_DIR. Use /var/tmp as a directory where attempting to
13+
# will fail. This simulates the s2i process running as a random UID, which can't
14+
# change timestamps on the default directory, /deployments.
15+
Scenario: Ensure binary-only build doesn't fail trying to set timestamp of S2I_TARGET_DEPLOYMENTS_DIR (OPENJDK-2850)
16+
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-2408-bin-custom-s2i-assemble with env
17+
| variable | value |
18+
| S2I_TARGET_DEPLOYMENTS_DIR | /var/tmp |
19+
Then s2i build log should not contain rsync: [generator] failed to set permissions on "/var/tmp/.": Operation not permitted
20+
And run stat /var/tmp/spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar in container and check its output for Access:

0 commit comments

Comments
 (0)