Lines Matching +full:qemu +full:- +full:user +full:- +full:static

1 /*-
43 #include <atf-c.h>
54 static int portrange_first, portrange_last;
56 static int
71 static int
89 random_port = rand() % (portrange_last - portrange_first) + in generate_random_port()
96 static void
129 static int
135 ATF_REQUIRE_MSG(sock != -1, "socket(%d, %d, 0) failed: %s", in make_socket()
141 static int
150 (const struct sockaddr*)res->ai_addr, res->ai_addrlen, in setup_client()
151 host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); in setup_client()
157 host, res->ai_family, res->ai_socktype); in setup_client()
160 sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); in setup_client()
161 error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); in setup_client()
172 static int
180 sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); in setup_server()
183 (const struct sockaddr*)res->ai_addr, res->ai_addrlen, in setup_server()
184 host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); in setup_server()
190 host, res->ai_family, res->ai_socktype); in setup_server()
193 error = bind(sock, res->ai_addr, res->ai_addrlen); in setup_server()
207 static void
225 if (recv_sock == -1) in server_cat()
232 buffer_size - received_bytes, 0); in server_cat()
250 static int
257 static int
264 static off_t
279 static void
291 ATF_REQUIRE_MSG(dest_fd != -1, "open failed"); in verify_source_and_dest()
301 length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; in verify_source_and_dest()
331 static void
343 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in fd_positive_file_test()
380 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
381 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
396 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
397 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
402 static void
416 ATF_REQUIRE_MSG(fd != -1, "shm_open failed: %s", strerror(errno)); in fd_positive_shm_test()
464 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
465 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
479 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
480 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
485 static void
494 fd = -1; in fd_negative_bad_fd_test()
497 ATF_REQUIRE_ERRNO(EBADF, error == -1); in fd_negative_bad_fd_test()
512 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
513 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
527 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
528 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
533 static void
595 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in flags_test()
632 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
633 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
646 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
647 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
652 static void
719 ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno)); in hdtr_positive_test()
725 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in hdtr_positive_test()
728 ATF_REQUIRE_MSG(fd2 != -1, "open failed: %s", strerror(errno)); in hdtr_positive_test()
764 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
765 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
779 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
780 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
785 static void
793 hdtr1 = (struct sf_hdtr*)-1; in hdtr_negative_bad_pointers_test()
797 hdtr2.headers = (struct iovec*)-1; in hdtr_negative_bad_pointers_test()
801 hdtr3.trailers = (struct iovec*)-1; in hdtr_negative_bad_pointers_test()
804 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in hdtr_negative_bad_pointers_test()
810 ATF_CHECK_ERRNO(EFAULT, error == -1); in hdtr_negative_bad_pointers_test()
813 ATF_CHECK_ERRNO(EFAULT, error == -1); in hdtr_negative_bad_pointers_test()
816 ATF_CHECK_ERRNO(EFAULT, error == -1); in hdtr_negative_bad_pointers_test()
832 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
833 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
847 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
848 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
853 static void
863 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in offset_negative_value_less_than_zero_test()
865 error = sendfile(fd, client_sock, -1, 0, NULL, NULL, SF_FLAGS(0, 0)); in offset_negative_value_less_than_zero_test()
866 ATF_REQUIRE_ERRNO(EINVAL, error == -1); in offset_negative_value_less_than_zero_test()
882 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
883 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
897 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
898 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
903 static void
916 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in sbytes_positive_test()
939 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
940 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
954 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
955 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
960 static void
963 off_t *sbytes_p = (off_t*)-1; in sbytes_negative_test()
972 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in sbytes_negative_test()
978 ATF_REQUIRE_ERRNO(EFAULT, error == -1); in sbytes_negative_test()
994 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
995 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1009 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1010 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1015 static void
1024 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in s_negative_not_connected_socket_test()
1027 ATF_REQUIRE_ERRNO(ENOTCONN, error == -1); in s_negative_not_connected_socket_test()
1038 "Verify that a non-connected SOCK_STREAM socket results in ENOTCONN (IPv4)"); in ATF_TC_HEAD()
1043 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1044 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1054 "Verify that a non-connected SOCK_STREAM socket results in ENOTCONN (IPv6)"); in ATF_TC_HEAD()
1059 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1060 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1070 "Verify that an invalid file descriptor, e.g., -1, fails with EBADF"); in ATF_TC_HEAD()
1077 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1078 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1080 client_sock = -1; in ATF_TC_BODY()
1083 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in ATF_TC_BODY()
1086 ATF_REQUIRE_ERRNO(EBADF, error == -1); in ATF_TC_BODY()
1096 "Verify that a non-socket file descriptor fails with ENOTSOCK"); in ATF_TC_HEAD()
1103 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1104 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1107 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in ATF_TC_BODY()
1110 ATF_REQUIRE_MSG(client_sock != -1, "open failed: %s", strerror(errno)); in ATF_TC_BODY()
1113 ATF_REQUIRE_ERRNO(ENOTSOCK, error == -1); in ATF_TC_BODY()
1119 static void
1128 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); in s_negative_udp_socket_test()
1131 ATF_REQUIRE_ERRNO(EINVAL, error == -1); in s_negative_udp_socket_test()
1142 "Verify that a non-SOCK_STREAM type socket results in EINVAL (IPv4)"); in ATF_TC_HEAD()
1147 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1148 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()
1158 "Verify that a non-SOCK_STREAM type socket results in EINVAL (IPv6)"); in ATF_TC_HEAD()
1163 if (atf_tc_get_config_var_as_bool_wd(tc, "qemu", false)) in ATF_TC_BODY()
1164 …atf_tc_skip("Sendfile(4) unimplemented. https://github.com/qemu-bsd-user/qemu-bsd-user/issues/25"); in ATF_TC_BODY()