Ratan Gupta | c9645fe | 2017-08-23 16:53:52 +0530 | [diff] [blame] | 1 | #include "config_parser.hpp" |
Ratan Gupta | 5978dd1 | 2017-07-25 13:47:13 +0530 | [diff] [blame] | 2 | #include "ipaddress.hpp" |
William A. Kennington III | 5b17938 | 2022-11-15 15:23:26 -0800 | [diff] [blame] | 3 | #include "mock_ethernet_interface.hpp" |
William A. Kennington III | de70ccf | 2022-11-20 17:18:01 -0800 | [diff] [blame] | 4 | #include "test_network_manager.hpp" |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 5 | |
| 6 | #include <net/if.h> |
William A. Kennington III | 9c441fd | 2023-02-24 13:40:01 -0800 | [diff] [blame] | 7 | #include <net/if_arp.h> |
Ratan Gupta | 255d514 | 2017-08-10 09:02:08 +0530 | [diff] [blame] | 8 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 9 | #include <sdbusplus/bus.hpp> |
William A. Kennington III | 84bfe67 | 2022-07-13 14:15:30 -0700 | [diff] [blame] | 10 | #include <stdplus/gtest/tmp.hpp> |
Asmitha Karunanithi | 003b8b7 | 2022-01-06 04:17:59 -0600 | [diff] [blame] | 11 | #include <xyz/openbmc_project/Common/error.hpp> |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 12 | |
Patrick Williams | 89d734b | 2023-05-10 07:50:25 -0500 | [diff] [blame] | 13 | #include <string_view> |
| 14 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 15 | #include <gtest/gtest.h> |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 16 | |
| 17 | namespace phosphor |
| 18 | { |
| 19 | namespace network |
| 20 | { |
| 21 | |
William A. Kennington III | bbf5e9e | 2023-02-01 14:58:38 -0800 | [diff] [blame] | 22 | using sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument; |
William A. Kennington III | 991a8e8 | 2022-10-11 15:02:47 -0700 | [diff] [blame] | 23 | using std::literals::string_view_literals::operator""sv; |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 24 | using testing::Key; |
| 25 | using testing::UnorderedElementsAre; |
William A. Kennington III | 02d87c1 | 2023-06-28 17:59:51 -0700 | [diff] [blame] | 26 | using stdplus::operator""_sub; |
William A. Kennington III | 991a8e8 | 2022-10-11 15:02:47 -0700 | [diff] [blame] | 27 | |
William A. Kennington III | 84bfe67 | 2022-07-13 14:15:30 -0700 | [diff] [blame] | 28 | class TestEthernetInterface : public stdplus::gtest::TestWithTmp |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 29 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 30 | public: |
William A. Kennington III | 9ede1b7 | 2022-11-21 01:59:28 -0800 | [diff] [blame] | 31 | stdplus::Pinned<sdbusplus::bus_t> bus; |
William A. Kennington III | 5b17938 | 2022-11-15 15:23:26 -0800 | [diff] [blame] | 32 | std::filesystem::path confDir; |
William A. Kennington III | de70ccf | 2022-11-20 17:18:01 -0800 | [diff] [blame] | 33 | TestManager manager; |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 34 | MockEthernetInterface interface; |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 35 | TestEthernetInterface() : |
William A. Kennington III | 84bfe67 | 2022-07-13 14:15:30 -0700 | [diff] [blame] | 36 | bus(sdbusplus::bus::new_default()), confDir(CaseTmpDir()), |
| 37 | manager(bus, "/xyz/openbmc_test/network", confDir), |
William A. Kennington III | ebb1ad0 | 2019-04-21 18:02:49 -0700 | [diff] [blame] | 38 | interface(makeInterface(bus, manager)) |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 39 | |
Patrick Williams | 89d734b | 2023-05-10 07:50:25 -0500 | [diff] [blame] | 40 | {} |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 41 | |
William A. Kennington III | 9ede1b7 | 2022-11-21 01:59:28 -0800 | [diff] [blame] | 42 | static MockEthernetInterface |
| 43 | makeInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus, |
| 44 | TestManager& manager) |
William A. Kennington III | ebb1ad0 | 2019-04-21 18:02:49 -0700 | [diff] [blame] | 45 | { |
William A. Kennington III | 9c441fd | 2023-02-24 13:40:01 -0800 | [diff] [blame] | 46 | AllIntfInfo info{InterfaceInfo{ |
| 47 | .type = ARPHRD_ETHER, .idx = 1, .flags = 0, .name = "test0"}}; |
William A. Kennington III | 7784856 | 2022-10-26 17:32:57 -0700 | [diff] [blame] | 48 | return {bus, manager, info, "/xyz/openbmc_test/network"sv, |
| 49 | config::Parser()}; |
William A. Kennington III | ebb1ad0 | 2019-04-21 18:02:49 -0700 | [diff] [blame] | 50 | } |
| 51 | |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 52 | auto createIPObject(IP::Protocol addressType, const std::string& ipaddress, |
William A. Kennington III | e25f8b4 | 2022-10-11 14:43:28 -0700 | [diff] [blame] | 53 | uint8_t subnetMask) |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 54 | { |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 55 | return interface.ip(addressType, ipaddress, subnetMask, ""); |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 56 | } |
Asmitha Karunanithi | 003b8b7 | 2022-01-06 04:17:59 -0600 | [diff] [blame] | 57 | |
| 58 | void setNtpServers() |
| 59 | { |
| 60 | ServerList ntpServers = {"10.1.1.1", "10.2.2.2", "10.3.3.3"}; |
| 61 | interface.EthernetInterfaceIntf::ntpServers(ntpServers); |
| 62 | } |
| 63 | |
| 64 | ServerList getNtpServers() |
| 65 | { |
| 66 | return interface.EthernetInterfaceIntf::ntpServers(); |
| 67 | } |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 68 | }; |
| 69 | |
William A. Kennington III | 9ecb90e | 2022-10-14 03:12:43 -0700 | [diff] [blame] | 70 | TEST_F(TestEthernetInterface, Fields) |
| 71 | { |
| 72 | EXPECT_EQ(0, interface.mtu()); |
| 73 | EXPECT_EQ("", interface.macAddress()); |
| 74 | EXPECT_FALSE(interface.linkUp()); |
| 75 | |
William A. Kennington III | b7d6a1a | 2023-06-17 02:00:53 -0700 | [diff] [blame] | 76 | constexpr stdplus::EtherAddr mac{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; |
William A. Kennington III | 9ecb90e | 2022-10-14 03:12:43 -0700 | [diff] [blame] | 77 | constexpr unsigned mtu = 150; |
| 78 | |
William A. Kennington III | 9c441fd | 2023-02-24 13:40:01 -0800 | [diff] [blame] | 79 | AllIntfInfo info{InterfaceInfo{.type = ARPHRD_ETHER, |
| 80 | .idx = 2, |
William A. Kennington III | 13d665c | 2022-11-15 20:34:40 -0800 | [diff] [blame] | 81 | .flags = IFF_RUNNING, |
| 82 | .name = "test1", |
| 83 | .mac = mac, |
| 84 | .mtu = mtu}}; |
William A. Kennington III | 7784856 | 2022-10-26 17:32:57 -0700 | [diff] [blame] | 85 | MockEthernetInterface intf(bus, manager, info, |
William A. Kennington III | d298f93 | 2022-10-17 14:31:38 -0700 | [diff] [blame] | 86 | "/xyz/openbmc_test/network"sv, config::Parser()); |
William A. Kennington III | 9ecb90e | 2022-10-14 03:12:43 -0700 | [diff] [blame] | 87 | |
| 88 | EXPECT_EQ(mtu, intf.mtu()); |
William A. Kennington III | b7d6a1a | 2023-06-17 02:00:53 -0700 | [diff] [blame] | 89 | EXPECT_EQ(stdplus::toStr(mac), intf.macAddress()); |
William A. Kennington III | 9ecb90e | 2022-10-14 03:12:43 -0700 | [diff] [blame] | 90 | EXPECT_TRUE(intf.linkUp()); |
| 91 | } |
| 92 | |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 93 | TEST_F(TestEthernetInterface, NoIPaddress) |
| 94 | { |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 95 | EXPECT_TRUE(interface.addrs.empty()); |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | TEST_F(TestEthernetInterface, AddIPAddress) |
| 99 | { |
William A. Kennington III | 30f3ba2 | 2023-06-28 15:50:12 -0700 | [diff] [blame] | 100 | EXPECT_THROW(createIPObject(IP::Protocol::IPv4, "127.0.0.1", 16), |
| 101 | InvalidArgument); |
| 102 | EXPECT_THROW(createIPObject(IP::Protocol::IPv4, "127.0.0.1", 32), |
| 103 | InvalidArgument); |
| 104 | EXPECT_THROW(createIPObject(IP::Protocol::IPv4, "192.168.1.1", 0), |
| 105 | InvalidArgument); |
| 106 | EXPECT_THROW(createIPObject(IP::Protocol::IPv6, "::1", 64), |
| 107 | InvalidArgument); |
| 108 | EXPECT_THROW(createIPObject(IP::Protocol::IPv6, "::", 128), |
| 109 | InvalidArgument); |
| 110 | EXPECT_THROW(createIPObject(IP::Protocol::IPv6, "fe80::1", 0), |
| 111 | InvalidArgument); |
| 112 | |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 113 | createIPObject(IP::Protocol::IPv4, "10.10.10.10", 16); |
William A. Kennington III | 02d87c1 | 2023-06-28 17:59:51 -0700 | [diff] [blame] | 114 | EXPECT_THAT(interface.addrs, |
| 115 | UnorderedElementsAre(Key("10.10.10.10/16"_sub))); |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | TEST_F(TestEthernetInterface, AddMultipleAddress) |
| 119 | { |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 120 | createIPObject(IP::Protocol::IPv4, "10.10.10.10", 16); |
| 121 | createIPObject(IP::Protocol::IPv4, "20.20.20.20", 16); |
William A. Kennington III | 02d87c1 | 2023-06-28 17:59:51 -0700 | [diff] [blame] | 122 | EXPECT_THAT(interface.addrs, |
| 123 | UnorderedElementsAre(Key("10.10.10.10/16"_sub), |
| 124 | Key("20.20.20.20/16"_sub))); |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | TEST_F(TestEthernetInterface, DeleteIPAddress) |
| 128 | { |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 129 | createIPObject(IP::Protocol::IPv4, "10.10.10.10", 16); |
| 130 | createIPObject(IP::Protocol::IPv4, "20.20.20.20", 16); |
William A. Kennington III | 02d87c1 | 2023-06-28 17:59:51 -0700 | [diff] [blame] | 131 | interface.addrs.at("10.10.10.10/16"_sub)->delete_(); |
| 132 | EXPECT_THAT(interface.addrs, |
| 133 | UnorderedElementsAre(Key("20.20.20.20/16"_sub))); |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | TEST_F(TestEthernetInterface, CheckObjectPath) |
| 137 | { |
William A. Kennington III | 59e5b91 | 2022-11-02 02:49:46 -0700 | [diff] [blame] | 138 | auto path = createIPObject(IP::Protocol::IPv4, "10.10.10.10", 16); |
| 139 | EXPECT_EQ(path.parent_path(), "/xyz/openbmc_test/network/test0"); |
| 140 | EXPECT_EQ(path.filename(), "10.10.10.10/16"); |
Ratan Gupta | 47722dc | 2017-05-26 18:32:23 +0530 | [diff] [blame] | 141 | } |
| 142 | |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 143 | TEST_F(TestEthernetInterface, addStaticNameServers) |
Ratan Gupta | 09f6157 | 2017-08-23 16:53:52 +0530 | [diff] [blame] | 144 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 145 | ServerList servers = {"9.1.1.1", "9.2.2.2", "9.3.3.3"}; |
William A. Kennington III | de70ccf | 2022-11-20 17:18:01 -0800 | [diff] [blame] | 146 | EXPECT_CALL(manager.mockReload, schedule()); |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 147 | interface.staticNameServers(servers); |
William A. Kennington III | 5b17938 | 2022-11-15 15:23:26 -0800 | [diff] [blame] | 148 | config::Parser parser((confDir / "00-bmc-test0.network").native()); |
William A. Kennington III | 34bb3e2 | 2022-08-18 15:17:22 -0700 | [diff] [blame] | 149 | EXPECT_EQ(servers, parser.map.getValueStrings("Network", "DNS")); |
Ratan Gupta | 09f6157 | 2017-08-23 16:53:52 +0530 | [diff] [blame] | 150 | } |
| 151 | |
Manojkiran Eda | acd6dd5 | 2019-10-15 15:00:51 +0530 | [diff] [blame] | 152 | TEST_F(TestEthernetInterface, getDynamicNameServers) |
| 153 | { |
| 154 | ServerList servers = {"9.1.1.1", "9.2.2.2", "9.3.3.3"}; |
| 155 | EXPECT_CALL(interface, getNameServerFromResolvd()) |
| 156 | .WillRepeatedly(testing::Return(servers)); |
| 157 | EXPECT_EQ(interface.getNameServerFromResolvd(), servers); |
| 158 | } |
| 159 | |
Asmitha Karunanithi | 003b8b7 | 2022-01-06 04:17:59 -0600 | [diff] [blame] | 160 | TEST_F(TestEthernetInterface, addStaticNTPServers) |
Ratan Gupta | c9645fe | 2017-08-23 16:53:52 +0530 | [diff] [blame] | 161 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 162 | ServerList servers = {"10.1.1.1", "10.2.2.2", "10.3.3.3"}; |
William A. Kennington III | de70ccf | 2022-11-20 17:18:01 -0800 | [diff] [blame] | 163 | EXPECT_CALL(manager.mockReload, schedule()); |
Asmitha Karunanithi | 003b8b7 | 2022-01-06 04:17:59 -0600 | [diff] [blame] | 164 | interface.staticNTPServers(servers); |
William A. Kennington III | 5b17938 | 2022-11-15 15:23:26 -0800 | [diff] [blame] | 165 | config::Parser parser((confDir / "00-bmc-test0.network").native()); |
William A. Kennington III | 34bb3e2 | 2022-08-18 15:17:22 -0700 | [diff] [blame] | 166 | EXPECT_EQ(servers, parser.map.getValueStrings("Network", "NTP")); |
Ratan Gupta | c9645fe | 2017-08-23 16:53:52 +0530 | [diff] [blame] | 167 | } |
| 168 | |
Asmitha Karunanithi | 003b8b7 | 2022-01-06 04:17:59 -0600 | [diff] [blame] | 169 | TEST_F(TestEthernetInterface, addNTPServers) |
| 170 | { |
| 171 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
| 172 | ServerList servers = {"10.1.1.1", "10.2.2.2", "10.3.3.3"}; |
| 173 | EXPECT_THROW(interface.ntpServers(servers), NotAllowed); |
| 174 | } |
| 175 | |
| 176 | TEST_F(TestEthernetInterface, getNTPServers) |
| 177 | { |
| 178 | ServerList servers = {"10.1.1.1", "10.2.2.2", "10.3.3.3"}; |
| 179 | setNtpServers(); |
| 180 | EXPECT_EQ(getNtpServers(), servers); |
| 181 | } |
| 182 | |
Ravi Teja | a5a0944 | 2020-07-17 00:57:33 -0500 | [diff] [blame] | 183 | TEST_F(TestEthernetInterface, addGateway) |
| 184 | { |
| 185 | std::string gateway = "10.3.3.3"; |
| 186 | interface.defaultGateway(gateway); |
| 187 | EXPECT_EQ(interface.defaultGateway(), gateway); |
William A. Kennington III | bbf5e9e | 2023-02-01 14:58:38 -0800 | [diff] [blame] | 188 | EXPECT_THROW(interface.defaultGateway6("127.0.0.10"), InvalidArgument); |
| 189 | EXPECT_THROW(interface.defaultGateway6("0.0.0.0"), InvalidArgument); |
| 190 | EXPECT_THROW(interface.defaultGateway6("224.1.0.0"), InvalidArgument); |
| 191 | EXPECT_EQ(interface.defaultGateway(), gateway); |
Jiaqing Zhao | c2e061f | 2022-04-07 21:55:48 +0800 | [diff] [blame] | 192 | interface.defaultGateway(""); |
| 193 | EXPECT_EQ(interface.defaultGateway(), ""); |
William A. Kennington III | 9ca5c8e | 2022-12-14 14:40:52 -0800 | [diff] [blame] | 194 | interface.defaultGateway("0.0.0.0"); |
| 195 | EXPECT_EQ(interface.defaultGateway(), ""); |
Ravi Teja | a5a0944 | 2020-07-17 00:57:33 -0500 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | TEST_F(TestEthernetInterface, addGateway6) |
| 199 | { |
William A. Kennington III | bbf5e9e | 2023-02-01 14:58:38 -0800 | [diff] [blame] | 200 | std::string gateway6 = "fe80::1"; |
Ravi Teja | a5a0944 | 2020-07-17 00:57:33 -0500 | [diff] [blame] | 201 | interface.defaultGateway6(gateway6); |
| 202 | EXPECT_EQ(interface.defaultGateway6(), gateway6); |
William A. Kennington III | bbf5e9e | 2023-02-01 14:58:38 -0800 | [diff] [blame] | 203 | EXPECT_THROW(interface.defaultGateway6("::1"), InvalidArgument); |
| 204 | EXPECT_EQ(interface.defaultGateway6(), gateway6); |
Jiaqing Zhao | c2e061f | 2022-04-07 21:55:48 +0800 | [diff] [blame] | 205 | interface.defaultGateway6(""); |
| 206 | EXPECT_EQ(interface.defaultGateway6(), ""); |
William A. Kennington III | 9ca5c8e | 2022-12-14 14:40:52 -0800 | [diff] [blame] | 207 | interface.defaultGateway6("::"); |
| 208 | EXPECT_EQ(interface.defaultGateway6(), ""); |
Ravi Teja | a5a0944 | 2020-07-17 00:57:33 -0500 | [diff] [blame] | 209 | } |
| 210 | |
William A. Kennington III | 8060c0d | 2022-08-18 19:19:34 -0700 | [diff] [blame] | 211 | TEST_F(TestEthernetInterface, DHCPEnabled) |
| 212 | { |
William A. Kennington III | de70ccf | 2022-11-20 17:18:01 -0800 | [diff] [blame] | 213 | EXPECT_CALL(manager.mockReload, schedule()) |
| 214 | .WillRepeatedly(testing::Return()); |
William A. Kennington III | 8060c0d | 2022-08-18 19:19:34 -0700 | [diff] [blame] | 215 | |
| 216 | using DHCPConf = EthernetInterfaceIntf::DHCPConf; |
| 217 | auto test = [&](DHCPConf conf, bool dhcp4, bool dhcp6, bool ra) { |
| 218 | EXPECT_EQ(conf, interface.dhcpEnabled()); |
| 219 | EXPECT_EQ(dhcp4, interface.dhcp4()); |
| 220 | EXPECT_EQ(dhcp6, interface.dhcp6()); |
| 221 | EXPECT_EQ(ra, interface.ipv6AcceptRA()); |
| 222 | }; |
| 223 | test(DHCPConf::both, /*dhcp4=*/true, /*dhcp6=*/true, /*ra=*/true); |
| 224 | |
| 225 | auto set_test = [&](DHCPConf conf, bool dhcp4, bool dhcp6, bool ra) { |
| 226 | EXPECT_EQ(conf, interface.dhcpEnabled(conf)); |
| 227 | test(conf, dhcp4, dhcp6, ra); |
| 228 | }; |
| 229 | set_test(DHCPConf::none, /*dhcp4=*/false, /*dhcp6=*/false, /*ra=*/false); |
| 230 | set_test(DHCPConf::v4, /*dhcp4=*/true, /*dhcp6=*/false, /*ra=*/false); |
| 231 | set_test(DHCPConf::v6stateless, /*dhcp4=*/false, /*dhcp6=*/false, |
| 232 | /*ra=*/true); |
| 233 | set_test(DHCPConf::v6, /*dhcp4=*/false, /*dhcp6=*/true, /*ra=*/true); |
| 234 | set_test(DHCPConf::v4v6stateless, /*dhcp4=*/true, /*dhcp6=*/false, |
| 235 | /*ra=*/true); |
| 236 | set_test(DHCPConf::both, /*dhcp4=*/true, /*dhcp6=*/true, /*ra=*/true); |
| 237 | |
| 238 | auto ind_test = [&](DHCPConf conf, bool dhcp4, bool dhcp6, bool ra) { |
| 239 | EXPECT_EQ(dhcp4, interface.dhcp4(dhcp4)); |
| 240 | EXPECT_EQ(dhcp6, interface.dhcp6(dhcp6)); |
| 241 | EXPECT_EQ(ra, interface.ipv6AcceptRA(ra)); |
| 242 | test(conf, dhcp4, dhcp6, ra); |
| 243 | }; |
| 244 | ind_test(DHCPConf::none, /*dhcp4=*/false, /*dhcp6=*/false, /*ra=*/false); |
| 245 | ind_test(DHCPConf::v4, /*dhcp4=*/true, /*dhcp6=*/false, /*ra=*/false); |
| 246 | ind_test(DHCPConf::v6stateless, /*dhcp4=*/false, /*dhcp6=*/false, |
| 247 | /*ra=*/true); |
| 248 | ind_test(DHCPConf::v6, /*dhcp4=*/false, /*dhcp6=*/true, /*ra=*/false); |
| 249 | set_test(DHCPConf::v6, /*dhcp4=*/false, /*dhcp6=*/true, /*ra=*/true); |
| 250 | ind_test(DHCPConf::v4v6stateless, /*dhcp4=*/true, /*dhcp6=*/false, |
| 251 | /*ra=*/true); |
| 252 | ind_test(DHCPConf::both, /*dhcp4=*/true, /*dhcp6=*/true, /*ra=*/false); |
| 253 | set_test(DHCPConf::both, /*dhcp4=*/true, /*dhcp6=*/true, /*ra=*/true); |
| 254 | } |
| 255 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 256 | } // namespace network |
| 257 | } // namespace phosphor |