Parcourir la source

[3232] Open fake interfaces for Rebind tests.

Marcin Siodelski il y a 11 ans
Parent
commit
b11c068ec0
2 fichiers modifiés avec 14 ajouts et 0 suppressions
  1. 1 0
      src/bin/dhcp6/tests/Makefile.am
  2. 13 0
      src/bin/dhcp6/tests/rebind_unittest.cc

+ 1 - 0
src/bin/dhcp6/tests/Makefile.am

@@ -90,6 +90,7 @@ nodist_dhcp6_unittests_SOURCES += marker_file.h test_libraries.h
 dhcp6_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 dhcp6_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 dhcp6_unittests_LDADD = $(GTEST_LDADD)
+dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcp/tests/libdhcptest.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la

+ 13 - 0
src/bin/dhcp6/tests/rebind_unittest.cc

@@ -15,6 +15,7 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
+#include <dhcp/tests/iface_mgr_test_config.h>
 #include <dhcp6/config_parser.h>
 #include <dhcp6/tests/dhcp6_test_utils.h>
 #include <dhcp6/tests/dhcp6_client.h>
@@ -198,6 +199,15 @@ const char* REBIND_CONFIGS[] = {
 /// @brief Test fixture class for testing Rebind.
 class RebindTest : public Dhcpv6SrvTest {
 public:
+
+    /// @brief Constructor.
+    ///
+    /// Sets up fake interfaces.
+    RebindTest()
+        : Dhcpv6SrvTest(),
+          iface_mgr_test_config_(true) {
+    }
+
     /// @brief Configure the DHCPv6 server using the JSON string.
     ///
     /// @param config New configuration in JSON format.
@@ -214,6 +224,9 @@ public:
     void requestLease(const int config_index, const int subnets_num,
                       Dhcp6Client& client);
 
+    /// @brief Interface Manager's fake configuration control.
+    IfaceMgrTestConfig iface_mgr_test_config_;
+
 };
 
 void