yanglint BUGFIX validation settings for --merge
diff --git a/tools/lint/common.c b/tools/lint/common.c
index fc9b1cd..f177527 100644
--- a/tools/lint/common.c
+++ b/tools/lint/common.c
@@ -755,7 +755,7 @@
if (merge) {
/* validate the merged result */
- ret = lyd_validate_all(&merged_tree, ctx, LYD_VALIDATE_PRESENT, NULL);
+ ret = lyd_validate_all(&merged_tree, ctx, options_validate, NULL);
if (ret) {
YLMSG_E("Merged data are not valid.\n");
goto cleanup;
diff --git a/tools/lint/tests/interactive/data_present.test b/tools/lint/tests/interactive/data_present.test
index 4228fa6..4bba596 100644
--- a/tools/lint/tests/interactive/data_present.test
+++ b/tools/lint/tests/interactive/data_present.test
@@ -9,6 +9,13 @@
ly_cmd "data -e $ddir/modleaf.xml"
}}
+test data_present_merge {validation with --present and --merge} {
+-setup $ly_setup -cleanup $ly_cleanup -body {
+ ly_cmd "load modleaf modmandatory moddefault"
+ ly_cmd_err "data -m $ddir/modleaf.xml $ddir/moddefault.xml" "Mandatory node \"lft\" instance does not exist."
+ ly_cmd "data -e -m $ddir/modleaf.xml $ddir/moddefault.xml"
+}}
+
test data_present_merge_invalid {using --present and --merge but data are invalid} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modleaf modmandatory"
diff --git a/tools/lint/tests/non-interactive/data_present.test b/tools/lint/tests/non-interactive/data_present.test
index 5ff8783..81aac14 100644
--- a/tools/lint/tests/non-interactive/data_present.test
+++ b/tools/lint/tests/non-interactive/data_present.test
@@ -9,6 +9,13 @@
ly_cmd "-e $ddir/modleaf.xml $mods"
} {}
+test data_present_merge {validation with --present and --merge} {
+ set mods "$mdir/modleaf.yang $mdir/modmandatory.yang $mdir/moddefault.yang"
+ set data "$ddir/modleaf.xml $ddir/moddefault.xml"
+ ly_cmd_err "-m $data $mods" "Mandatory node \"lft\" instance does not exist."
+ ly_cmd "-m -e $data $mods"
+} {}
+
test data_present_merge_invalid {using --present and --merge but data are invalid} {
set mods "$mdir/modleaf.yang $mdir/modmandatory.yang"
set data "$ddir/modleaf.xml $ddir/modmandatory_invalid.xml"