aPiecek | 647f62e | 2023-05-18 10:55:58 +0200 | [diff] [blame^] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
| 3 | set mdir "$::env(YANG_MODULES_DIR)" |
| 4 | set ddir "$::env(TESTS_DIR)/data" |
| 5 | |
| 6 | test 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 | |
| 15 | test 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 | |
| 22 | test 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 | |
| 27 | test 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 | |
| 36 | test 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 | |
| 45 | cleanupTests |