Lines Matching refs:opts
36 static void test_stream_connection_reset(const struct test_opts *opts) in test_stream_connection_reset() argument
44 .svm_port = opts->peer_port, in test_stream_connection_reset()
45 .svm_cid = opts->peer_cid, in test_stream_connection_reset()
72 static void test_stream_bind_only_client(const struct test_opts *opts) in test_stream_bind_only_client() argument
80 .svm_port = opts->peer_port, in test_stream_bind_only_client()
81 .svm_cid = opts->peer_cid, in test_stream_bind_only_client()
114 static void test_stream_bind_only_server(const struct test_opts *opts) in test_stream_bind_only_server() argument
118 fd = vsock_bind(VMADDR_CID_ANY, opts->peer_port, SOCK_STREAM); in test_stream_bind_only_server()
129 static void test_stream_client_close_client(const struct test_opts *opts) in test_stream_client_close_client() argument
133 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_client_close_client()
143 static void test_stream_client_close_server(const struct test_opts *opts) in test_stream_client_close_server() argument
147 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_client_close_server()
164 static void test_stream_server_close_client(const struct test_opts *opts) in test_stream_server_close_client() argument
168 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_server_close_client()
185 static void test_stream_server_close_server(const struct test_opts *opts) in test_stream_server_close_server() argument
189 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_server_close_server()
204 static void test_stream_multiconn_client(const struct test_opts *opts) in test_stream_multiconn_client() argument
210 fds[i] = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_multiconn_client()
228 static void test_stream_multiconn_server(const struct test_opts *opts) in test_stream_multiconn_server() argument
234 fds[i] = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_multiconn_server()
254 static void test_msg_peek_client(const struct test_opts *opts, in test_msg_peek_client() argument
262 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_msg_peek_client()
264 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_msg_peek_client()
281 static void test_msg_peek_server(const struct test_opts *opts, in test_msg_peek_server() argument
290 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_msg_peek_server()
292 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_msg_peek_server()
337 static void test_stream_msg_peek_client(const struct test_opts *opts) in test_stream_msg_peek_client() argument
339 return test_msg_peek_client(opts, false); in test_stream_msg_peek_client()
342 static void test_stream_msg_peek_server(const struct test_opts *opts) in test_stream_msg_peek_server() argument
344 return test_msg_peek_server(opts, false); in test_stream_msg_peek_server()
350 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) in test_seqpacket_msg_bounds_client() argument
358 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_msg_bounds_client()
420 static void test_seqpacket_msg_bounds_server(const struct test_opts *opts) in test_seqpacket_msg_bounds_server() argument
429 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_msg_bounds_server()
491 static void test_seqpacket_msg_trunc_client(const struct test_opts *opts) in test_seqpacket_msg_trunc_client() argument
496 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_msg_trunc_client()
508 static void test_seqpacket_msg_trunc_server(const struct test_opts *opts) in test_seqpacket_msg_trunc_server() argument
515 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_msg_trunc_server()
558 static void test_seqpacket_timeout_client(const struct test_opts *opts) in test_seqpacket_timeout_client() argument
566 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_timeout_client()
605 static void test_seqpacket_timeout_server(const struct test_opts *opts) in test_seqpacket_timeout_server() argument
609 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_timeout_server()
619 static void test_seqpacket_bigmsg_client(const struct test_opts *opts) in test_seqpacket_bigmsg_client() argument
629 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_bigmsg_client()
664 static void test_seqpacket_bigmsg_server(const struct test_opts *opts) in test_seqpacket_bigmsg_server() argument
668 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_bigmsg_server()
682 static void test_seqpacket_invalid_rec_buffer_client(const struct test_opts *opts) in test_seqpacket_invalid_rec_buffer_client() argument
689 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_seqpacket_invalid_rec_buffer_client()
717 static void test_seqpacket_invalid_rec_buffer_server(const struct test_opts *opts) in test_seqpacket_invalid_rec_buffer_server() argument
729 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_seqpacket_invalid_rec_buffer_server()
800 static void test_stream_poll_rcvlowat_server(const struct test_opts *opts) in test_stream_poll_rcvlowat_server() argument
805 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_poll_rcvlowat_server()
828 static void test_stream_poll_rcvlowat_client(const struct test_opts *opts) in test_stream_poll_rcvlowat_client() argument
836 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_poll_rcvlowat_client()
893 static void test_inv_buf_client(const struct test_opts *opts, bool stream) in test_inv_buf_client() argument
900 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_inv_buf_client()
902 fd = vsock_seqpacket_connect(opts->peer_cid, opts->peer_port); in test_inv_buf_client()
929 static void test_inv_buf_server(const struct test_opts *opts, bool stream) in test_inv_buf_server() argument
935 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_inv_buf_server()
937 fd = vsock_seqpacket_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_inv_buf_server()
953 static void test_stream_inv_buf_client(const struct test_opts *opts) in test_stream_inv_buf_client() argument
955 test_inv_buf_client(opts, true); in test_stream_inv_buf_client()
958 static void test_stream_inv_buf_server(const struct test_opts *opts) in test_stream_inv_buf_server() argument
960 test_inv_buf_server(opts, true); in test_stream_inv_buf_server()
963 static void test_seqpacket_inv_buf_client(const struct test_opts *opts) in test_seqpacket_inv_buf_client() argument
965 test_inv_buf_client(opts, false); in test_seqpacket_inv_buf_client()
968 static void test_seqpacket_inv_buf_server(const struct test_opts *opts) in test_seqpacket_inv_buf_server() argument
970 test_inv_buf_server(opts, false); in test_seqpacket_inv_buf_server()
976 static void test_stream_virtio_skb_merge_client(const struct test_opts *opts) in test_stream_virtio_skb_merge_client() argument
980 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_virtio_skb_merge_client()
1003 static void test_stream_virtio_skb_merge_server(const struct test_opts *opts) in test_stream_virtio_skb_merge_server() argument
1009 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_virtio_skb_merge_server()
1044 static void test_seqpacket_msg_peek_client(const struct test_opts *opts) in test_seqpacket_msg_peek_client() argument
1046 return test_msg_peek_client(opts, true); in test_seqpacket_msg_peek_client()
1049 static void test_seqpacket_msg_peek_server(const struct test_opts *opts) in test_seqpacket_msg_peek_server() argument
1051 return test_msg_peek_server(opts, true); in test_seqpacket_msg_peek_server()
1092 static void test_stream_shutwr_client(const struct test_opts *opts) in test_stream_shutwr_client() argument
1102 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_shutwr_client()
1120 static void test_stream_shutwr_server(const struct test_opts *opts) in test_stream_shutwr_server() argument
1124 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_shutwr_server()
1135 static void test_stream_shutrd_client(const struct test_opts *opts) in test_stream_shutrd_client() argument
1145 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_shutrd_client()
1160 static void test_stream_shutrd_server(const struct test_opts *opts) in test_stream_shutrd_server() argument
1164 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_shutrd_server()
1181 static void test_double_bind_connect_server(const struct test_opts *opts) in test_double_bind_connect_server() argument
1187 listen_fd = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); in test_double_bind_connect_server()
1212 static void test_double_bind_connect_client(const struct test_opts *opts) in test_double_bind_connect_client() argument
1225 client_fd = vsock_bind_connect(opts->peer_cid, opts->peer_port, in test_double_bind_connect_client()
1226 opts->peer_port + 1, SOCK_STREAM); in test_double_bind_connect_client()
1233 static void test_unsent_bytes_server(const struct test_opts *opts, int type) in test_unsent_bytes_server() argument
1238 client_fd = vsock_accept(VMADDR_CID_ANY, opts->peer_port, NULL, type); in test_unsent_bytes_server()
1250 static void test_unsent_bytes_client(const struct test_opts *opts, int type) in test_unsent_bytes_client() argument
1255 fd = vsock_connect(opts->peer_cid, opts->peer_port, type); in test_unsent_bytes_client()
1289 static void test_stream_unsent_bytes_client(const struct test_opts *opts) in test_stream_unsent_bytes_client() argument
1291 test_unsent_bytes_client(opts, SOCK_STREAM); in test_stream_unsent_bytes_client()
1294 static void test_stream_unsent_bytes_server(const struct test_opts *opts) in test_stream_unsent_bytes_server() argument
1296 test_unsent_bytes_server(opts, SOCK_STREAM); in test_stream_unsent_bytes_server()
1299 static void test_seqpacket_unsent_bytes_client(const struct test_opts *opts) in test_seqpacket_unsent_bytes_client() argument
1301 test_unsent_bytes_client(opts, SOCK_SEQPACKET); in test_seqpacket_unsent_bytes_client()
1304 static void test_seqpacket_unsent_bytes_server(const struct test_opts *opts) in test_seqpacket_unsent_bytes_server() argument
1306 test_unsent_bytes_server(opts, SOCK_SEQPACKET); in test_seqpacket_unsent_bytes_server()
1317 static void test_stream_rcvlowat_def_cred_upd_client(const struct test_opts *opts) in test_stream_rcvlowat_def_cred_upd_client() argument
1323 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_rcvlowat_def_cred_upd_client()
1350 static void test_stream_credit_update_test(const struct test_opts *opts, in test_stream_credit_update_test() argument
1360 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_credit_update_test()
1460 static void test_stream_cred_upd_on_low_rx_bytes(const struct test_opts *opts) in test_stream_cred_upd_on_low_rx_bytes() argument
1462 test_stream_credit_update_test(opts, true); in test_stream_cred_upd_on_low_rx_bytes()
1465 static void test_stream_cred_upd_on_set_rcvlowat(const struct test_opts *opts) in test_stream_cred_upd_on_set_rcvlowat() argument
1467 test_stream_credit_update_test(opts, false); in test_stream_cred_upd_on_set_rcvlowat()
1484 static void test_stream_leak_acceptq_client(const struct test_opts *opts) in test_stream_leak_acceptq_client() argument
1493 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_leak_acceptq_client()
1502 static void test_stream_leak_acceptq_server(const struct test_opts *opts) in test_stream_leak_acceptq_server() argument
1507 fd = vsock_stream_listen(VMADDR_CID_ANY, opts->peer_port); in test_stream_leak_acceptq_server()
1514 static void test_stream_msgzcopy_leak_errq_client(const struct test_opts *opts) in test_stream_msgzcopy_leak_errq_client() argument
1519 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_msgzcopy_leak_errq_client()
1538 static void test_stream_msgzcopy_leak_errq_server(const struct test_opts *opts) in test_stream_msgzcopy_leak_errq_server() argument
1542 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_msgzcopy_leak_errq_server()
1623 static void test_stream_msgzcopy_leak_zcskb_client(const struct test_opts *opts) in test_stream_msgzcopy_leak_zcskb_client() argument
1645 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_msgzcopy_leak_zcskb_client()
1686 static void test_stream_msgzcopy_leak_zcskb_server(const struct test_opts *opts) in test_stream_msgzcopy_leak_zcskb_server() argument
1690 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_msgzcopy_leak_zcskb_server()
1705 static void test_stream_transport_uaf_client(const struct test_opts *opts) in test_stream_transport_uaf_client() argument
1748 static void test_stream_transport_uaf_server(const struct test_opts *opts) in test_stream_transport_uaf_server() argument
1753 static void test_stream_connect_retry_client(const struct test_opts *opts) in test_stream_connect_retry_client() argument
1763 if (!vsock_connect_fd(fd, opts->peer_cid, opts->peer_port)) { in test_stream_connect_retry_client()
1771 if (vsock_connect_fd(fd, opts->peer_cid, opts->peer_port)) { in test_stream_connect_retry_client()
1779 static void test_stream_connect_retry_server(const struct test_opts *opts) in test_stream_connect_retry_server() argument
1785 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_connect_retry_server()
1795 static void test_stream_linger_client(const struct test_opts *opts) in test_stream_linger_client() argument
1803 fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_linger_client()
1817 static void test_stream_linger_server(const struct test_opts *opts) in test_stream_linger_server() argument
1821 fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_linger_server()
2086 struct test_opts opts = { in main() local
2107 opts.mode = TEST_MODE_CLIENT; in main()
2109 opts.mode = TEST_MODE_SERVER; in main()
2116 opts.peer_cid = parse_cid(optarg); in main()
2119 opts.peer_port = parse_port(optarg); in main()
2143 if (opts.mode == TEST_MODE_UNSET) in main()
2145 if (opts.peer_cid == VMADDR_CID_ANY) in main()
2149 if (opts.mode != TEST_MODE_SERVER) in main()
2155 opts.mode == TEST_MODE_SERVER); in main()
2157 run_tests(test_cases, &opts); in main()