blob: 4ecfcee32ae848f5ffaa2c1ff77c35be0bf2f997 [file] [log] [blame]
aPieceke75fce52023-04-04 15:25:21 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}]
2
3set mdir $::env(YANG_MODULES_DIR)
4set ddir $::env(TESTS_DIR)/data
5
6test data_merge_basic {Data is merged and the node is added} {
7 ly_cmd "-m -f xml $mdir/modmerge.yang $ddir/modmerge.xml $ddir/modmerge3.xml" "<en>.*<lm>.*<lf>"
8} {}
9
10test data_merge_validation_failed {Data is merged but validation failed.} {
11 ly_cmd "$mdir/modmerge.yang $ddir/modmerge.xml"
12 ly_cmd "$mdir/modmerge.yang $ddir/modmerge2.xml"
13 ly_cmd "-m $mdir/modmerge.yang $ddir/modmerge2.xml $ddir/modmerge.xml"
14 ly_cmd_err "-m $mdir/modmerge.yang $ddir/modmerge.xml $ddir/modmerge2.xml" "Merged data are not valid"
15} {}
16
aPiecek3d46fa92023-05-10 08:30:39 +020017test data_merge_dataconfig {The merge option has effect only for 'data' and 'config' TYPEs} {
18 set wrn1 "option has effect only for"
19 ly_cmd_wrn "-m -t rpc $mdir/modrpc.yang $ddir/modrpc.xml $ddir/modrpc.xml" $wrn1
20 ly_cmd_wrn "-m -t notif $mdir/modnotif.yang $ddir/modnotif2.xml $ddir/modnotif2.xml" $wrn1
21 ly_cmd_wrn "-m -t get $mdir/modconfig.yang $mdir/modleaf.yang $ddir/modleaf.xml $ddir/modconfig.xml" $wrn1
22 ly_cmd_wrn "-m -t getconfig $mdir/modconfig.yang $mdir/modleaf.yang $ddir/modleaf.xml $ddir/modconfig2.xml" $wrn1
23 ly_cmd_wrn "-m -t edit $mdir/modconfig.yang $mdir/modleaf.yang $ddir/modleaf.xml $ddir/modconfig2.xml" $wrn1
24 ly_cmd "-m -t config $mdir/modconfig.yang $mdir/modleaf.yang $ddir/modleaf.xml $ddir/modconfig2.xml"
25 ly_cmd "-m -t data $mdir/modconfig.yang $mdir/modleaf.yang $ddir/modleaf.xml $ddir/modconfig.xml"
26} {}
27
aPieceke75fce52023-04-04 15:25:21 +020028cleanupTests