Migrate to libyang2
Explanation of some of the changes:
1) New libyang produces different schema paths, that don't include
choice/case nodes. This can be seen in Firewall.cpp.
2) New sysrepo does not use <map>, so it has to be included at multiple
places.
3) getUniqueSubtree is now just one line of code. Another commit can get
rid of it.
4) dataFromSysrepo sometimes gives less and sometimes more data. This is
because it now uses libyang instead of sr_val_t
- When it gives more data it's usually just lists or empty containers,
sr_val_t didn't give those.
- When it gives less data it's also just empty containers. This can
be seen with "sensor-data" in hardware_ietf-hardware.cpp.
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/5171
Change-Id: I388536269e790b8b74ea7791c79b180adc5d80a6
Co-authored-by: Jan Kundrát <jan.kundrat@cesnet.cz>
diff --git a/tests/sysrepo_two-daemons.cpp b/tests/sysrepo_two-daemons.cpp
index bf67410..ac93736 100644
--- a/tests/sysrepo_two-daemons.cpp
+++ b/tests/sysrepo_two-daemons.cpp
@@ -22,22 +22,19 @@
SECTION("Test when both processes are running")
{
- srSess->session_switch_ds(SR_DS_OPERATIONAL);
+ srSess.switchDatastore(sysrepo::Datastore::Operational);
REQUIRE(dataFromSysrepo(srSess, "/ietf-hardware:hardware") == std::map<std::string, std::string> {
{"/component[name='ne']", ""},
{"/component[name='ne']/name", "ne"},
{"/component[name='ne']/class", "iana-hardware:module"},
{"/component[name='ne']/description", "This data was brought to you by process 2 (subscr)."},
- {"/component[name='ne']/sensor-data", ""},
{"/component[name='ne:edfa']", ""},
{"/component[name='ne:edfa']/name", "ne:edfa"},
{"/component[name='ne:edfa']/class", "iana-hardware:module"},
- {"/component[name='ne:edfa']/sensor-data", ""},
{"/component[name='ne:ctrl']", ""},
{"/component[name='ne:ctrl']/name", "ne:ctrl"},
{"/component[name='ne:ctrl']/class", "iana-hardware:module"},
- {"/component[name='ne:ctrl']/sensor-data", ""},
});
- srSess->session_switch_ds(SR_DS_RUNNING);
+ srSess.switchDatastore(sysrepo::Datastore::Running);
}
}