blob: bef06a75ef081fb065d8fff761f3b4b2f86d43f4 [file] [log] [blame]
aPiecek647f62e2023-05-18 10:55:58 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
2
3set mdir "$::env(YANG_MODULES_DIR)"
4set ddir "$::env(TESTS_DIR)/data"
5
6test extdata_set_clear {Set and clear extdata file} {
7-setup $ly_setup -cleanup $ly_cleanup -body {
8 ly_cmd "extdata" "No file set"
9 ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
10 ly_cmd "extdata" "$ddir/modsm_ctx_ext.xml"
11 ly_cmd "extdata -c"
12 ly_cmd "extdata" "No file set"
13}}
14
15test extdata_clear_cmd {Clear extdata file by 'clear' command} {
16-setup $ly_setup -cleanup $ly_cleanup -body {
17 ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
18 ly_cmd "clear"
19 ly_cmd "extdata" "No file set"
20}}
21
22test extdata_one_only {Only one file for extdata} {
23-setup $ly_setup -cleanup $ly_cleanup -body {
24 ly_cmd_err "extdata $ddir/modsm_ctx_ext.xml $ddir/modsm_ctx_ext.xml" "Only one file must be entered"
25}}
26
27test extdata_schema_mount_tree {Print tree output of a model with Schema Mount} {
28-setup $ly_setup -cleanup $ly_cleanup -body {
29 ly_cmd "clear -y"
30 ly_cmd "searchpath $mdir"
31 ly_cmd "load modsm"
32 ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
33 ly_cmd "print -f tree modsm" "--mp root.*--rw lfl/"
34}}
35
36test ext_data_schema_mount_xml {Validating and printing mounted data} {
37-setup $ly_setup -cleanup $ly_cleanup -body {
38 ly_cmd "clear -y"
39 ly_cmd "searchpath $mdir"
40 ly_cmd "load modsm"
41 ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
42 ly_cmd "data -f xml -t config $ddir/modsm.xml" "</lfl>"
43}}
44
45cleanupTests