diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -1904,10 +1904,13 @@ /* * The other end may notice the error and drop the connection * before this executes resulting in shutdown() failing with - * ENOTCONN. Ignore this error if it occurs. + * either ENOTCONN or ECONNRESET. Ignore this error if it + * occurs. */ - if (shutdown(sockets[1], SHUT_WR) != 0) - ATF_REQUIRE_ERRNO(ENOTCONN, true); + if (shutdown(sockets[1], SHUT_WR) != 0) { + ATF_REQUIRE_MSG(errno == ENOTCONN || errno == ECONNRESET, + "shutdown() failed: %s", strerror(errno)); + } ktls_receive_tls_error(sockets[0], EMSGSIZE);