tests: net: socketpair: skip nonblocking tests on posix arch

The `fcntl()` call (`zsock_fcntl()`) does not seem to work
properly (specifically with `CONFIG_ARCH_POSIX`). This will
be resolved in subsequent work harmonizing the networking
subsystem and POSIX library.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
This commit is contained in:
Chris Friedt 2023-02-19 14:19:46 -05:00 committed by Carles Cufí
commit 2eb53f4bd7
2 changed files with 15 additions and 0 deletions

View file

@ -12,6 +12,11 @@ ZTEST_USER(net_socketpair, fcntl)
int sv[2] = {-1, -1};
int flags;
if (IS_ENABLED(CONFIG_ARCH_POSIX)) {
printk("non-blocking socketpair I/O is unsupported with CONFIG_ARCH_POSIX\n");
ztest_test_skip();
}
res = socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
zassert_equal(res, 0,
"socketpair(AF_UNIX, SOCK_STREAM, 0, sv) failed");

View file

@ -11,6 +11,11 @@ ZTEST_USER(net_socketpair, write_nonblock)
int res;
int sv[2] = {-1, -1};
if (IS_ENABLED(CONFIG_ARCH_POSIX)) {
printk("non-blocking socketpair I/O is unsupported with CONFIG_ARCH_POSIX\n");
ztest_test_skip();
}
res = socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
zassert_equal(res, 0, "socketpair() failed: %d", errno);
@ -46,6 +51,11 @@ ZTEST_USER(net_socketpair, read_nonblock)
int sv[2] = {-1, -1};
char c;
if (IS_ENABLED(CONFIG_ARCH_POSIX)) {
printk("non-blocking socketpair I/O is unsupported with CONFIG_ARCH_POSIX\n");
ztest_test_skip();
}
res = socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
zassert_equal(res, 0, "socketpair() failed: %d", errno);