File: extdata.test

package info (click to toggle)
libyang 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 10,788 kB
  • sloc: ansic: 127,487; xml: 671; sh: 442; tcl: 318; makefile: 19
file content (45 lines) | stat: -rw-r--r-- 1,570 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]

set mdir "$::env(YANG_MODULES_DIR)"
set ddir "$::env(TESTS_DIR)/data"

test extdata_set_clear {Set and clear extdata file} {
-setup $ly_setup -cleanup $ly_cleanup -body {
    ly_cmd "extdata" "No file set"
    ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
    ly_cmd "extdata" "$ddir/modsm_ctx_ext.xml"
    ly_cmd "extdata -c"
    ly_cmd "extdata" "No file set"
}}

test extdata_clear_cmd {Clear extdata file by 'clear' command} {
-setup $ly_setup -cleanup $ly_cleanup -body {
    ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
    ly_cmd "clear"
    ly_cmd "extdata" "No file set"
}}

test extdata_one_only {Only one file for extdata} {
-setup $ly_setup -cleanup $ly_cleanup -body {
    ly_cmd_err "extdata $ddir/modsm_ctx_ext.xml $ddir/modsm_ctx_ext.xml" "Only one file must be entered"
}}

test ext_data_schema_mount_xml {Validating and printing mounted data} {
-setup $ly_setup -cleanup $ly_cleanup -body {
    ly_cmd "clear -y"
    ly_cmd "searchpath $mdir"
    ly_cmd "load modsm"
    ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
    ly_cmd "data -f xml -t config $ddir/modsm.xml" "</lfl>"
}}

test ext_data_schema_mount_xml_yanglibfile {Validating and printing mounted data with --yang-library-file} {
-setup $ly_setup -cleanup $ly_cleanup -body {
    ly_cmd "clear -Y $ddir/modsm_ctx_main.xml"
    ly_cmd "searchpath $mdir"
    ly_cmd "load modsm"
    ly_cmd "extdata $ddir/modsm_ctx_ext.xml"
    ly_cmd "data -f xml -t config $ddir/modsm2.xml" "</lfl>.*</alf>"
}}

cleanupTests