21 lines
866 B
Text
21 lines
866 B
Text
|
source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}]
|
||
|
|
||
|
set mdir $::env(YANG_MODULES_DIR)
|
||
|
set ddir $::env(TESTS_DIR)/data
|
||
|
|
||
|
test data_no_strict_basic {} {
|
||
|
ly_cmd_err "$ddir/modmandatory.xml $mdir/modleaf.yang" "No module with namespace \"urn:yanglint:modmandatory\" in the context."
|
||
|
ly_cmd "-n $ddir/modmandatory.xml $mdir/modleaf.yang"
|
||
|
} {}
|
||
|
|
||
|
test data_no_strict_invalid_data {validation with --no-strict but data are invalid} {
|
||
|
set errmsg "Mandatory node \"lft\" instance does not exist."
|
||
|
ly_cmd_err "-n $ddir/modmandatory_invalid.xml $mdir/modmandatory.yang" $errmsg
|
||
|
} {}
|
||
|
|
||
|
test data_no_strict_ignore_invalid_data {--no-strict ignore invalid data if no schema is provided} {
|
||
|
ly_cmd "-f xml -n $ddir/modmandatory_invalid.xml $ddir/modleaf.xml $mdir/modleaf.yang" "modleaf.*</lfl>$"
|
||
|
} {}
|
||
|
|
||
|
cleanupTests
|