diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java index 42e24b2030..ac210d07d8 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java @@ -5,7 +5,6 @@ import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.is; import static org.hamcrest.io.FileMatchers.anExistingFile; -import static org.jenkinsci.plugins.gitclient.verifier.KnownHostsTestUtil.isKubernetesCI; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -54,9 +53,6 @@ public void testVerifyHostKeyOption() throws IOException { @Test public void testVerifyServerHostKeyWhenFirstConnection() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } File file = new File(testFolder.getRoot() + "path/to/file"); AcceptFirstConnectionVerifier acceptFirstConnectionVerifier = spy(new AcceptFirstConnectionVerifier()); when(acceptFirstConnectionVerifier.getKnownHostsFile()).thenReturn(file); @@ -81,9 +77,6 @@ public void testVerifyServerHostKeyWhenFirstConnection() throws Exception { @Test public void testVerifyServerHostKeyWhenSecondConnectionWithEqualKeys() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String hostKeyEntry = "|1|FJGXVAi7jMQIsl1J6uE6KnCiteM=|xlH92KQ91GuBgRxvRbU/sBo60Bo= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; @@ -112,9 +105,6 @@ public void testVerifyServerHostKeyWhenSecondConnectionWithEqualKeys() throws Ex @Test public void testVerifyServerHostKeyWhenHostnameWithoutPort() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String hostKeyEntry = "github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; File mockedKnownHosts = knownHostsTestUtil.createFakeKnownHosts(hostKeyEntry); @@ -138,9 +128,6 @@ public void testVerifyServerHostKeyWhenHostnameWithoutPort() throws Exception { @Test public void testVerifyServerHostKeyWhenSecondConnectionWhenNotDefaultAlgorithm() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String fileContent = """ github.com,140.82.121.4\ @@ -201,9 +188,6 @@ public void testVerifyServerHostKeyWhenSecondConnectionWithNonEqualKeys() throws @Test public void testVerifyServerHostKeyWhenConnectionWithAnotherHost() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String bitbucketFileContent = """ |1|HnmPCP38pBhCY0NUtBXSraOg9pM=|L6YZ9asEeb2xplTDEThGOxRq7ZY=\ @@ -236,9 +220,6 @@ public void testVerifyServerHostKeyWhenConnectionWithAnotherHost() throws Except @Test public void testVerifyServerHostKeyWhenHostnamePortProvided() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String fileContent = """ |1|6uMj3M7sLgZpn54vQbGqgPNTCVM=|OkV9Lu9REJZR5QCVrITAIY34I1M=\ diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java index d0ed1e3aa3..27fcaccc04 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java @@ -68,9 +68,6 @@ public void connectWhenHostKeyNotInKnownHostsFileForOtherHostNameThenShouldFail( @Test public void connectWhenHostKeyProvidedThenShouldNotFail() throws IOException { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } KnownHostsFileVerifier knownHostsFileVerifier = spy(new KnownHostsFileVerifier()); when(knownHostsFileVerifier.getKnownHostsFile()).thenReturn(fakeKnownHosts); @@ -91,9 +88,6 @@ public void connectWhenHostKeyProvidedThenShouldNotFail() throws IOException { @Test public void connectWhenHostKeyInKnownHostsFileWithNotDefaultAlgorithmThenShouldNotFail() throws IOException { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } fakeKnownHosts = knownHostsTestUtil.createFakeKnownHosts( "fake2.ssh", "known_hosts_fake2", diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifierTest.java index d818d1216e..5889921914 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifierTest.java @@ -60,9 +60,6 @@ public void connectWhenHostKeyProvidedForOtherHostNameThenShouldFail() throws Ex @Test public void connectWhenHostKeyProvidedThenShouldNotFail() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } ManuallyProvidedKeyVerifier verifier = new ManuallyProvidedKeyVerifier(hostKey); ManuallyProvidedKeyVerifier.ManuallyProvidedKeyJGitHostKeyVerifier jGitHostKeyVerifier = (ManuallyProvidedKeyVerifier.ManuallyProvidedKeyJGitHostKeyVerifier) @@ -100,9 +97,6 @@ public void connectWhenWrongHostKeyProvidedThenShouldFail() throws Exception { @Test public void connectWhenHostKeyProvidedWithPortThenShouldNotFail() throws Exception { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } String key = "github.com:22 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; HostKeyVerifierFactory verifier = new ManuallyProvidedKeyVerifier(key); diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java index 3cb2e8ba68..f8906ffe82 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java @@ -2,7 +2,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import static org.jenkinsci.plugins.gitclient.verifier.KnownHostsTestUtil.isKubernetesCI; import hudson.model.StreamBuildListener; import hudson.model.TaskListener; @@ -24,10 +23,6 @@ public void assignVerifier() { @Test public void verifyServerHostKey() throws IOException { - if (isKubernetesCI()) { - return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents - } - NoHostKeyVerifier acceptFirstConnectionVerifier = new NoHostKeyVerifier(); KnownHostsTestUtil.connectToHost(