aPiecek | 266ca76 | 2023-03-22 15:04:59 +0100 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
aPiecek | 080c2bf | 2023-03-28 14:27:52 +0200 | [diff] [blame] | 3 | set mdir $::env(YANG_MODULES_DIR) |
aPiecek | 9b2fba6 | 2023-05-19 11:31:48 +0200 | [diff] [blame] | 4 | set ddir $::env(TESTS_DIR)/data |
aPiecek | 080c2bf | 2023-03-28 14:27:52 +0200 | [diff] [blame] | 5 | |
aPiecek | 07bc963 | 2023-06-01 12:14:48 +0200 | [diff] [blame] | 6 | test clear_searchpath {searchpath is also deleted} { |
| 7 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 8 | ly_cmd "searchpath ./" |
| 9 | ly_cmd "clear" |
| 10 | ly_cmd "searchpath" "List of the searchpaths:" -ex |
| 11 | }} |
| 12 | |
aPiecek | 080c2bf | 2023-03-28 14:27:52 +0200 | [diff] [blame] | 13 | test clear_make_implemented_once {clear --make-implemented} { |
| 14 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 15 | ly_cmd "clear -i" |
| 16 | ly_cmd "add $mdir/modmust.yang" |
| 17 | ly_cmd "list" "I modmust\r.*I modleaf" |
| 18 | }} |
| 19 | |
| 20 | test clear_make_implemented_twice {clear -i -i} { |
| 21 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 22 | ly_cmd "clear -i -i" |
| 23 | ly_cmd "add $mdir/modmust.yang" |
| 24 | ly_cmd "list" "I modmust\r.*I modleaf" |
| 25 | }} |
| 26 | |
aPiecek | 266ca76 | 2023-03-22 15:04:59 +0100 | [diff] [blame] | 27 | test clear_ietf_yang_library {clear --yang-library} { |
| 28 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 29 | # add models |
| 30 | ly_cmd "clear -y" |
| 31 | ly_cmd "list" "I ietf-yang-library" |
| 32 | }} |
| 33 | |
aPiecek | 9b2fba6 | 2023-05-19 11:31:48 +0200 | [diff] [blame] | 34 | test clear_ylf_list {apply --yang-library-file and check result by --list} { |
| 35 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 36 | ly_cmd "clear -Y $ddir/modimp_type_ctx.xml" |
| 37 | ly_cmd "list" "I modimp-type.*i modtypedef" |
| 38 | }} |
| 39 | |
| 40 | test clear_ylf_make_implemented {apply --yang-library-file and --make-implemented} { |
| 41 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 42 | ly_cmd "clear -Y $ddir/modimp_type_ctx.xml -i -i" |
| 43 | ly_cmd "list" "I modimp-type.*I modtypedef" |
| 44 | }} |
| 45 | |
| 46 | test clear_ylf_augment_ctx {Setup context by yang-library-file and augment module} { |
| 47 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 48 | ly_cmd "clear -Y $ddir/modconfig_ctx.xml" |
| 49 | ly_cmd "add $mdir/modconfig-augment.yang" |
| 50 | ly_cmd "print -f tree modconfig" "mca:alf" |
| 51 | }} |
| 52 | |
aPiecek | 266ca76 | 2023-03-22 15:04:59 +0100 | [diff] [blame] | 53 | cleanupTests |