Browse Source

[5151] Restored previous code in checkConfigWrite (no routine to parse full config)

Francis Dupont 8 years ago
parent
commit
5cf8210811

+ 3 - 7
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc

@@ -271,13 +271,9 @@ public:
             // Now check that it is the correct size as reported.
             EXPECT_EQ(size, static_cast<int64_t>(f.tellg()));
 
-            // Check that it's really a JSON.
-            ElementPtr from_file = parseJSON(exp_txt);
-            EXPECT_TRUE(from_file);
-
-            // Finally check it is a DHCPv4 config
-            EXPECT_NO_THROW(from_file = parseDHCP4(exp_txt, true));
-            EXPECT_TRUE(from_file);
+            // Finally, check that it's really a JSON.
+            ElementPtr from_file = Element::fromJSONFile(exp_txt);
+            ASSERT_TRUE(from_file);
         } else if (exp_status == CONTROL_RESULT_ERROR) {
 
             // Let's check if the reason for failure was given.

+ 3 - 7
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

@@ -282,13 +282,9 @@ public:
             // Now check that it is the correct size as reported.
             EXPECT_EQ(size, static_cast<int64_t>(f.tellg()));
 
-            // Check that it's really a JSON.
-            ElementPtr from_file = parseJSON(exp_txt);
-            EXPECT_TRUE(from_file);
-
-            // Finally check it is a DHCPv6 config
-            EXPECT_NO_THROW(from_file = parseDHCP6(exp_txt, true));
-            EXPECT_TRUE(from_file);
+            // Finally, check that it's really a JSON.
+            ElementPtr from_file = Element::fromJSONFile(exp_txt);
+            ASSERT_TRUE(from_file);
         } else if (exp_status == CONTROL_RESULT_ERROR) {
 
             // Let's check if the reason for failure was given.