Skip to content

Commit 2d535cc

Browse files
Disable flaky SSH tests on Windows
1 parent 35d28b6 commit 2d535cc

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

itests/test/src/test/java/org/apache/karaf/itests/ssh/BundleSshCommandSecurityTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
package org.apache.karaf.itests.ssh;
1515

16+
import org.junit.Assume;
1617
import org.junit.Test;
1718
import org.junit.runner.RunWith;
1819
import org.ops4j.pax.exam.junit.PaxExam;
@@ -32,6 +33,11 @@ public class BundleSshCommandSecurityTest extends SshCommandTestBase {
3233

3334
@Test
3435
public void testBundleCommandSecurityViaSsh() throws Exception {
36+
// Skip on Windows where PTY output can be garbled,
37+
// when upgrading to Junit5, this can be replaced with @DisabledOnOs(OS.WINDOWS)
38+
// TODO: remove this once we have a better solution for PTY output on Windows
39+
Assume.assumeFalse(System.getProperty("os.name", "").toLowerCase().contains("win"));
40+
3541
String manageruser = "man" + System.nanoTime() + "_" + counter++;
3642
String vieweruser = "view" + System.nanoTime() + "_" + counter++;
3743

itests/test/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
package org.apache.karaf.itests.ssh;
1515

16+
import org.junit.Assume;
1617
import org.junit.Test;
1718
import org.junit.runner.RunWith;
1819
import org.ops4j.pax.exam.junit.PaxExam;
@@ -33,6 +34,10 @@ public class ConfigSshCommandSecurityTest extends SshCommandTestBase {
3334

3435
@Test
3536
public void testConfigCommandSecurityViaSsh() throws Exception {
37+
// Skip on Windows where PTY output can be garbled,
38+
// when upgrading to Junit5, this can be replaced with @DisabledOnOs(OS.WINDOWS)
39+
// TODO: remove this once we have a better solution for PTY output on Windows
40+
Assume.assumeFalse(System.getProperty("os.name", "").toLowerCase().contains("win"));
3641
String manageruser = "man" + System.nanoTime() + "_" + counter++;
3742
String vieweruser = "view" + System.nanoTime() + "_" + counter++;
3843

@@ -90,6 +95,11 @@ private void testConfigEdits(String user, Result expectedEditResult, String pid,
9095

9196
@Test
9297
public void testConfigCommandSecurityWithoutEditSessionViaSsh() throws Exception {
98+
// Skip on Windows where PTY output can be garbled,
99+
// when upgrading to Junit5, this can be replaced with @DisabledOnOs(OS.WINDOWS)
100+
// TODO: remove this once we have a better solution for PTY output on Windows
101+
Assume.assumeFalse(System.getProperty("os.name", "").toLowerCase().contains("win"));
102+
93103
String manageruser = "man" + System.nanoTime() + "_" + counter++;
94104
String vieweruser = "view" + System.nanoTime() + "_" + counter++;
95105

itests/test/src/test/java/org/apache/karaf/itests/ssh/SystemCommandSecurityTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package org.apache.karaf.itests.ssh;
1515

1616
import org.junit.Assert;
17+
import org.junit.Assume;
1718
import org.junit.Test;
1819
import org.junit.runner.RunWith;
1920
import org.ops4j.pax.exam.junit.PaxExam;
@@ -31,6 +32,11 @@ public class SystemCommandSecurityTest extends SshCommandTestBase {
3132

3233
@Test
3334
public void testSystemCommandSecurityViaSsh() throws Exception {
35+
// Skip on Windows where PTY output can be garbled,
36+
// when upgrading to Junit5, this can be replaced with @DisabledOnOs(OS.WINDOWS)
37+
// TODO: remove this once we have a better solution for PTY output on Windows
38+
Assume.assumeFalse(System.getProperty("os.name", "").toLowerCase().contains("win"));
39+
3440
String manageruser = "man" + System.nanoTime() + "_" + counter++;
3541
String vieweruser = "view" + System.nanoTime() + "_" + counter++;
3642

0 commit comments

Comments
 (0)