2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

[#1043] Added eth1961 fake interface

This commit is contained in:
Francis Dupont 2020-04-11 22:13:00 +02:00
parent 7bcfafaf97
commit 52a259cd1e
4 changed files with 14 additions and 4 deletions

View 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"));
}

View 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

View 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());

View 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\""
" }"
"]";