@@ -463,7 +463,10 @@ static bssl::UniquePtr<BIO> create_server_bio(int addr_family, int type) {
463
463
// Create a server socket.
464
464
OwnedSocket server_sock (ListenLoopback (type, addr_family));
465
465
if (!server_sock.is_valid ()) {
466
- ADD_FAILURE () << LastSocketError ();
466
+ if (addr_family != AF_INET6) {
467
+ // Some CodeBuild environments don't support IPv6
468
+ ADD_FAILURE () << LastSocketError ();
469
+ }
467
470
return nullptr ;
468
471
}
469
472
@@ -549,6 +552,11 @@ TEST_P(BIODgramTest, SocketDatagramSetPeer) {
549
552
int addr_family = GetParam ();
550
553
// Wrap the server socket in a BIO.
551
554
bssl::UniquePtr<BIO> server_bio = create_server_bio (addr_family, SOCK_DGRAM);
555
+ if (!server_bio && addr_family == AF_INET6) {
556
+ // Some CodeBuild environments don't support IPv6
557
+ GTEST_SKIP () << " IPv6 not supported" ;
558
+ return ;
559
+ }
552
560
ASSERT_TRUE (server_bio) << LastSocketError ();
553
561
ASSERT_EQ (1 , BIO_get_close (server_bio.get ())) << LastSocketError ();
554
562
@@ -582,6 +590,11 @@ TEST_P(BIODgramTest, SocketDatagramSetConnected) {
582
590
int addr_family = GetParam ();
583
591
// Wrap the server socket in a BIO.
584
592
bssl::UniquePtr<BIO> server_bio = create_server_bio (addr_family, SOCK_DGRAM);
593
+ if (!server_bio && addr_family == AF_INET6) {
594
+ // Some CodeBuild environments don't support IPv6
595
+ GTEST_SKIP () << " IPv6 not supported" ;
596
+ return ;
597
+ }
585
598
ASSERT_TRUE (server_bio) << LastSocketError ();
586
599
587
600
OwnedSocket server_sock (BIO_get_fd (server_bio.get (), NULL ));
@@ -634,6 +647,11 @@ TEST_P(BIODgramTest, SocketDatagramConnect) {
634
647
int addr_family = GetParam ();
635
648
// Wrap the server socket in a BIO.
636
649
bssl::UniquePtr<BIO> server_bio = create_server_bio (addr_family, SOCK_DGRAM);
650
+ if (!server_bio && addr_family == AF_INET6) {
651
+ // Some CodeBuild environments don't support IPv6
652
+ GTEST_SKIP () << " IPv6 not supported" ;
653
+ return ;
654
+ }
637
655
ASSERT_TRUE (server_bio) << LastSocketError ();
638
656
639
657
OwnedSocket server_sock (BIO_get_fd (server_bio.get (), NULL ));
0 commit comments