aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-10-07 20:04:05 +0000
committerEd Maste <emaste@FreeBSD.org>2024-10-09 00:32:45 +0000
commit1d83090d850f627b6d6ebe7837e807df5d29799f (patch)
tree43e5c861c23a53fc192928d8a51286ecc165be88
parent50c64df2a1739dca84c0e3bc795b70e5991b7010 (diff)
downloadsrc-1d83090d850f.tar.gz
src-1d83090d850f.zip
capsicum-test: skip SCTP tests if SCTP not available
Skip the test rather than failing if SCTP is not available (e.g., if sctp.ko is not loaded). Also submitted upstream as https://github.com/google/capsicum-test/pull/61 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46999
-rw-r--r--contrib/capsicum-test/sctp.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/capsicum-test/sctp.cc b/contrib/capsicum-test/sctp.cc
index 5f0d169456a8..76302059fa19 100644
--- a/contrib/capsicum-test/sctp.cc
+++ b/contrib/capsicum-test/sctp.cc
@@ -61,6 +61,9 @@ static int SctpClient(int port, unsigned char byte) {
TEST(Sctp, Socket) {
int sock = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
+ if (sock == -1 && errno == EPROTONOSUPPORT) {
+ GTEST_SKIP() << "socket(..., IPPROTO_SCTP) -> EPROTONOSUPPORT";
+ }
EXPECT_OK(sock);
if (sock < 0) return;