search for: control_writeln

Displaying 7 results from an estimated 7 matches for "control_writeln".

2023 Mar 20
0
[RFC PATCH v1 3/3] test/vsock: skbuff merging test
...; res = send(fd, buf, strlen(buf), 0); ... >+ res = send(fd, "HELLO", strlen("HELLO"), 0); >+ if (res != strlen("HELLO")) { >+ fprintf(stderr, "unexpected send(2) result %zi\n", res); >+ exit(EXIT_FAILURE); >+ } >+ >+ control_writeln("SEND0"); >+ /* Peer reads part of first packet. */ >+ control_expectln("REPLY0"); >+ >+ /* Send second skbuff, it will be merged. */ >+ res = send(fd, "WORLD", strlen("WORLD"), 0); Ditto. >+ if (res != strlen("WORLD")) { >+...
2023 Aug 31
0
[RFC PATCH v2 2/2] test/vsock: shutdowned socket test
...eam_connect(opts->peer_cid, 1234); >+ if (fd < 0) { >+ perror("connect"); >+ exit(EXIT_FAILURE); >+ } >+ >+ if (shutdown(fd, SHUT_WR)) { >+ perror("shutdown"); >+ exit(EXIT_FAILURE); >+ } >+ >+ test_stream_check_sigpipe(fd); >+ >+ control_writeln("CLIENTDONE"); >+ >+ close(fd); >+} >+ >+static void test_stream_shutwr_server(const struct test_opts *opts) >+{ >+ int fd; >+ >+ fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); >+ if (fd < 0) { >+ perror("accept"); >+ exit(EXIT_FAI...
2019 Dec 18
13
[PATCH net-next v3 00/11] VSOCK: add vsock_test test suite
The vsock_diag.ko module already has a test suite but the core AF_VSOCK functionality has no tests. This patch series adds several test cases that exercise AF_VSOCK SOCK_STREAM socket semantics (send/recv, connect/accept, half-closed connections, simultaneous connections). The v1 of this series was originally sent by Stefan. v3: - Patch 6: * check the byte received in the recv_byte() * use
2019 Aug 01
0
[PATCH v2 07/11] VSOCK: add AF_VSOCK test cases
...t(EXIT_FAILURE); + } + + close(fd); +} + +static void test_stream_client_close_client(const struct test_opts *opts) +{ + int fd; + + fd = vsock_stream_connect(opts->peer_cid, 1234); + if (fd < 0) { + perror("connect"); + exit(EXIT_FAILURE); + } + + send_byte(fd, 1); + close(fd); + control_writeln("CLOSED"); +} + +static void test_stream_client_close_server(const struct test_opts *opts) +{ + int fd; + + fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); + if (fd < 0) { + perror("accept"); + exit(EXIT_FAILURE); + } + + control_expectln("CLOSED"); + + send...
2019 Aug 01
13
[PATCH v2 00/11] VSOCK: add vsock_test test suite
The vsock_diag.ko module already has a test suite but the core AF_VSOCK functionality has no tests. This patch series adds several test cases that exercise AF_VSOCK SOCK_STREAM socket semantics (send/recv, connect/accept, half-closed connections, simultaneous connections). Stefan: Do you think we should have a single application or is better to split it in single tests (e.g.
2019 Oct 09
2
[PATCH v2 07/11] VSOCK: add AF_VSOCK test cases
...+ int fd; > + > + fd = vsock_stream_connect(opts->peer_cid, 1234); > + if (fd < 0) { > + perror("connect"); > + exit(EXIT_FAILURE); > + } > + > + send_byte(fd, 1); > + close(fd); > + control_writeln("CLOSED"); > +} > + > +static void test_stream_client_close_server(const struct test_opts *opts) > +{ > + int fd; > + > + fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); > + if (fd < 0) { > + perror("accept"); &...
2019 Oct 09
2
[PATCH v2 07/11] VSOCK: add AF_VSOCK test cases
...+ int fd; > + > + fd = vsock_stream_connect(opts->peer_cid, 1234); > + if (fd < 0) { > + perror("connect"); > + exit(EXIT_FAILURE); > + } > + > + send_byte(fd, 1); > + close(fd); > + control_writeln("CLOSED"); > +} > + > +static void test_stream_client_close_server(const struct test_opts *opts) > +{ > + int fd; > + > + fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); > + if (fd < 0) { > + perror("accept"); &...