blob: d4e3c44ce9f4ffdb0f300c1b2e6b00f5ad231e50 [file] [log] [blame]
aPieceka5797c12023-05-17 14:22:46 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}]
2
3set mdir "$::env(YANG_MODULES_DIR)"
4set ddir "$::env(TESTS_DIR)/data"
5
6test ext_data_schema_mount_tree {Print tree output of a model with Schema Mount} {
7 # mounting node lfl from modleaf.yang into modsm.yang
8 set out1 "--mp root.*--rw lfl/"
9 ly_cmd "-f tree -p $mdir -y -x $ddir/modsm_ctx_ext.xml $mdir/modsm.yang" $out1
10} {}
11
12test ext_data_schema_mount_tree_yanglibfile {Print tree output of a model with Schema Mount and --yang-library-file} {
13 # yang-library-file context contains an augment node 'alf' for modsm
14 set out1 "--mp root.*--rw lfl/.*--rw msa:alf?"
15 ly_cmd "-f tree -p $mdir -Y $ddir/modsm_ctx_main.xml -x $ddir/modsm_ctx_ext.xml $mdir/modsm.yang" $out1
16} {}
17
18test ext_data_schema_mount_xml {Validating and printing mounted data} {
19 ly_cmd "-f xml -t config -p $mdir -y -x $ddir/modsm_ctx_ext.xml $mdir/modsm.yang $ddir/modsm.xml" "</lfl>"
20} {}
21
22test ext_data_schema_mount_xml_yanglibfile {Validating and printing mounted data with --yang-library-file} {
23 set yanglibfile "$ddir/modsm_ctx_main.xml"
24 set extdata "$ddir/modsm_ctx_ext.xml"
25 set out1 "</lfl>.*</alf>"
26 ly_cmd "-f xml -t config -p $mdir -Y $yanglibfile -x $extdata $mdir/modsm.yang $ddir/modsm2.xml" $out1
27} {}
28
29cleanupTests