blob: b91eed8e84c59a82217f2548d0027b744f1fa326 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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
|