"with-ddns.json" };
ElementPtr x;
-
+
for (int i = 0; i<configs.size(); i++) {
x.reset();
testFile(string(CFG_EXAMPLES) + "/kea4/" + configs[i], false, x);
"stateless.json",
"with-ddns.json" };
ElementPtr x;
-
+
for (int i = 0; i<configs.size(); i++) {
x.reset();
testFile(string(CFG_EXAMPLES) + "/kea6/" + configs[i], true, x);
EXPECT_TRUE(repr.verify(testTree, sess, cerr));
}
-
/// @brief Tests specified configuration.
///
/// Configuration is set and then verified using YangRepr object.
///
-/// @param model name of the model to be verified against
-/// @param tree tree to be verified
+/// @param model name of the model to be verified against.
+/// @param tree tree to be verified.
void sanityCheckConfig(const std::string& model, const YRTree& tree) {
// Get a translator object to play with.
S_Connection conn(new Connection("utils unittests"));
EXPECT_TRUE(result);
}
-// This is test environment sanity check. It verifies that every configuration
-// defined in yang_configs.h is sane.
+// This is test environment sanity check. It verifies that all configuration
+// defined in yang_configs.h are sane.
TEST(YangReprTest, verifyConfigs) {
for (auto x : test_configs) {
cout << "Testing tree for model " << x.first << endl;
}
}
-
}; // end of anonymous namespace
"disabled", SR_ENUM_T, true }
};
-/// @brief Set of example configurations
-const std::vector<std::pair<std::string, YRTree>> test_configs =
+/// @brief Set of example configurations.
+const std::vector<std::pair<std::string, YRTree> > test_configs =
{
- { exampleModel, exampleTree },
- { testModel, testTree },
- { subnetTwoPoolsModelIetf6, subnetTwoPoolsTreeIetf6 },
- { subnetTimersModel, subnetTimersIetf6 },
- { validModelIetf6, validTreeIetf6 },
- { subnetOptionsModelKeaDhcp4, subnetOptionsTreeKeaDhcp4 },
- { subnetOptionsModelKeaDhcp6, subnetOptionsTreeKeaDhcp6 },
- { designExampleModel, designExampleTree }
+ { exampleModel, exampleTree },
+ { testModel, testTree },
+ { subnetTwoPoolsModelIetf6, subnetTwoPoolsTreeIetf6 },
+ { subnetTimersModel, subnetTimersIetf6 },
+ { validModelIetf6, validTreeIetf6 },
+ { subnetOptionsModelKeaDhcp4, subnetOptionsTreeKeaDhcp4 },
+ { subnetOptionsModelKeaDhcp6, subnetOptionsTreeKeaDhcp6 },
+ { designExampleModel, designExampleTree }
};
-
}; // end of namespace isc::yang::test
}; // end of namespace isc::yang
}; // end of namespace isc
: xpath_(xpath), value_(value), type_(type), settable_(settable) {
}
- /// @brief Retrieves configuration parameter from sysrepo
+ /// @brief Retrieves configuration parameter from sysrepo.
///
- /// @param xpath The xpath of an element to be retrieved
+ /// @param xpath The xpath of an element to be retrieved.
/// @param session Sysrepo session.
- /// @return YangReprItem instance representing configuration parameter
+ /// @return YangReprItem instance representing configuration parameter.
static YangReprItem get(const std::string& xpath, S_Session session);
/// @brief The xpath.
/// @brief The equal operator ignoring settable.
///
- /// @param other the other object to compare with
- /// @return true if equal
+ /// @param other the other object to compare with.
+ /// @return true if equal.
bool operator==(const YangReprItem& other) const {
return ((xpath_ == other.xpath_) &&
(value_ == other.value_) &&
/// @brief The unequal operator ignoring settable.
///
- /// @param other the other object to compare with
- /// @return false if equal
+ /// @param other the other object to compare with.
+ /// @return false if equal.
bool operator!=(const YangReprItem& other) const {
return (!(*this == other));
}
/// @param expected The expected value.
/// @param session Sysrepo session.
/// @param errs Error stream.
- /// @return true if verification succeeds, false with errors displayed
+ /// @return true if verification succeeds, false with errors displayed.
/// on errs if it fails.
bool verify(const Tree& expected, S_Session session,
std::ostream& errs) const;