blob: a95d0440930b1101fefabd01301944d555c12352 [file] [log] [blame]
aPieceka96d4432023-03-27 15:49:06 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
2
aPiecek080c2bf2023-03-28 14:27:52 +02003test load_basic {} {
4-setup $ly_setup -cleanup $ly_cleanup -body {
5 ly_cmd "load modleafref"
6 ly_cmd "list" "I modleafref\r.*I modleaf"
7}}
8
aPieceka96d4432023-03-27 15:49:06 +02009test load_with_feature {Load module with feature} {
10-setup $ly_setup -cleanup $ly_cleanup -body {
11 ly_cmd "load --feature modfeature:ftr2 modfeature"
12 ly_cmd "feature -a" "modfeature:\r\n\tftr1 \\(off\\)\r\n\tftr2 \\(on\\)"
13}}
14
aPiecek080c2bf2023-03-28 14:27:52 +020015test load_make_implemented_once {load --make-implemented} {
16-setup $ly_setup -cleanup $ly_cleanup -body {
17 ly_ignore "load modmust"
18 ly_cmd "list" "I modmust\r.*i modleaf"
19 ly_cmd "clear"
20 ly_cmd "searchpath $::env(YANG_MODULES_DIR)"
21 ly_cmd "load -i modmust"
22 ly_cmd "list" "I modmust\r.*I modleaf"
23}}
24
25test load_make_implemented_twice {load -i -i} {
26-setup $ly_setup -cleanup $ly_cleanup -body {
27 ly_cmd "load modimp-type"
28 ly_cmd "list" "I modimp-type\r.*i modtypedef"
29 ly_cmd "clear"
30 ly_cmd "searchpath $::env(YANG_MODULES_DIR)"
31 ly_cmd "load -i -i modimp-type"
32 ly_cmd "list" "I modimp-type\r.*I modtypedef"
33}}
34
aPiecek88030e52023-06-02 11:03:57 +020035test load_extended_leafref_enabled {Valid module with --extended-leafref option} {
36-setup $ly_setup -cleanup $ly_cleanup -body {
37 ly_cmd "load -X modextleafref"
38}}
39
40test load_extended_leafref_disabled {Expected error if --extended-leafref is not set} {
41-setup $ly_setup -cleanup $ly_cleanup -body {
42 ly_cmd_err "load modextleafref" "Unexpected XPath token \"FunctionName\""
43}}
44
aPieceka96d4432023-03-27 15:49:06 +020045cleanupTests