@@ -419,12 +419,16 @@ class SARRTest : public Dhcpv6SrvTest {
419
419
// / @brief This test verifies that it is possible to specify an excluded
420
420
// / prefix (RFC 6603) and send it back to the client requesting prefix
421
421
// / delegation using a pool.
422
- void directClientExcludedPrefixPool ();
422
+ // /
423
+ // / @param request_pdx request pd exclude option.
424
+ void directClientExcludedPrefixPool (bool request_pdx);
423
425
424
426
// / @brief This test verifies that it is possible to specify an excluded
425
427
// / prefix (RFC 6603) and send it back to the client requesting prefix
426
428
// / delegation using a reservation.
427
- void directClientExcludedPrefixHost ();
429
+ // /
430
+ // / @param request_pdx request pd exclude option.
431
+ void directClientExcludedPrefixHost (bool request_pdx);
428
432
429
433
// / @brief Check that when the client includes the Rapid Commit option in
430
434
// / its Solicit, the server responds with Reply and commits the lease.
@@ -682,11 +686,14 @@ TEST_F(SARRTest, optionsInheritanceMultiThreading) {
682
686
}
683
687
684
688
void
685
- SARRTest::directClientExcludedPrefixPool () {
689
+ SARRTest::directClientExcludedPrefixPool (bool request_pdx ) {
686
690
Dhcp6Client client;
687
691
// Configure client to request IA_PD.
688
692
client.requestPrefix ();
689
- client.requestOption (D6O_PD_EXCLUDE);
693
+ // Request pd exclude option when wanted.
694
+ if (request_pdx) {
695
+ client.requestOption (D6O_PD_EXCLUDE);
696
+ }
690
697
configure (CONFIGS[3 ], *client.getServer ());
691
698
// Make sure we ended-up having expected number of subnets configured.
692
699
const Subnet6Collection* subnets = CfgMgr::instance ().getCurrentCfg ()->
@@ -713,6 +720,10 @@ SARRTest::directClientExcludedPrefixPool() {
713
720
Option6IAPrefixPtr pd_option = boost::dynamic_pointer_cast<Option6IAPrefix>(option);
714
721
ASSERT_TRUE (pd_option);
715
722
option = pd_option->getOption (D6O_PD_EXCLUDE);
723
+ if (!request_pdx) {
724
+ EXPECT_FALSE (option);
725
+ return ;
726
+ }
716
727
ASSERT_TRUE (option);
717
728
Option6PDExcludePtr pd_exclude = boost::dynamic_pointer_cast<Option6PDExclude>(option);
718
729
ASSERT_TRUE (pd_exclude);
@@ -723,22 +734,35 @@ SARRTest::directClientExcludedPrefixPool() {
723
734
724
735
TEST_F (SARRTest, directClientExcludedPrefixPool) {
725
736
Dhcpv6SrvMTTestGuard guard (*this , false );
726
- directClientExcludedPrefixPool ();
737
+ directClientExcludedPrefixPool (true );
727
738
}
728
739
729
740
TEST_F (SARRTest, directClientExcludedPrefixPoolMultiThreading) {
730
741
Dhcpv6SrvMTTestGuard guard (*this , true );
731
- directClientExcludedPrefixPool ();
742
+ directClientExcludedPrefixPool (true );
743
+ }
744
+
745
+ TEST_F (SARRTest, directClientExcludedPrefixPoolNoOro) {
746
+ Dhcpv6SrvMTTestGuard guard (*this , false );
747
+ directClientExcludedPrefixPool (false );
748
+ }
749
+
750
+ TEST_F (SARRTest, directClientExcludedPrefixPoolNoOroMultiThreading) {
751
+ Dhcpv6SrvMTTestGuard guard (*this , true );
752
+ directClientExcludedPrefixPool (false );
732
753
}
733
754
734
755
void
735
- SARRTest::directClientExcludedPrefixHost () {
756
+ SARRTest::directClientExcludedPrefixHost (bool request_pdx ) {
736
757
Dhcp6Client client;
737
758
// Set DUID matching the one used to create host reservations.
738
759
client.setDUID (" 01:02:03:05" );
739
760
// Configure client to request IA_PD.
740
761
client.requestPrefix ();
741
- client.requestOption (D6O_PD_EXCLUDE);
762
+ // Request pd exclude option when wanted.
763
+ if (request_pdx) {
764
+ client.requestOption (D6O_PD_EXCLUDE);
765
+ }
742
766
configure (CONFIGS[8 ], *client.getServer ());
743
767
// Make sure we ended-up having expected number of subnets configured.
744
768
const Subnet6Collection* subnets = CfgMgr::instance ().getCurrentCfg ()->
@@ -765,6 +789,10 @@ SARRTest::directClientExcludedPrefixHost() {
765
789
Option6IAPrefixPtr pd_option = boost::dynamic_pointer_cast<Option6IAPrefix>(option);
766
790
ASSERT_TRUE (pd_option);
767
791
option = pd_option->getOption (D6O_PD_EXCLUDE);
792
+ if (!request_pdx) {
793
+ EXPECT_FALSE (option);
794
+ return ;
795
+ }
768
796
ASSERT_TRUE (option);
769
797
Option6PDExcludePtr pd_exclude = boost::dynamic_pointer_cast<Option6PDExclude>(option);
770
798
ASSERT_TRUE (pd_exclude);
@@ -775,12 +803,22 @@ SARRTest::directClientExcludedPrefixHost() {
775
803
776
804
TEST_F (SARRTest, directClientExcludedPrefixHost) {
777
805
Dhcpv6SrvMTTestGuard guard (*this , false );
778
- directClientExcludedPrefixHost ();
806
+ directClientExcludedPrefixHost (true );
779
807
}
780
808
781
809
TEST_F (SARRTest, directClientExcludedPrefixHostMultiThreading) {
782
810
Dhcpv6SrvMTTestGuard guard (*this , true );
783
- directClientExcludedPrefixHost ();
811
+ directClientExcludedPrefixHost (true );
812
+ }
813
+
814
+ TEST_F (SARRTest, directClientExcludedPrefixHostNoOro) {
815
+ Dhcpv6SrvMTTestGuard guard (*this , false );
816
+ directClientExcludedPrefixHost (false );
817
+ }
818
+
819
+ TEST_F (SARRTest, directClientExcludedPrefixHostNoOroMultiThreading) {
820
+ Dhcpv6SrvMTTestGuard guard (*this , true );
821
+ directClientExcludedPrefixHost (false );
784
822
}
785
823
786
824
void
0 commit comments