Lines Matching refs:test

373 tcpsig_bind_dest(const tcpsig_test_t *test, int sock,  in tcpsig_bind_dest()  argument
381 if (test->tt_domain == PF_INET) { in tcpsig_bind_dest()
384 in->sin_port = htons(test->tt_port); in tcpsig_bind_dest()
387 "to an IPv4 address", test->tt_desc); in tcpsig_bind_dest()
394 in6->sin6_port = htons(test->tt_port); in tcpsig_bind_dest()
397 "to an IPv6 address", test->tt_desc); in tcpsig_bind_dest()
405 test->tt_desc); in tcpsig_bind_dest()
412 test->tt_desc); in tcpsig_bind_dest()
424 tcpsig_connect(const tcpsig_test_t *test, int port, int src, int dst, int *cfd, in tcpsig_connect() argument
428 int namelen = test->tt_domain == PF_INET ? sizeof (struct sockaddr_in) : in tcpsig_connect()
435 warn("TEST FAILED: %s: failed to listen", test->tt_desc); in tcpsig_connect()
441 test->tt_pass == TCPSIG_CONNREFUSED) { in tcpsig_connect()
443 test->tt_desc); in tcpsig_connect()
446 warn("TEST FAILED: %s: failed to connect", test->tt_desc); in tcpsig_connect()
452 "associate to watch connect", test->tt_desc); in tcpsig_connect()
456 if (test->tt_pass == TCPSIG_NOCONNECT) { in tcpsig_connect()
459 test->tt_desc); in tcpsig_connect()
463 test->tt_desc); in tcpsig_connect()
470 "POLLOUT, found 0x%x", test->tt_desc, pe.portev_events); in tcpsig_connect()
479 "associate to watch accept", test->tt_desc); in tcpsig_connect()
484 test->tt_desc); in tcpsig_connect()
490 "POLLIN, found 0x%x", test->tt_desc, pe.portev_events); in tcpsig_connect()
497 test->tt_desc); in tcpsig_connect()
504 "TCP_MD5SIG option", test->tt_desc); in tcpsig_connect()
510 "(expected %ld).", test->tt_desc, optlen, sizeof (opt)); in tcpsig_connect()
520 if (test->tt_enable_dst && !test->tt_enable_src && in tcpsig_connect()
521 test->tt_pass == TCPSIG_SENDRECV && opt != 0) { in tcpsig_connect()
523 test->tt_desc); in tcpsig_connect()
525 } else if (test->tt_enable_src && opt == 0) { in tcpsig_connect()
527 test->tt_desc); in tcpsig_connect()
531 if (test->tt_pass != TCPSIG_SENDRECV && in tcpsig_connect()
532 test->tt_pass != TCPSIG_NODATA) { in tcpsig_connect()
534 test->tt_desc); in tcpsig_connect()
547 tcpsig_sendrecv(const tcpsig_test_t *test, int port, int src, int dst) in tcpsig_sendrecv() argument
557 test->tt_desc); in tcpsig_sendrecv()
562 "associate to watch recv", test->tt_desc); in tcpsig_sendrecv()
566 if (test->tt_pass == TCPSIG_NODATA) { in tcpsig_sendrecv()
568 "for data\n", test->tt_desc); in tcpsig_sendrecv()
572 test->tt_desc); in tcpsig_sendrecv()
579 "POLLIN, found 0x%x", test->tt_desc, pe.portev_events); in tcpsig_sendrecv()
586 test->tt_desc, sret); in tcpsig_sendrecv()
590 if (test->tt_pass != TCPSIG_SENDRECV) { in tcpsig_sendrecv()
592 test->tt_desc); in tcpsig_sendrecv()
598 "0x%x", test->tt_desc, msgdata, data); in tcpsig_sendrecv()
603 test->tt_desc); in tcpsig_sendrecv()
608 tcpsig_test_one(const tcpsig_test_t *test) in tcpsig_test_one() argument
618 src = socket(test->tt_domain, SOCK_STREAM | SOCK_NONBLOCK, 0); in tcpsig_test_one()
621 test->tt_desc); in tcpsig_test_one()
626 x = test->tt_enable_src ? 1 : 0; in tcpsig_test_one()
629 test->tt_desc); in tcpsig_test_one()
634 dst = socket(test->tt_domain, SOCK_STREAM | SOCK_NONBLOCK, 0); in tcpsig_test_one()
637 test->tt_desc); in tcpsig_test_one()
642 x = test->tt_enable_dst ? 1 : 0; in tcpsig_test_one()
645 test->tt_desc); in tcpsig_test_one()
650 if (!tcpsig_bind_dest(test, dst, &dst_addr)) { in tcpsig_test_one()
655 if (!tcpsig_connect(test, port, src, dst, &cfd, in tcpsig_test_one()
661 if (test->tt_pass != TCPSIG_SENDRECV && test->tt_pass != TCPSIG_NODATA) in tcpsig_test_one()
666 if (!tcpsig_sendrecv(test, port, src, tdst)) { in tcpsig_test_one()