Commit 52a259cd authored by Francis Dupont's avatar Francis Dupont

[#1043] Added eth1961 fake interface

parent 7bcfafaf
// 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"));
}
......
......@@ -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
......
......@@ -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());
......
// 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\""
" }"
"]";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment