aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
| 3 | set mdir $::env(YANG_MODULES_DIR) |
aPiecek | 768ee47 | 2023-03-30 11:19:42 +0200 | [diff] [blame^] | 4 | set ipv6_path "/ietf-interfaces:interfaces/interface/ietf-ip:ipv6/address" |
aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 5 | |
| 6 | test format_yang {} { |
| 7 | ly_cmd "-f yang $mdir/modleaf.yang" "leaf lfl" |
| 8 | } {} |
| 9 | |
| 10 | test format_yin {} { |
| 11 | ly_cmd "-f yin $mdir/modleaf.yang" "<leaf name=\"lfl\">" |
| 12 | } {} |
| 13 | |
| 14 | test format_info {} { |
| 15 | ly_cmd "-f info $mdir/modleaf.yang" "status current" |
| 16 | } {} |
| 17 | |
| 18 | test format_tree {} { |
| 19 | ly_cmd "-f tree $mdir/modleaf.yang" "\\+--rw lfl" |
| 20 | } {} |
| 21 | |
aPiecek | 768ee47 | 2023-03-30 11:19:42 +0200 | [diff] [blame^] | 22 | test format_tree_path {Print subtree in tree format} { |
| 23 | ly_cmd "-f tree -P $ipv6_path $mdir/ietf-ip.yang" "\\+--rw address.*\\+--rw prefix-length" |
| 24 | } {} |
| 25 | |
| 26 | test format_tree_path_single_node {Print node in tree format} { |
| 27 | ly_cmd "-f tree -q -P $ipv6_path $mdir/ietf-ip.yang" "\\+--rw address\\* \\\[ip\\\]$" |
| 28 | } {} |
| 29 | |
aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 30 | test format_feature_param_one_module {Show features for one module} { |
| 31 | ly_cmd "-f feature-param $mdir/ietf-ip.yang" " -F ietf-ip:ipv4-non-contiguous-netmasks,ipv6-privacy-autoconf" -ex |
| 32 | } {} |
| 33 | |
| 34 | test format_feature_param_more_modules {Show a mix of modules with and without features} { |
| 35 | |
| 36 | set features " -F modfeature:ftr1,ftr2\ |
| 37 | -F modleaf:\ |
| 38 | -F ietf-ip:ipv4-non-contiguous-netmasks,ipv6-privacy-autoconf" |
| 39 | |
| 40 | ly_cmd "-f feature-param $mdir/modfeature.yang $mdir/modleaf.yang $mdir/ietf-ip.yang" $features -ex |
| 41 | } {} |
| 42 | |
| 43 | cleanupTests |