mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#1043] Added eth1961 fake interface
This commit is contained in:
@@ -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
|
// 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
|
// 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_filter4_);
|
||||||
IfaceMgr::instance().setPacketFilter(packet_filter6_);
|
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) {
|
if (default_config) {
|
||||||
createIfaces();
|
createIfaces();
|
||||||
}
|
}
|
||||||
@@ -117,6 +117,10 @@ IfaceMgrTestConfig::createIfaces() {
|
|||||||
addAddress("eth1", IOAddress("192.0.2.3"));
|
addAddress("eth1", IOAddress("192.0.2.3"));
|
||||||
addAddress("eth1", IOAddress("192.0.2.5"));
|
addAddress("eth1", IOAddress("192.0.2.5"));
|
||||||
addAddress("eth1", IOAddress("fe80::3a60:77ff:fed5:abcd"));
|
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"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -130,6 +130,9 @@ struct FlagInactive6 {
|
|||||||
/// - eth1 #2
|
/// - eth1 #2
|
||||||
/// - 192.0.2.3
|
/// - 192.0.2.3
|
||||||
/// - fe80::3a60:77ff:fed5:abcd
|
/// - fe80::3a60:77ff:fed5:abcd
|
||||||
|
/// - eth1961
|
||||||
|
/// - 198.51.100.1
|
||||||
|
/// - fe80::3a60:77ff:fed5:9876
|
||||||
///
|
///
|
||||||
/// For all interfaces the following flags are set:
|
/// For all interfaces the following flags are set:
|
||||||
/// - multicast
|
/// - multicast
|
||||||
|
@@ -1869,6 +1869,9 @@ TEST_F(IfaceMgrTest, openSockets4IfaceDown) {
|
|||||||
// and active.
|
// and active.
|
||||||
EXPECT_EQ(2, IfaceMgr::instance().getIface("eth1")->getSockets().size());
|
EXPECT_EQ(2, IfaceMgr::instance().getIface("eth1")->getSockets().size());
|
||||||
EXPECT_EQ(2, IfaceMgr::instance().getIface(ETH1_INDEX)->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.
|
// Never open socket on loopback interface.
|
||||||
EXPECT_TRUE(IfaceMgr::instance().getIface("lo")->getSockets().empty());
|
EXPECT_TRUE(IfaceMgr::instance().getIface("lo")->getSockets().empty());
|
||||||
EXPECT_TRUE(IfaceMgr::instance().getIface(LO_INDEX)->getSockets().empty());
|
EXPECT_TRUE(IfaceMgr::instance().getIface(LO_INDEX)->getSockets().empty());
|
||||||
|
@@ -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
|
// 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
|
// 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 = "["
|
std::string config = "["
|
||||||
" {"
|
" {"
|
||||||
" \"name\": \"bird\","
|
" \"name\": \"bird\","
|
||||||
" \"interface\": \"eth0\""
|
" \"interface\": \"eth1961\""
|
||||||
" }"
|
" }"
|
||||||
"]";
|
"]";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user