Skip to content

Commit 7bf1934

Browse files
committed
[OPENJDK-2850] 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 d9035d2 commit 7bf1934

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

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