From 9f58cba74bda005a72d72d9cf72f8bf7414e8239 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Wed, 24 Oct 2018 15:48:30 +0200 Subject: [PATCH] [65-libyang-testutils] Final fixes --- src/lib/yang/pretests/sysrepo_setup_tests.cc | 2 +- src/lib/yang/tests/translator_unittests.cc | 4 ++-- src/lib/yang/tests/translator_utils_unittests.cc | 6 +++--- src/lib/yang/yang.dox | 11 ++--------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/lib/yang/pretests/sysrepo_setup_tests.cc b/src/lib/yang/pretests/sysrepo_setup_tests.cc index 4a97127a78..ddcb937937 100644 --- a/src/lib/yang/pretests/sysrepo_setup_tests.cc +++ b/src/lib/yang/pretests/sysrepo_setup_tests.cc @@ -108,7 +108,7 @@ int main() { int exit_code = 0; - if (!found_test || + if (!found_test || !found_ietf_types || !found_yang_types || !found_ietf || !found_kea4 || !found_kea6 || !found_keaca || !found_kea2) { diff --git a/src/lib/yang/tests/translator_unittests.cc b/src/lib/yang/tests/translator_unittests.cc index 7639b129db..5b3bdb47cf 100644 --- a/src/lib/yang/tests/translator_unittests.cc +++ b/src/lib/yang/tests/translator_unittests.cc @@ -154,7 +154,7 @@ TEST(TranslatorBasicTest, getItem) { S_Val s_val; EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val)); ConstElementPtr elem; - EXPECT_NO_THROW(elem = t_obj->getItem("/keatest-module:containe")); + EXPECT_NO_THROW(elem = t_obj->getItem("/keatest-module:container")); EXPECT_FALSE(elem); elem.reset(); @@ -452,7 +452,7 @@ TEST(TranslatorBasicTest, setItem) { ASSERT_NO_THROW(t_obj.reset(new TranslatorBasic(sess))); // Container. - string xpath = "/keatest-module:containe"; + string xpath = "/keatest-module:container"; ConstElementPtr elem = Element::createMap(); EXPECT_THROW(t_obj->setItem(xpath, elem, SR_CONTAINER_T), NotImplemented); EXPECT_THROW(t_obj->setItem(xpath, elem, SR_CONTAINER_PRESENCE_T), diff --git a/src/lib/yang/tests/translator_utils_unittests.cc b/src/lib/yang/tests/translator_utils_unittests.cc index 3a97ea9e35..204120d005 100644 --- a/src/lib/yang/tests/translator_utils_unittests.cc +++ b/src/lib/yang/tests/translator_utils_unittests.cc @@ -150,17 +150,17 @@ TEST(YangReprTrest, getTestErrors) { // Change a path. YRTree badpath = testTree; - badpath[20].xpath_ = "/keatest-module:kernel-module"; // removed final 's' + badpath[22].xpath_ = "/keatest-module:kernel-module"; // removed final 's' EXPECT_FALSE(repr.verify(badpath, sess, cerr)); // Change a value. YRTree badvalue = testTree; - badvalue[1].value_ = "Str"; // was "str" + badvalue[3].value_ = "Str"; // was "str" EXPECT_FALSE(repr.verify(badvalue, sess, cerr)); // Change a type. YRTree badtype = testTree; - badtype[8].type_ = SR_UINT32_T; // was SR_INT32_T + badtype[10].type_ = SR_UINT32_T; // was SR_INT32_T EXPECT_FALSE(repr.verify(badtype, sess, cerr)); // Add a record at the end. diff --git a/src/lib/yang/yang.dox b/src/lib/yang/yang.dox index 3cad0f1ee2..2001cb30af 100644 --- a/src/lib/yang/yang.dox +++ b/src/lib/yang/yang.dox @@ -123,18 +123,11 @@ To install the test module, issue the following command: sudo sysrepoctl --install --yang=src/lib/yang/tests/keatest-module.yang @endverbatim -To install the example module, issue the following command: - -@verbatim -sudo sysrepoctl --install --yang=src/lib/yang/tests/keaexample-module.yang -@endverbatim - To verify that you have the schemas installed, do this: @verbatim sysrepoctl -l @endverbatim -Make sure that keatest-module, keaexample-module and other necessary -modules are on the list. +Make sure that keatest-module and other necessary modules are on the list. Note as DHCP modules are still being developed it can be useful to deinstall them before reinstalling a more recent version: @@ -143,7 +136,7 @@ sudo sysrepoctl --uninstall --module= @endverbatim Tests use these modules you can find in src/lib/yang/models in addition -of keatest-module and keaexample-module: +of keatest-module: - ietf-dhcpv6-server - kea-ctrl-agent - kea-dhcp-ddns -- 2.47.2