]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1043] Added eth1961 fake interface
authorFrancis Dupont <fdupont@isc.org>
Sat, 11 Apr 2020 20:13:00 +0000 (22:13 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 8 Jul 2020 10:57:37 +0000 (12:57 +0200)
src/lib/dhcp/tests/iface_mgr_test_config.cc
src/lib/dhcp/tests/iface_mgr_test_config.h
src/lib/dhcp/tests/iface_mgr_unittest.cc
src/lib/dhcpsrv/tests/shared_networks_list_parser_unittest.cc

index 20035f2933a53d45d709d5fc7d54884824b09cce..39618b7f0abbcc3a288df319acffcf77d272f45d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -32,7 +32,7 @@ IfaceMgrTestConfig::IfaceMgrTestConfig(const bool default_config) {
     IfaceMgr::instance().setPacketFilter(packet_filter4_);
     IfaceMgr::instance().setPacketFilter(packet_filter6_);
 
-    // Create default set of fake interfaces: lo, eth0 and eth1.
+    // Create default set of fake interfaces: lo, eth0, eth1 and eth1961.
     if (default_config) {
         createIfaces();
     }
@@ -117,6 +117,10 @@ IfaceMgrTestConfig::createIfaces() {
     addAddress("eth1", IOAddress("192.0.2.3"));
     addAddress("eth1", IOAddress("192.0.2.5"));
     addAddress("eth1", IOAddress("fe80::3a60:77ff:fed5:abcd"));
+    // eth1961
+    addIface("eth1961", 3);
+    addAddress("eth1961", IOAddress("198.51.100.1"));
+    addAddress("eth1961", IOAddress("fe80::3a60:77ff:fed5:9876"));
 
 }
 
index c12c6e3e3b927e8cc000bb12750976f76dcc1f92..fa55ad305193acdb3848f84387afec59440762a0 100644 (file)
@@ -130,6 +130,9 @@ struct FlagInactive6 {
 /// - eth1 #2
 ///   - 192.0.2.3
 ///   - fe80::3a60:77ff:fed5:abcd
+/// - eth1961
+///   - 198.51.100.1
+///   - fe80::3a60:77ff:fed5:9876
 ///
 /// For all interfaces the following flags are set:
 /// - multicast
index 769f2517fbf87d6c201aa4858ebd95b60d1da953..22fa697e1cd45e24fca02a84868a4f5f0e82bf97 100644 (file)
@@ -1869,6 +1869,9 @@ TEST_F(IfaceMgrTest, openSockets4IfaceDown) {
     // and active.
     EXPECT_EQ(2, IfaceMgr::instance().getIface("eth1")->getSockets().size());
     EXPECT_EQ(2, IfaceMgr::instance().getIface(ETH1_INDEX)->getSockets().size());
+    // Same for eth1961.
+    EXPECT_EQ(1, IfaceMgr::instance().getIface("eth1961")->getSockets().size());
+    EXPECT_EQ(1, IfaceMgr::instance().getIface(ETH1961_INDEX)->getSockets().size());
     // Never open socket on loopback interface.
     EXPECT_TRUE(IfaceMgr::instance().getIface("lo")->getSockets().empty());
     EXPECT_TRUE(IfaceMgr::instance().getIface(LO_INDEX)->getSockets().empty());
index 9bf82dd0697cad66b3dd0c468e2a5df2c495ba70..cf7516f4f15233ca1a67b68f0b0dc1ec606e027a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -89,7 +89,7 @@ TEST(SharedNetworkListParserTest, iface) {
     std::string config = "["
         "    {"
         "        \"name\": \"bird\","
-        "        \"interface\": \"eth0\""
+        "        \"interface\": \"eth1961\""
         "    }"
         "]";