From: Tomek Mrugalski Date: Wed, 28 Jan 2015 13:33:28 +0000 (+0100) Subject: [2949] Inf-Request unit-tests updated. X-Git-Tag: trac3712_base~23^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d23b59a9bfd50729eb79559faf4b169105da20c;p=thirdparty%2Fkea.git [2949] Inf-Request unit-tests updated. --- diff --git a/src/bin/dhcp6/tests/infrequest_unittest.cc b/src/bin/dhcp6/tests/infrequest_unittest.cc index cd988aa599..b6a6555970 100644 --- a/src/bin/dhcp6/tests/infrequest_unittest.cc +++ b/src/bin/dhcp6/tests/infrequest_unittest.cc @@ -145,6 +145,17 @@ TEST_F(InfRequestTest, infRequestBasic) { Pkt6Ptr response = client.getContext().response_; ASSERT_TRUE(response); + // Check that it contains our client-id + OptionPtr client_id = response->getOption(D6O_CLIENTID); + ASSERT_TRUE(client_id); + EXPECT_EQ(client_id, client.getClientId()); + + // Check that it contains proper server-id + OptionPtr server_id = response->getOption(D6O_SERVERID); + ASSERT_TRUE(server_id); + EXPECT_EQ(server_id, client.getServer()->getServerID()); + + // Check that we received requested DNS servers option Option6AddrLstPtr dns = boost::dynamic_pointer_cast (response->getOption(D6O_NAME_SERVERS)); ASSERT_TRUE(dns); @@ -176,6 +187,7 @@ TEST_F(InfRequestTest, infRequestAnonymous) { Pkt6Ptr response = client.getContext().response_; ASSERT_TRUE(response); + // Check that we received the requested DNS servers option Option6AddrLstPtr dns = boost::dynamic_pointer_cast (response->getOption(D6O_NAME_SERVERS)); ASSERT_TRUE(dns); @@ -205,6 +217,7 @@ TEST_F(InfRequestTest, infRequestStateless) { Pkt6Ptr response = client.getContext().response_; ASSERT_TRUE(response); + // Check that we received the requested SIP servers option Option6AddrLstPtr sip = boost::dynamic_pointer_cast (response->getOption(D6O_SIP_SERVERS_ADDR)); ASSERT_TRUE(sip); @@ -234,7 +247,7 @@ TEST_F(InfRequestTest, infRequestSubnetAndGlobal) { Pkt6Ptr response = client.getContext().response_; ASSERT_TRUE(response); - // Check sip servers + // Check that we received the requested sip servers option Option6AddrLstPtr sip = boost::dynamic_pointer_cast (response->getOption(D6O_SIP_SERVERS_ADDR)); ASSERT_TRUE(sip); @@ -242,7 +255,7 @@ TEST_F(InfRequestTest, infRequestSubnetAndGlobal) { ASSERT_EQ(1, addrs.size()); EXPECT_EQ("2001:db8::1", addrs[0].toText()); - // Check dns servers + // Check that we received the requested dns servers option Option6AddrLstPtr dns = boost::dynamic_pointer_cast (response->getOption(D6O_NAME_SERVERS)); ASSERT_TRUE(dns); @@ -271,7 +284,7 @@ TEST_F(InfRequestTest, infRequestNoSubnets) { Pkt6Ptr response = client.getContext().response_; ASSERT_TRUE(response); - // Check sip servers + // Check that we received the requested sip servers option Option6AddrLstPtr nis = boost::dynamic_pointer_cast (response->getOption(D6O_NIS_SERVERS)); ASSERT_TRUE(nis);