host_options_unittest.cc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. // Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. #include <config.h>
  7. #include <asiolink/io_address.h>
  8. #include <dhcp/dhcp4.h>
  9. #include <dhcp/docsis3_option_defs.h>
  10. #include <dhcp/option_int.h>
  11. #include <dhcp/option_vendor.h>
  12. #include <dhcp/tests/iface_mgr_test_config.h>
  13. #include <dhcp4/tests/dhcp4_test_utils.h>
  14. #include <dhcp4/tests/dhcp4_client.h>
  15. #include <stats/stats_mgr.h>
  16. using namespace isc;
  17. using namespace isc::asiolink;
  18. using namespace isc::dhcp;
  19. using namespace isc::dhcp::test;
  20. namespace {
  21. /// @brief Boolean value used to signal stateless configuration test.
  22. const bool STATELESS = true;
  23. /// @brief Boolean value used to signal stateful configuration test.
  24. const bool STATEFUL = false;
  25. /// @brief Set of JSON configurations used throughout the tests.
  26. ///
  27. /// - Configuration 0:
  28. /// - Used to test that host specific options override subnet specific
  29. /// options when these options are requested with PRL option.
  30. /// - Single subnet 10.0.0.0/24 with a pool of 10.0.0.10-10.0.0.100
  31. /// - 4 options configured within subnet scope
  32. /// - routers: 10.0.0.200,10.0.0.201,
  33. /// - domain-name-servers: 10.0.0.202,10.0.0.203,
  34. /// - log-servers: 10.0.0.200,10.0.0.201,
  35. /// - cookie-servers: 10.0.0.202,10.0.0.203
  36. /// - Single reservation within the subnet:
  37. /// - HW address: aa:bb:cc:dd:ee:ff
  38. /// - ip-address: 10.0.0.7
  39. /// - Two options overriding subnet specific options:
  40. /// - cookie-servers: 10.1.1.202, 10.1.1.203
  41. /// - log-servers: 10.1.1.200, 10.1.1.201
  42. ///
  43. /// - Configuration 1:
  44. /// - Used to test that host specific options override subnet specific
  45. /// default options. Default options are those that are sent even when
  46. /// not requested by a client.
  47. /// - Single subnet 10.0.0.0/24 with a pool of 10.0.0.10-10.0.0.100
  48. /// - 4 options configured within subnet scope
  49. /// - routers: 10.0.0.200,10.0.0.201,
  50. /// - domain-name-servers: 10.0.0.202,10.0.0.203,
  51. /// - log-servers: 10.0.0.200,10.0.0.201,
  52. /// - cookie-servers: 10.0.0.202,10.0.0.203
  53. /// - Single reservation within the subnet:
  54. /// - HW address: aa:bb:cc:dd:ee:ff
  55. /// - ip-address: 10.0.0.7
  56. /// - Two options overriding subnet specific default options:
  57. /// - routers: 10.1.1.200, 10.1.1.201
  58. /// - domain-name-servers: 10.1.1.202, 10.1.1.203
  59. ///
  60. /// - Configuration 2:
  61. /// - Used to test that client receives options solely specified in a
  62. /// host scope.
  63. /// - Single reservation within the subnet:
  64. /// - HW address: aa:bb:cc:dd:ee:ff
  65. /// - ip-address: 10.0.0.7
  66. /// - Two options:
  67. /// - routers: 10.1.1.200, 10.1.1.201
  68. /// - cookie-servers: 10.1.1.202, 10.1.1.203
  69. ///
  70. /// - Configuration 3:
  71. /// - Used to test that host specific vendor options override globally
  72. /// specified vendor options.
  73. /// - Globally specified option 125 with Cable Labs vendor id.
  74. /// - TFTP servers sub option: 10.0.0.202,10.0.0.203
  75. /// - Single subnet 10.0.0.0/24 with a pool of 10.0.0.10-10.0.0.100
  76. /// - Single reservation within the subnet:
  77. /// - HW address: aa:bb:cc:dd:ee:ff
  78. /// - ip-address 10.0.0.7
  79. /// - Vendor option for Cable Labs vendor id specified for the reservation:
  80. /// - TFTP servers suboption overriding globally specified suboption:
  81. /// 10.1.1.202,10.1.1.203
  82. ///
  83. const char* HOST_CONFIGS[] = {
  84. // Configuration 0
  85. "{ \"interfaces-config\": {"
  86. " \"interfaces\": [ \"*\" ]"
  87. "},"
  88. "\"valid-lifetime\": 600,"
  89. "\"subnet4\": [ { "
  90. " \"subnet\": \"10.0.0.0/24\", "
  91. " \"id\": 1,"
  92. " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
  93. " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
  94. " \"option-data\": [ {"
  95. " \"name\": \"routers\","
  96. " \"data\": \"10.0.0.200,10.0.0.201\""
  97. " },"
  98. " {"
  99. " \"name\": \"domain-name-servers\","
  100. " \"data\": \"10.0.0.202,10.0.0.203\""
  101. " },"
  102. " {"
  103. " \"name\": \"log-servers\","
  104. " \"data\": \"10.0.0.204,10.0.0.205\""
  105. " },"
  106. " {"
  107. " \"name\": \"cookie-servers\","
  108. " \"data\": \"10.0.0.206,10.0.0.207\""
  109. " } ],"
  110. " \"reservations\": [ "
  111. " {"
  112. " \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
  113. " \"ip-address\": \"10.0.0.7\","
  114. " \"option-data\": [ {"
  115. " \"name\": \"cookie-servers\","
  116. " \"data\": \"10.1.1.202,10.1.1.203\""
  117. " },"
  118. " {"
  119. " \"name\": \"log-servers\","
  120. " \"data\": \"10.1.1.200,10.1.1.201\""
  121. " } ]"
  122. " } ]"
  123. " } ]"
  124. "}",
  125. // Configuration 1
  126. "{ \"interfaces-config\": {"
  127. " \"interfaces\": [ \"*\" ]"
  128. "},"
  129. "\"valid-lifetime\": 600,"
  130. "\"subnet4\": [ { "
  131. " \"subnet\": \"10.0.0.0/24\", "
  132. " \"id\": 1,"
  133. " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
  134. " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
  135. " \"option-data\": [ {"
  136. " \"name\": \"routers\","
  137. " \"data\": \"10.0.0.200,10.0.0.201\""
  138. " },"
  139. " {"
  140. " \"name\": \"domain-name-servers\","
  141. " \"data\": \"10.0.0.202,10.0.0.203\""
  142. " },"
  143. " {"
  144. " \"name\": \"log-servers\","
  145. " \"data\": \"10.0.0.204,10.0.0.205\""
  146. " },"
  147. " {"
  148. " \"name\": \"cookie-servers\","
  149. " \"data\": \"10.0.0.206,10.0.0.207\""
  150. " } ],"
  151. " \"reservations\": [ "
  152. " {"
  153. " \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
  154. " \"ip-address\": \"10.0.0.7\","
  155. " \"option-data\": [ {"
  156. " \"name\": \"routers\","
  157. " \"data\": \"10.1.1.200,10.1.1.201\""
  158. " },"
  159. " {"
  160. " \"name\": \"domain-name-servers\","
  161. " \"data\": \"10.1.1.202,10.1.1.203\""
  162. " } ]"
  163. " } ]"
  164. " } ]"
  165. "}",
  166. // Configuration 2
  167. "{ \"interfaces-config\": {"
  168. " \"interfaces\": [ \"*\" ]"
  169. "},"
  170. "\"valid-lifetime\": 600,"
  171. "\"subnet4\": [ { "
  172. " \"subnet\": \"10.0.0.0/24\", "
  173. " \"id\": 1,"
  174. " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
  175. " \"reservations\": [ "
  176. " {"
  177. " \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
  178. " \"ip-address\": \"10.0.0.7\","
  179. " \"option-data\": [ {"
  180. " \"name\": \"routers\","
  181. " \"data\": \"10.1.1.200,10.1.1.201\""
  182. " },"
  183. " {"
  184. " \"name\": \"cookie-servers\","
  185. " \"data\": \"10.1.1.206,10.1.1.207\""
  186. " } ]"
  187. " } ]"
  188. " } ]"
  189. "}",
  190. // Configuration 3
  191. "{ \"interfaces-config\": {"
  192. " \"interfaces\": [ \"*\" ]"
  193. "},"
  194. "\"valid-lifetime\": 600,"
  195. "\"option-data\": [ {"
  196. " \"name\": \"vivso-suboptions\","
  197. " \"data\": \"4491\""
  198. "},"
  199. "{"
  200. " \"name\": \"tftp-servers\","
  201. " \"space\": \"vendor-4491\","
  202. " \"data\": \"10.0.0.202,10.0.0.203\""
  203. "} ],"
  204. "\"subnet4\": [ { "
  205. " \"subnet\": \"10.0.0.0/24\", "
  206. " \"id\": 1,"
  207. " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
  208. " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
  209. " \"reservations\": [ "
  210. " {"
  211. " \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
  212. " \"ip-address\": \"10.0.0.7\","
  213. " \"option-data\": [ {"
  214. " \"name\": \"vivso-suboptions\","
  215. " \"data\": \"4491\""
  216. " },"
  217. " {"
  218. " \"name\": \"tftp-servers\","
  219. " \"space\": \"vendor-4491\","
  220. " \"data\": \"10.1.1.202,10.1.1.203\""
  221. " } ]"
  222. " } ]"
  223. " } ]"
  224. "}"
  225. };
  226. /// @brief Test fixture class for testing static reservations of options.
  227. class HostOptionsTest : public Dhcpv4SrvTest {
  228. public:
  229. /// @brief Constructor.
  230. ///
  231. /// Sets up fake interfaces.
  232. HostOptionsTest()
  233. : Dhcpv4SrvTest(),
  234. iface_mgr_test_config_(true) {
  235. IfaceMgr::instance().openSockets4();
  236. }
  237. /// @brief Verifies that host specific options override subnet specific
  238. /// options.
  239. ///
  240. /// Overridden options are requested with Parameter Request List
  241. /// option.
  242. ///
  243. /// @param stateless Boolean value indicating if stateless or stateful
  244. /// configuration should be performed.
  245. void testOverrideRequestedOptions(const bool stateless);
  246. /// @brief Verifies that host specific options override subnet specific
  247. /// options.
  248. ///
  249. /// Overridden options are the options which server sends regardless
  250. /// if they are requested with Parameter Request List option or not.
  251. ///
  252. /// @param stateless Boolean value indicating if stateless or stateful
  253. /// configuration should be performed.
  254. void testOverrideDefaultOptions(const bool stateless);
  255. /// @brief Verifies that client receives options when they are solely
  256. /// defined in the host scope (and not in the global or subnet scope).
  257. ///
  258. /// @param stateless Boolean value indicating if stateless or stateful
  259. /// configuration should be performed.
  260. void testHostOnlyOptions(const bool stateless);
  261. /// @brief Verifies that host specific vendor options override vendor
  262. /// options defined in the global scope.
  263. ///
  264. /// @param stateless Boolean value indicating if stateless or stateful
  265. /// configuration should be performed.
  266. void testOverrideVendorOptions(const bool stateless);
  267. /// @brief Interface Manager's fake configuration control.
  268. IfaceMgrTestConfig iface_mgr_test_config_;
  269. };
  270. void
  271. HostOptionsTest::testOverrideRequestedOptions(const bool stateless) {
  272. Dhcp4Client client(Dhcp4Client::SELECTING);
  273. client.setHWAddress("aa:bb:cc:dd:ee:ff");
  274. client.requestOptions(DHO_DOMAIN_NAME_SERVERS, DHO_LOG_SERVERS,
  275. DHO_COOKIE_SERVERS);
  276. // Configure DHCP server.
  277. configure(HOST_CONFIGS[0], *client.getServer());
  278. if (stateless) {
  279. // Need to relay the message from a specific address which can
  280. // be matched with a configured subnet.
  281. client.useRelay(true, IOAddress("10.0.0.233"));
  282. ASSERT_NO_THROW(client.doInform());
  283. } else {
  284. // Perform 4-way exchange with the server but to not request any
  285. // specific address in the DHCPDISCOVER message.
  286. ASSERT_NO_THROW(client.doDORA());
  287. }
  288. // Make sure that the server responded.
  289. ASSERT_TRUE(client.getContext().response_);
  290. Pkt4Ptr resp = client.getContext().response_;
  291. // Make sure that the server has responded with DHCPACK.
  292. ASSERT_EQ(DHCPACK, static_cast<int>(resp->getType()));
  293. if (!stateless) {
  294. // Make sure that the client has got the lease for the reserved
  295. // address.
  296. ASSERT_EQ("10.0.0.7", client.config_.lease_.addr_.toText());
  297. }
  298. ASSERT_EQ(2, client.config_.routers_.size());
  299. EXPECT_EQ("10.0.0.200", client.config_.routers_[0].toText());
  300. EXPECT_EQ("10.0.0.201", client.config_.routers_[1].toText());
  301. // Make sure that the DNS Servers option has been received.
  302. ASSERT_EQ(2, client.config_.dns_servers_.size());
  303. EXPECT_EQ("10.0.0.202", client.config_.dns_servers_[0].toText());
  304. EXPECT_EQ("10.0.0.203", client.config_.dns_servers_[1].toText());
  305. // Make sure that the Quotes Servers option has been received.
  306. ASSERT_EQ(2, client.config_.quotes_servers_.size());
  307. EXPECT_EQ("10.1.1.202", client.config_.quotes_servers_[0].toText());
  308. EXPECT_EQ("10.1.1.203", client.config_.quotes_servers_[1].toText());
  309. // Make sure that the Log Servers option has been received.
  310. ASSERT_EQ(2, client.config_.log_servers_.size());
  311. EXPECT_EQ("10.1.1.200", client.config_.log_servers_[0].toText());
  312. EXPECT_EQ("10.1.1.201", client.config_.log_servers_[1].toText());
  313. }
  314. void
  315. HostOptionsTest::testOverrideDefaultOptions(const bool stateless) {
  316. Dhcp4Client client(Dhcp4Client::SELECTING);
  317. client.setHWAddress("aa:bb:cc:dd:ee:ff");
  318. client.requestOptions(DHO_LOG_SERVERS, DHO_COOKIE_SERVERS);
  319. // Configure DHCP server.
  320. configure(HOST_CONFIGS[1], *client.getServer());
  321. if (stateless) {
  322. // Need to relay the message from a specific address which can
  323. // be matched with a configured subnet.
  324. client.useRelay(true, IOAddress("10.0.0.233"));
  325. ASSERT_NO_THROW(client.doInform());
  326. } else {
  327. // Perform 4-way exchange with the server but to not request any
  328. // specific address in the DHCPDISCOVER message.
  329. ASSERT_NO_THROW(client.doDORA());
  330. }
  331. // Perform 4-way exchange with the server but to not request any
  332. // specific address in the DHCPDISCOVER message.
  333. ASSERT_NO_THROW(client.doDORA());
  334. // Make sure that the server responded.
  335. ASSERT_TRUE(client.getContext().response_);
  336. Pkt4Ptr resp = client.getContext().response_;
  337. // Make sure that the server has responded with DHCPACK.
  338. ASSERT_EQ(DHCPACK, static_cast<int>(resp->getType()));
  339. if (!stateless) {
  340. // Make sure that the client has got the lease for the reserved
  341. // address.
  342. ASSERT_EQ("10.0.0.7", client.config_.lease_.addr_.toText());
  343. }
  344. ASSERT_EQ(2, client.config_.routers_.size());
  345. EXPECT_EQ("10.1.1.200", client.config_.routers_[0].toText());
  346. EXPECT_EQ("10.1.1.201", client.config_.routers_[1].toText());
  347. // Make sure that the DNS Servers option has been received.
  348. ASSERT_EQ(2, client.config_.dns_servers_.size());
  349. EXPECT_EQ("10.1.1.202", client.config_.dns_servers_[0].toText());
  350. EXPECT_EQ("10.1.1.203", client.config_.dns_servers_[1].toText());
  351. // Make sure that the Quotes Servers option has been received.
  352. ASSERT_EQ(2, client.config_.quotes_servers_.size());
  353. EXPECT_EQ("10.0.0.206", client.config_.quotes_servers_[0].toText());
  354. EXPECT_EQ("10.0.0.207", client.config_.quotes_servers_[1].toText());
  355. // Make sure that the Log Servers option has been received.
  356. ASSERT_EQ(2, client.config_.log_servers_.size());
  357. EXPECT_EQ("10.0.0.204", client.config_.log_servers_[0].toText());
  358. EXPECT_EQ("10.0.0.205", client.config_.log_servers_[1].toText());
  359. }
  360. void
  361. HostOptionsTest::testHostOnlyOptions(const bool stateless) {
  362. Dhcp4Client client(Dhcp4Client::SELECTING);
  363. client.setHWAddress("aa:bb:cc:dd:ee:ff");
  364. client.requestOptions(DHO_COOKIE_SERVERS);
  365. // Configure DHCP server.
  366. configure(HOST_CONFIGS[2], *client.getServer());
  367. if (stateless) {
  368. // Need to relay the message from a specific address which can
  369. // be matched with a configured subnet.
  370. client.useRelay(true, IOAddress("10.0.0.233"));
  371. ASSERT_NO_THROW(client.doInform());
  372. } else {
  373. // Perform 4-way exchange with the server but to not request any
  374. // specific address in the DHCPDISCOVER message.
  375. ASSERT_NO_THROW(client.doDORA());
  376. }
  377. // Make sure that the server responded.
  378. ASSERT_TRUE(client.getContext().response_);
  379. Pkt4Ptr resp = client.getContext().response_;
  380. // Make sure that the server has responded with DHCPACK.
  381. ASSERT_EQ(DHCPACK, static_cast<int>(resp->getType()));
  382. if (!stateless) {
  383. // Make sure that the client has got the lease for the reserved
  384. // address.
  385. ASSERT_EQ("10.0.0.7", client.config_.lease_.addr_.toText());
  386. }
  387. // Make sure that the Routers options has been received.
  388. ASSERT_EQ(2, client.config_.routers_.size());
  389. EXPECT_EQ("10.1.1.200", client.config_.routers_[0].toText());
  390. EXPECT_EQ("10.1.1.201", client.config_.routers_[1].toText());
  391. // Make sure that the Quotes Servers option has been received.
  392. ASSERT_EQ(2, client.config_.quotes_servers_.size());
  393. EXPECT_EQ("10.1.1.206", client.config_.quotes_servers_[0].toText());
  394. EXPECT_EQ("10.1.1.207", client.config_.quotes_servers_[1].toText());
  395. // Other options are not configured and should not be delivered.
  396. EXPECT_EQ(0, client.config_.dns_servers_.size());
  397. EXPECT_EQ(0, client.config_.log_servers_.size());
  398. }
  399. void
  400. HostOptionsTest::testOverrideVendorOptions(const bool stateless) {
  401. Dhcp4Client client(Dhcp4Client::SELECTING);
  402. client.setHWAddress("aa:bb:cc:dd:ee:ff");
  403. // Client needs to include V-I Vendor Specific Information option
  404. // to include ORO suboption, which the server will use to determine
  405. // which suboptions should be returned to the client.
  406. OptionVendorPtr opt_vendor(new OptionVendor(Option::V4,
  407. VENDOR_ID_CABLE_LABS));
  408. // Include ORO with TFTP servers suboption code being requested.
  409. opt_vendor->addOption(OptionPtr(new OptionUint8(Option::V4, DOCSIS3_V4_ORO,
  410. DOCSIS3_V4_TFTP_SERVERS)));
  411. client.addExtraOption(opt_vendor);
  412. // Configure DHCP server.
  413. configure(HOST_CONFIGS[3], *client.getServer());
  414. if (stateless) {
  415. // Need to relay the message from a specific address which can
  416. // be matched with a configured subnet.
  417. client.useRelay(true, IOAddress("10.0.0.233"));
  418. ASSERT_NO_THROW(client.doInform());
  419. } else {
  420. // Perform 4-way exchange with the server.
  421. ASSERT_NO_THROW(client.doDORA());
  422. }
  423. // Make sure that the server responded.
  424. ASSERT_TRUE(client.getContext().response_);
  425. Pkt4Ptr resp = client.getContext().response_;
  426. // Make sure that the server has responded with DHCPACK.
  427. ASSERT_EQ(DHCPACK, static_cast<int>(resp->getType()));
  428. if (!stateless) {
  429. // Make sure that the client has got the lease for the reserved
  430. // address.
  431. ASSERT_EQ("10.0.0.7", client.config_.lease_.addr_.toText());
  432. }
  433. // Make sure the server has responded with a V-I Vendor Specific
  434. // Information option with exactly one suboption.
  435. ASSERT_EQ(1, client.config_.vendor_suboptions_.size());
  436. // Assume this suboption is a TFTP servers suboption.
  437. std::multimap<unsigned int, OptionPtr>::const_iterator opt =
  438. client.config_.vendor_suboptions_.find(DOCSIS3_V4_TFTP_SERVERS);
  439. ASSERT_TRUE(opt->second);
  440. Option4AddrLstPtr opt_tftp = boost::dynamic_pointer_cast<
  441. Option4AddrLst>(opt->second);
  442. ASSERT_TRUE(opt_tftp);
  443. // TFTP servers suboption should contain addresses specified on host level.
  444. const Option4AddrLst::AddressContainer& tftps = opt_tftp->getAddresses();
  445. ASSERT_EQ(2, tftps.size());
  446. EXPECT_EQ("10.1.1.202", tftps[0].toText());
  447. EXPECT_EQ("10.1.1.203", tftps[1].toText());
  448. }
  449. // This test checks that host specific options override subnet specific
  450. // options. Overridden options are requested with Parameter Request List
  451. // option (stateless case).
  452. TEST_F(HostOptionsTest, overrideRequestedOptionsStateless) {
  453. testOverrideRequestedOptions(STATELESS);
  454. }
  455. // This test checks that host specific options override subnet specific
  456. // options. Overridden options are requested with Parameter Request List
  457. // option (stateful case).
  458. TEST_F(HostOptionsTest, overrideRequestedOptionsStateful) {
  459. testOverrideRequestedOptions(STATEFUL);
  460. }
  461. // This test checks that host specific options override subnet specific
  462. // options. Overridden options are the options which server sends
  463. // regardless if they are requested with Parameter Request List option
  464. // or not (stateless case).
  465. TEST_F(HostOptionsTest, overrideDefaultOptionsStateless) {
  466. testOverrideDefaultOptions(STATELESS);
  467. }
  468. // This test checks that host specific options override subnet specific
  469. // options. Overridden options are the options which server sends
  470. // regardless if they are requested with Parameter Request List option
  471. // or not (stateful case).
  472. TEST_F(HostOptionsTest, overrideDefaultOptionsStateful) {
  473. testOverrideDefaultOptions(STATEFUL);
  474. }
  475. // This test checks that client receives options when they are
  476. // solely defined in the host scope and not in the global or subnet
  477. // scope (stateless case).
  478. TEST_F(HostOptionsTest, hostOnlyOptionsStateless) {
  479. testHostOnlyOptions(STATELESS);
  480. }
  481. // This test checks that client receives options when they are
  482. // solely defined in the host scope and not in the global or subnet
  483. // scope (stateful case).
  484. TEST_F(HostOptionsTest, hostOnlyOptionsStateful) {
  485. testHostOnlyOptions(STATEFUL);
  486. }
  487. // This test checks that host specific vendor options override vendor
  488. // options defined in the global scope (stateless case).
  489. TEST_F(HostOptionsTest, overrideVendorOptionsStateless) {
  490. testOverrideVendorOptions(STATELESS);
  491. }
  492. // This test checks that host specific vendor options override vendor
  493. // options defined in the global scope (stateful case).
  494. TEST_F(HostOptionsTest, overrideVendorOptionsStateful) {
  495. testOverrideVendorOptions(STATEFUL);
  496. }
  497. } // end of anonymous namespace