Add sysrepo test for creating list instances
Change-Id: I1d48efae15e8c610b82398e7199ba1bccea1d310
diff --git a/example-schema.yang b/example-schema.yang
index 172f78a..19ec5b8 100644
--- a/example-schema.yang
+++ b/example-schema.yang
@@ -28,6 +28,13 @@
presence true;
}
+ list person {
+ key 'name';
+ leaf name {
+ type string;
+ }
+ }
+
grouping upAndDown {
leaf up {
type boolean;
diff --git a/tests/sysrepo.cpp b/tests/sysrepo.cpp
index 1803890..ea468aa 100644
--- a/tests/sysrepo.cpp
+++ b/tests/sysrepo.cpp
@@ -58,5 +58,13 @@
datastore.commitChanges();
}
+ SECTION("create a list instance")
+ {
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']", "", ""));
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']/name", "", "Nguyen"));
+ datastore.createListInstance("/example-schema:person[name='Nguyen']");
+ datastore.commitChanges();
+ }
+
waitForCompletionAndBitMore(seq1);
}