aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
aPiecek | 768ee47 | 2023-03-30 11:19:42 +0200 | [diff] [blame^] | 3 | set ipv6_path "/ietf-interfaces:interfaces/interface/ietf-ip:ipv6/address" |
| 4 | |
aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 5 | test print_yang {} { |
| 6 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 7 | ly_cmd "load modleaf" |
| 8 | ly_cmd "print -f yang modleaf" "leaf lfl" |
| 9 | }} |
| 10 | |
| 11 | test print_yin {} { |
| 12 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 13 | ly_cmd "load modleaf" |
| 14 | ly_cmd "print -f yin modleaf" "<leaf name=\"lfl\">" |
| 15 | }} |
| 16 | |
| 17 | test print_info {} { |
| 18 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 19 | ly_cmd "load modleaf" |
| 20 | ly_cmd "print -f info modleaf" "status current" |
| 21 | }} |
| 22 | |
aPiecek | 768ee47 | 2023-03-30 11:19:42 +0200 | [diff] [blame^] | 23 | test print_info_path {Print subtree in info format} { |
| 24 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 25 | ly_cmd "load ietf-ip" |
| 26 | ly_cmd "print -f info -P $ipv6_path" "^list address .* leaf prefix-length" |
| 27 | }} |
| 28 | |
| 29 | test print_info_path_single_node {Print node in info format} { |
| 30 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 31 | ly_cmd "load ietf-ip" |
| 32 | ly_cmd "print -f info -q -P $ipv6_path" "^list address .* IPv6 addresses on the interface.\";\r\n\}$" |
| 33 | }} |
| 34 | |
aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 35 | test print_tree {} { |
| 36 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 37 | ly_cmd "load modleaf" |
| 38 | ly_cmd "print -f tree modleaf" "\\+--rw lfl" |
| 39 | }} |
| 40 | |
aPiecek | 768ee47 | 2023-03-30 11:19:42 +0200 | [diff] [blame^] | 41 | test print_tree_path {Print subtree in tree format} { |
| 42 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 43 | ly_cmd "load ietf-ip" |
| 44 | ly_cmd "print -f tree -P $ipv6_path" "\\+--rw address.*\\+--rw prefix-length" |
| 45 | }} |
| 46 | |
| 47 | test print_tree_path_single_node {Print node in tree format} { |
| 48 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 49 | ly_cmd "load ietf-ip" |
| 50 | ly_cmd "print -f tree -q -P $ipv6_path" "\\+--rw address\\* \\\[ip\\\]$" |
| 51 | }} |
| 52 | |
aPiecek | 05c7595 | 2023-03-29 09:09:44 +0200 | [diff] [blame] | 53 | cleanupTests |