Skip to content

Commit 7d5f6a0

Browse files
Migrate tests to the very latest httpd docker image to unbreak tests.
Indeed since Docker 26 the image in the old v1 format are no longer run by default (it used to be deprecated but tolerated for years). Fix this by hardcoding the very latest httpd docker image version as of today.
1 parent dc3cf13 commit 7d5f6a0

17 files changed

+26
-26
lines changed

src/test/java/org/jenkinsci/plugins/docker/workflow/DockerDSLTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
113113
assumeDocker();
114114
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
115115
p.setDefinition(new CpsFlowDefinition(
116-
"def r = docker.image('httpd:2.4.12').inside {\n" +
116+
"def r = docker.image('httpd:2.4.59').inside {\n" +
117117
" semaphore 'wait'\n" +
118118
" sh 'cat /usr/local/apache2/conf/extra/httpd-userdir.conf'\n" +
119119
" 42\n" +
@@ -185,7 +185,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
185185
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
186186
p.setDefinition(new CpsFlowDefinition(
187187
"node {\n" +
188-
" def img = docker.image('httpd:2.4.12')\n" +
188+
" def img = docker.image('httpd:2.4.59')\n" +
189189
" img.run().stop()\n" +
190190
" img.run('--memory-swap=-1').stop()\n" +
191191
" img.withRun {}\n" +
@@ -204,7 +204,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
204204
assumeDocker();
205205
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
206206
p.setDefinition(new CpsFlowDefinition(
207-
"def r = docker.image('httpd:2.4.12').withRun {c ->\n" +
207+
"def r = docker.image('httpd:2.4.59').withRun {c ->\n" +
208208
" semaphore 'wait'\n" +
209209
" sh \"docker exec ${c.id} cat /usr/local/apache2/conf/extra/httpd-userdir.conf\"\n" +
210210
" 42\n" +
@@ -346,7 +346,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
346346
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
347347
p.setDefinition(new CpsFlowDefinition(
348348
"docker.withTool('default') {\n" +
349-
" docker.image('httpd:2.4.12').withRun {}\n" +
349+
" docker.image('httpd:2.4.59').withRun {}\n" +
350350
" sh 'echo PATH=$PATH'\n" +
351351
"}", true));
352352
story.j.assertLogContains("PATH=/usr/bin:", story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)));
@@ -437,7 +437,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
437437
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
438438
p.setDefinition(new CpsFlowDefinition(
439439
"node {\n" +
440-
" def img = docker.image('httpd:2.4.12')\n" +
440+
" def img = docker.image('httpd:2.4.59')\n" +
441441
" def port = img.withRun('-p 12345:80') { c -> c.port(80) }\n" +
442442
" echo \"container running on ${port}\"" +
443443
"}", true));

src/test/java/org/jenkinsci/plugins/docker/workflow/WithContainerStepTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class WithContainerStepTest {
111111
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
112112
p.setDefinition(new CpsFlowDefinition(
113113
"node {\n" +
114-
" withDockerContainer('httpd:2.4.12') {\n" +
114+
" withDockerContainer('httpd:2.4.59') {\n" +
115115
" sh 'cp /usr/local/apache2/conf/extra/httpd-userdir.conf .; ls -la'\n" +
116116
" }\n" +
117117
" sh 'ls -la; cat *.conf'\n" +
@@ -135,7 +135,7 @@ public class WithContainerStepTest {
135135
p.setDefinition(new CpsFlowDefinition(
136136
"node {\n" +
137137
" timeout(time: 20, unit: 'SECONDS') {\n" +
138-
" withDockerContainer('httpd:2.4.12') {\n" +
138+
" withDockerContainer('httpd:2.4.59') {\n" +
139139
" sh 'sleep infinity'\n" +
140140
" }\n" +
141141
" }\n" +
@@ -215,7 +215,7 @@ public class WithContainerStepTest {
215215
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
216216
p.setDefinition(new CpsFlowDefinition(
217217
"node {\n" +
218-
" withDockerContainer('httpd:2.4.12') {\n" +
218+
" withDockerContainer('httpd:2.4.59') {\n" +
219219
" semaphore 'wait'\n" +
220220
" sh 'cat /usr/local/apache2/conf/extra/httpd-userdir.conf'\n" +
221221
" }\n" +
@@ -481,7 +481,7 @@ private static final class Execution extends SynchronousNonBlockingStepExecution
481481
p.setDefinition(new CpsFlowDefinition(
482482
"node('dockerized') {\n" +
483483
" sh 'which docker && docker version'\n" +
484-
" withDockerContainer('httpd:2.4.12') {\n" +
484+
" withDockerContainer('httpd:2.4.59') {\n" +
485485
" sh 'cp /usr/local/apache2/conf/extra/httpd-userdir.conf .; ls -la'\n" +
486486
" }\n" +
487487
" sh 'ls -la; cat *.conf'\n" +

src/test/java/org/jenkinsci/plugins/docker/workflow/client/WindowsDockerClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void test_run() throws IOException, InterruptedException {
3232
EnvVars launchEnv = DockerTestUtil.newDockerLaunchEnv();
3333
String containerId = dockerClient.run(
3434
launchEnv,
35-
"learn/tutorial",
35+
"busybox",
3636
null,
3737
null,
3838
Collections.emptyMap(),
@@ -43,7 +43,7 @@ public void test_run() throws IOException, InterruptedException {
4343

4444
Assert.assertEquals(64, containerId.length());
4545
ContainerRecord containerRecord = dockerClient.getContainerRecord(launchEnv, containerId);
46-
Assert.assertEquals(dockerClient.inspect(launchEnv, "learn/tutorial", ".Id"), containerRecord.getImageId());
46+
Assert.assertEquals(dockerClient.inspect(launchEnv, "busybox", ".Id"), containerRecord.getImageId());
4747
Assert.assertTrue(containerRecord.getContainerName().length() > 0);
4848
Assert.assertTrue(containerRecord.getHost().length() > 0);
4949
Assert.assertTrue(containerRecord.getCreated() > 1000000000000L);

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDocker.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpd:2.4.12"
28+
image "httpd:2.4.59"
2929
args "-v /tmp:/tmp"
3030
}
3131
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDocker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"key": "image",
3535
"value": {
3636
"isLiteral": true,
37-
"value": "httpd:2.4.12"
37+
"value": "httpd:2.4.59"
3838
}
3939
},
4040
{

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerContainerPerStage.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpd:2.4.12"
28+
image "httpd:2.4.59"
2929
label "docker"
3030
}
3131
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerDontReuseNode.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pipeline {
4040
agent {
4141
docker {
4242
label "other-docker"
43-
image "httpd:2.4.12"
43+
image "httpd:2.4.59"
4444
reuseNode true
4545
}
4646
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerEnvSpecLabel.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pipeline {
3030
agent {
3131
docker {
3232
label "thisspec"
33-
image "httpd:2.4.12"
33+
image "httpd:2.4.59"
3434
args "-v /tmp:/tmp"
3535
}
3636
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerEnvTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
pipeline {
3030
agent {
3131
docker {
32-
image "httpd:2.4.12"
32+
image "httpd:2.4.59"
3333
args "-v /tmp:/tmp"
3434
}
3535
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerReuseNode.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pipeline {
3737
stage("bar") {
3838
agent {
3939
docker {
40-
image "httpd:2.4.12"
40+
image "httpd:2.4.59"
4141
reuseNode true
4242
}
4343
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerWithCreds.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pipeline {
2727
docker {
2828
alwaysPull true
2929
registryCredentialsId "dockerhub"
30-
image "jtaboada/httpd:2.4.12"
30+
image "jtaboada/httpd:2.4.59"
3131
args "-v /tmp:/tmp"
3232
}
3333
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerWithEmptyDockerArgs.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpd:2.4.12"
28+
image "httpd:2.4.59"
2929
args ""
3030
}
3131
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerWithNullDockerArgs.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpd:2.4.12"
28+
image "httpd:2.4.59"
2929
args null
3030
}
3131
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerWithRegistryNoCreds.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pipeline {
2626
agent {
2727
docker {
2828
alwaysPull true
29-
image "httpd:2.4.12"
29+
image "httpd:2.4.59"
3030
registryUrl "https://index.docker.io/v2/"
3131
args "-v /tmp:/tmp"
3232
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentDockerWithoutContainerPerStage.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpd:2.4.12"
28+
image "httpd:2.4.59"
2929
label "docker"
3030
}
3131
}

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/agentInStageAutoCheckout.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pipeline {
3737
stage("bar") {
3838
agent {
3939
docker {
40-
image "httpd:2.4.12"
40+
image "httpd:2.4.59"
4141
reuseNode true
4242
}
4343
}
@@ -50,7 +50,7 @@ pipeline {
5050
stage("new node - docker") {
5151
agent {
5252
docker {
53-
image "httpd:2.4.12"
53+
image "httpd:2.4.59"
5454
}
5555
}
5656
steps {

src/test/resources/org/jenkinsci/plugins/docker/workflow/declarative/nonExistentDockerImage.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
pipeline {
2626
agent {
2727
docker {
28-
image "httpdIDontExist:2.4.12"
28+
image "httpdIDontExist:2.4.59"
2929
args "-v /tmp:/tmp"
3030
}
3131
}

0 commit comments

Comments
 (0)