Skip to content

Commit

Permalink
test: vsock: Suppress timeout exceptions seen on unconfigured systems
Browse files Browse the repository at this point in the history
Seen on S390x Linux emulation.
  • Loading branch information
kohlschuetter committed Feb 14, 2024
1 parent ed0488b commit dbd9019
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
*/
package org.newsclub.net.unix.vsock;

import java.net.SocketTimeoutException;

import org.junit.jupiter.api.Test;
import org.newsclub.net.unix.AFSocketCapability;
import org.newsclub.net.unix.AFSocketCapabilityRequirement;
import org.newsclub.net.unix.AFVSOCKSocketAddress;

import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException;
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException.MessageType;

@AFSocketCapabilityRequirement(AFSocketCapability.CAPABILITY_VSOCK)
@SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS")
Expand All @@ -31,4 +36,17 @@ public final class CancelAcceptTest extends
public CancelAcceptTest() {
super(AFVSOCKAddressSpecifics.INSTANCE);
}

@Test
@Override
public void issue6test1() throws Exception {
try {
super.issue6test1();
} catch (SocketTimeoutException e) {
throw new TestAbortedWithImportantMessageException(
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
*/
package org.newsclub.net.unix.vsock;

import java.net.SocketTimeoutException;

import org.junit.jupiter.api.Test;
import org.newsclub.net.unix.AFSocketCapability;
import org.newsclub.net.unix.AFSocketCapabilityRequirement;
import org.newsclub.net.unix.AFVSOCKSocketAddress;

import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException;
import com.kohlschutter.testutil.TestAbortedWithImportantMessageException.MessageType;

@AFSocketCapabilityRequirement(AFSocketCapability.CAPABILITY_VSOCK)
@SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS")
Expand All @@ -31,4 +36,30 @@ public final class TcpNoDelayTest extends
public TcpNoDelayTest() {
super(AFVSOCKAddressSpecifics.INSTANCE);
}

@Test
@Override
public void testStrictImpl() throws Exception {
try {
super.testStrictImpl();
} catch (SocketTimeoutException e) {
throw new TestAbortedWithImportantMessageException(
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
e);
}
}

@Test
@Override
public void testDefaultImpl() throws Exception {
try {
super.testDefaultImpl();
} catch (SocketTimeoutException e) {
throw new TestAbortedWithImportantMessageException(
MessageType.TEST_ABORTED_SHORT_INFORMATIONAL,
"Environment may not be configured for VSOCK. More information at https://kohlschutter.github.io/junixsocket/junixsocket-vsock/",
e);
}
}
}

0 comments on commit dbd9019

Please sign in to comment.