@@ -160,7 +160,6 @@ TEST_F(NetworkTest, hrModeFromString) {
160160// network parameters.
161161TEST_F (NetworkTest, inheritanceSupport4) {
162162 // Set global values for each parameter.
163- globals_->set (" interface" , Element::create (" g" ));
164163 globals_->set (" valid-lifetime" , Element::create (80 ));
165164 globals_->set (" renew-timer" , Element::create (80 ));
166165 globals_->set (" rebind-timer" , Element::create (80 ));
@@ -186,11 +185,6 @@ TEST_F(NetworkTest, inheritanceSupport4) {
186185 // For each parameter for which inheritance is supported run
187186 // the test that checks if the values are inherited properly.
188187
189- {
190- SCOPED_TRACE (" interface" );
191- testNetworkInheritance<TestNetwork>(&Network::getIface, &Network::setIface,
192- " n" , " g" );
193- }
194188 {
195189 SCOPED_TRACE (" client_class" );
196190 testNetworkInheritance<TestNetwork>(&Network::getClientClass,
@@ -458,79 +452,79 @@ TEST_F(NetworkTest, inheritanceSupport6) {
458452// parent no global value exists.
459453TEST_F (NetworkTest, getPropertyNoParentNoChild) {
460454 NetworkPtr net_child (new Network ());
461- EXPECT_TRUE (net_child->getIface ().unspecified ());
455+ EXPECT_TRUE (net_child->getValid ().unspecified ());
462456}
463457
464458// Test that child network returns specified value.
465459TEST_F (NetworkTest, getPropertyNoParentChild) {
466460 NetworkPtr net_child (new Network ());
467- net_child->setIface ( " child_iface " );
461+ net_child->setValid ( 12345 );
468462
469- EXPECT_FALSE (net_child->getIface ().unspecified ());
470- EXPECT_FALSE (net_child->getIface (Network::Inheritance::NONE).unspecified ());
471- EXPECT_TRUE (net_child->getIface (Network::Inheritance::PARENT_NETWORK).unspecified ());
472- EXPECT_TRUE (net_child->getIface (Network::Inheritance::GLOBAL).unspecified ());
463+ EXPECT_FALSE (net_child->getValid ().unspecified ());
464+ EXPECT_FALSE (net_child->getValid (Network::Inheritance::NONE).unspecified ());
465+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::PARENT_NETWORK).unspecified ());
466+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::GLOBAL).unspecified ());
473467
474- EXPECT_EQ (" child_iface " , net_child->getIface (Network::Inheritance::NONE).get ());
475- EXPECT_EQ (" child_iface " , net_child->getIface ().get ());
468+ EXPECT_EQ (12345 , net_child->getValid (Network::Inheritance::NONE).get ());
469+ EXPECT_EQ (12345 , net_child->getValid ().get ());
476470}
477471
478472// Test that parent specific value is returned when the value
479473// is not specified for the child network.
480474TEST_F (NetworkTest, getPropertyParentNoChild) {
481475 TestNetworkPtr net_child (new TestNetwork ());
482- EXPECT_TRUE (net_child->getIface ().unspecified ());
476+ EXPECT_TRUE (net_child->getValid ().unspecified ());
483477
484478 TestNetworkPtr net_parent (new TestNetwork ());
485- net_parent->setIface ( " parent_iface " );
486- EXPECT_EQ (" parent_iface " , net_parent->getIface ().get ());
479+ net_parent->setValid ( 23456 );
480+ EXPECT_EQ (23456 , net_parent->getValid ().get ());
487481
488482 ASSERT_NO_THROW (net_child->setParent (net_parent));
489483
490- EXPECT_FALSE (net_child->getIface ().unspecified ());
491- EXPECT_TRUE (net_child->getIface (Network::Inheritance::NONE).unspecified ());
492- EXPECT_FALSE (net_child->getIface (Network::Inheritance::PARENT_NETWORK).unspecified ());
493- EXPECT_TRUE (net_child->getIface (Network::Inheritance::GLOBAL).unspecified ());
484+ EXPECT_FALSE (net_child->getValid ().unspecified ());
485+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::NONE).unspecified ());
486+ EXPECT_FALSE (net_child->getValid (Network::Inheritance::PARENT_NETWORK).unspecified ());
487+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::GLOBAL).unspecified ());
494488
495- EXPECT_EQ (" parent_iface " , net_child->getIface ().get ());
489+ EXPECT_EQ (23456 , net_child->getValid ().get ());
496490}
497491
498492// Test that value specified for the child network takes
499493// precedence over the value specified for the parent network.
500494TEST_F (NetworkTest, getPropertyParentChild) {
501495 TestNetworkPtr net_child (new TestNetwork ());
502- net_child->setIface ( " child_iface " );
503- EXPECT_EQ (" child_iface " , net_child->getIface ().get ());
496+ net_child->setValid ( 12345 );
497+ EXPECT_EQ (12345 , net_child->getValid ().get ());
504498
505499 TestNetworkPtr net_parent (new TestNetwork ());
506- net_parent->setIface ( " parent_iface " );
507- EXPECT_EQ (" parent_iface " , net_parent->getIface ().get ());
500+ net_parent->setValid ( 23456 );
501+ EXPECT_EQ (23456 , net_parent->getValid ().get ());
508502
509503 ASSERT_NO_THROW (net_child->setParent (net_parent));
510504
511- EXPECT_FALSE (net_child->getIface ().unspecified ());
512- EXPECT_FALSE (net_child->getIface (Network::Inheritance::NONE).unspecified ());
513- EXPECT_FALSE (net_child->getIface (Network::Inheritance::PARENT_NETWORK).unspecified ());
514- EXPECT_TRUE (net_child->getIface (Network::Inheritance::GLOBAL).unspecified ());
505+ EXPECT_FALSE (net_child->getValid ().unspecified ());
506+ EXPECT_FALSE (net_child->getValid (Network::Inheritance::NONE).unspecified ());
507+ EXPECT_FALSE (net_child->getValid (Network::Inheritance::PARENT_NETWORK).unspecified ());
508+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::GLOBAL).unspecified ());
515509
516- EXPECT_EQ (" child_iface " , net_child->getIface ().get ());
510+ EXPECT_EQ (12345 , net_child->getValid ().get ());
517511}
518512
519513// Test that global value is inherited if there is no network
520514// specific value.
521515TEST_F (NetworkTest, getPropertyGlobalNoParentNoChild) {
522516 TestNetworkPtr net_child (new TestNetwork ());
523517
524- globals_->set (" interface " , Element::create (" global_iface " ));
518+ globals_->set (" valid-lifetime " , Element::create (34567 ));
525519
526520 net_child->setFetchGlobalsFn (getFetchGlobalsFn ());
527521
528- EXPECT_FALSE (net_child->getIface ().unspecified ());
529- EXPECT_TRUE (net_child->getIface (Network::Inheritance::NONE).unspecified ());
530- EXPECT_TRUE (net_child->getIface (Network::Inheritance::PARENT_NETWORK).unspecified ());
531- EXPECT_FALSE (net_child->getIface (Network::Inheritance::GLOBAL).unspecified ());
522+ EXPECT_FALSE (net_child->getValid ().unspecified ());
523+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::NONE).unspecified ());
524+ EXPECT_TRUE (net_child->getValid (Network::Inheritance::PARENT_NETWORK).unspecified ());
525+ EXPECT_FALSE (net_child->getValid (Network::Inheritance::GLOBAL).unspecified ());
532526
533- EXPECT_EQ (" global_iface " , net_child->getIface ().get ());
527+ EXPECT_EQ (34567 , net_child->getValid ().get ());
534528}
535529
536530// Test that getSiaddr() never fails.
0 commit comments