blob: 8e4207b80ad1bea094dd12677148d6276696b529 [file] [log] [blame]
source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
set ddir "$::env(TESTS_DIR)/data"
set err1 "Operational datastore takes effect only with RPCs/Actions/Replies/Notifications input data types"
test data_operational_twice {it is not allowed to specify more than one --operational parameter} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modoper-leafref"
ly_cmd "data -t notif -O $ddir/modconfig.xml -O $ddir/modleaf.xml" "cannot be set multiple times"
}}
test data_operational_no_type {--operational should be with parameter --type} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modoper-leafref"
ly_cmd_wrn "data -O $ddir/modconfig.xml $ddir/modoper_leafref_notif.xml" $err1
}}
test data_operational_missing {--operational is omitted and the datastore contents is in the data file} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modoper-leafref"
ly_cmd_err "data $ddir/modoper_leafref_notif_err.xml" "Failed to parse input data file"
}}
test data_operational_datastore_with_unknown_data {unknown data are ignored} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "load modrpc"
ly_cmd "data -t rpc -O $ddir/modmandatory_invalid.xml $ddir/modrpc.xml"
}}
cleanupTests