aPiecek | 8858de0 | 2023-04-26 14:27:24 +0200 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
| 3 | set ddir "$::env(TESTS_DIR)/data" |
| 4 | set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notifications input data types" |
| 5 | |
| 6 | test data_operational_twice {it is not allowed to specify more than one --operational parameter} { |
| 7 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 8 | ly_cmd "load modoper-leafref" |
| 9 | ly_cmd "data -t notif -O $ddir/modconfig.xml -O $ddir/modleaf.xml" "cannot be set multiple times" |
| 10 | }} |
| 11 | |
| 12 | test data_operational_no_type {--operational should be with parameter --type} { |
| 13 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 14 | ly_cmd "load modoper-leafref" |
| 15 | ly_cmd_wrn "data -O $ddir/modconfig.xml $ddir/modoper_leafref_notif.xml" $err1 |
| 16 | }} |
| 17 | |
| 18 | test data_operational_missing {--operational is omitted and the datastore contents is in the data file} { |
| 19 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 20 | ly_cmd "load modoper-leafref" |
| 21 | ly_cmd_err "data $ddir/modoper_leafref_notif_err.xml" "Failed to parse input data file" |
| 22 | }} |
| 23 | |
aPiecek | 90c8516 | 2023-04-26 14:30:00 +0200 | [diff] [blame^] | 24 | test data_operational_datastore_with_unknown_data {unknown data are ignored} { |
| 25 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 26 | ly_cmd "load modrpc" |
| 27 | ly_cmd "data -t rpc -O $ddir/modmandatory_invalid.xml $ddir/modrpc.xml" |
| 28 | }} |
| 29 | |
aPiecek | 8858de0 | 2023-04-26 14:27:24 +0200 | [diff] [blame] | 30 | cleanupTests |