Skip to content

Commit 37f9fd6

Browse files
authored
Merge pull request #2771 from jglick/imageWithoutAgentNoJava
Adapt `KubernetesPipelineTest.imageWithoutAgentNoJava` to launcher scripts requiring Bash
2 parents bb33d9e + 02d0d6c commit 37f9fd6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
package org.csanchez.jenkins.plugins.kubernetes.pipeline;
2626

27+
import static jenkins.test.RunMatchers.logContains;
2728
import static org.awaitility.Awaitility.await;
2829
import static org.csanchez.jenkins.plugins.kubernetes.KubernetesTestUtil.CONTAINER_ENV_VAR_FROM_SECRET_VALUE;
2930
import static org.csanchez.jenkins.plugins.kubernetes.KubernetesTestUtil.POD_ENV_VAR_FROM_SECRET_VALUE;
@@ -32,6 +33,7 @@
3233
import static org.csanchez.jenkins.plugins.kubernetes.KubernetesTestUtil.deletePods;
3334
import static org.csanchez.jenkins.plugins.kubernetes.KubernetesTestUtil.getLabels;
3435
import static org.hamcrest.MatcherAssert.assertThat;
36+
import static org.hamcrest.Matchers.anyOf;
3537
import static org.hamcrest.Matchers.empty;
3638
import static org.hamcrest.Matchers.emptyIterable;
3739
import static org.hamcrest.Matchers.equalTo;
@@ -967,6 +969,8 @@ public void imageWithoutAgent() throws Exception {
967969
@Test
968970
public void imageWithoutAgentNoJava() throws Exception {
969971
r.assertBuildStatus(Result.ABORTED, r.waitForCompletion(b));
970-
r.assertLogContains("java: not found", b);
972+
// Fails with older launcher scripts due to missing Java.
973+
// But Busybox also lacks Bash, used in newer scripts.
974+
assertThat(b, anyOf(logContains("java: not found"), logContains("can't execute 'bash'")));
971975
}
972976
}

0 commit comments

Comments
 (0)