Browse Source

avoid using a multicast IPv6 address for IOServiceTest.unavailableAddress
as NetBSD allows a TCP socket to be bound to it. this behavior is
questionable, but even if it's an OS bug it's better to keep our tests as
portable as possible especially if it can be done by a trivial parameter
change.

fix is quite trivial, okayed in jabber, skipping formal review.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2656 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya 14 years ago
parent
commit
ab65fd440b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/bin/auth/tests/asio_link_unittest.cc

+ 7 - 1
src/bin/auth/tests/asio_link_unittest.cc

@@ -108,8 +108,14 @@ TEST(IOServiceTest, badAddress) {
 TEST(IOServiceTest, unavailableAddress) {
     // These addresses should generally be unavailable as a valid local
     // address, although there's no guarantee in theory.
-    EXPECT_THROW(IOService(NULL, *TEST_PORT, *"ffff:ffff::"), IOError);
     EXPECT_THROW(IOService(NULL, *TEST_PORT, *"255.255.0.0"), IOError);
+
+    // Some OSes would simply reject binding attempt for an AF_INET6 socket
+    // to an IPv4-mapped IPv6 address.  Even if those that allow it, since
+    // the corresponding IPv4 address is the same as the one used in the
+    // AF_INET socket case above, it should at least show the same result
+    // as the previous one.
+    EXPECT_THROW(IOService(NULL, *TEST_PORT, *"::ffff:255.255.0.0"), IOError);
 }
 
 TEST(IOServiceTest, duplicateBind) {