Add datastore support for YANG actions
Change-Id: I15b96f70ce89b7bbe3ac0fefb7b018374eeabd84
diff --git a/tests/yang.cpp b/tests/yang.cpp
index cee9e9a..f226778 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -334,6 +334,13 @@
enum eth2;
}
}
+ action shutdown {
+ output {
+ leaf success {
+ type boolean;
+ }
+ }
+ }
}
feature weirdPortNames;
@@ -904,6 +911,10 @@
{boost::none, "/example-schema:portMapping/port"},
{boost::none, "/example-schema:portSettings"},
{boost::none, "/example-schema:portSettings/port"},
+ {boost::none, "/example-schema:portSettings/shutdown"},
+ {boost::none, "/example-schema:portSettings/shutdown/input"},
+ {boost::none, "/example-schema:portSettings/shutdown/output"},
+ {boost::none, "/example-schema:portSettings/shutdown/output/success"},
{boost::none, "/example-schema:systemStats"},
{boost::none, "/example-schema:systemStats/upTime"},
{boost::none, "/example-schema:subLeaf"},
@@ -1099,6 +1110,12 @@
REQUIRE(ys.leafTypeName("/example-schema:leafEnumTypedefRestricted") == "enumTypedef");
REQUIRE(ys.leafTypeName("/example-schema:leafInt32") == std::nullopt);
}
+
+ SECTION("dataPathToSchemaPath")
+ {
+ REQUIRE(ys.dataPathToSchemaPath("/example-schema:portSettings[port='eth0']") == "/example-schema:portSettings");
+ REQUIRE(ys.dataPathToSchemaPath("/example-schema:portSettings[port='eth0']/shutdown") == "/example-schema:portSettings/shutdown");
+ }
}
SECTION("negative")