yanglint REFACTOR change error msg to warning msg
If an error message is printed, the return value of yanglint should
be non-zero. If a warning message is displayed, the return value can
be zero.
diff --git a/tools/lint/tests/interactive/data_operational.test b/tools/lint/tests/interactive/data_operational.test
index 25bb130..011936a 100644
--- a/tools/lint/tests/interactive/data_operational.test
+++ b/tools/lint/tests/interactive/data_operational.test
@@ -21,6 +21,11 @@
ly_cmd_err "data $ddir/modoper_leafref_notif_err.xml" "Failed to parse input data file"
}}
+test data_operational_wrong_type {data are not defined as an operation} {
+-setup $ly_setup -cleanup $ly_cleanup -body {
+ ly_cmd_wrn "data -t data -O $ddir/modconfig.xml $ddir/modleaf.xml" $err1
+}}
+
test data_operational_datastore_with_unknown_data {unknown data are ignored} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modrpc"
diff --git a/tools/lint/tests/non-interactive/data_operational.test b/tools/lint/tests/non-interactive/data_operational.test
index 8205d17..d027ee9 100644
--- a/tools/lint/tests/non-interactive/data_operational.test
+++ b/tools/lint/tests/non-interactive/data_operational.test
@@ -16,6 +16,10 @@
ly_cmd_err "$mdir/modoper-leafref.yang $ddir/modoper_leafref_notif_err.xml" "Failed to parse input data file"
} {}
+test data_operational_wrong_type {data are not defined as an operation} {
+ ly_cmd_wrn "-t data -O $ddir/modconfig.xml $mdir/modleaf.yang $ddir/modleaf.xml" $err1
+} {}
+
test data_operational_datastore_with_unknown_data {unknown data are ignored} {
ly_cmd "-t rpc -O $ddir/modmandatory_invalid.xml $mdir/modrpc.yang $ddir/modrpc.xml"
} {}