From 057abe56e080e71490c52d4840a8594a82a7c140 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Mon, 8 Nov 2021 20:04:35 +0100 Subject: [PATCH] Fix for issue #284, do recursive lookup when reading YANG files from directory. --- lib/clixon/clixon_file.h | 3 ++ lib/src/clixon_file.c | 80 ++++++++++++++++++++++++++++++++ lib/src/clixon_yang_parse_lib.c | 74 ++++++++++++++++------------- test/lib.sh | 2 + test/long.sh | 2 +- test/plot_perf.sh | 2 +- test/test_augment.sh | 2 +- test/test_augment_state.sh | 2 +- test/test_augment_trans.sh | 2 +- test/test_choice.sh | 2 +- test/test_cli_apipath.sh | 2 +- test/test_cli_auto_extension.sh | 2 +- test/test_cli_auto_genmodel.sh | 2 +- test/test_cli_auto_sub.sh | 2 +- test/test_cli_leafref.sh | 2 +- test/test_cli_multikey.sh | 2 +- test/test_identity.sh | 2 +- test/test_insert.sh | 2 +- test/test_leaf_default.sh | 2 +- test/test_leafref.sh | 2 +- test/test_leafref_augment.sh | 2 +- test/test_leafref_state.sh | 2 +- test/test_nacm_datanode.sh | 2 +- test/test_nacm_datanode_paths.sh | 2 +- test/test_nacm_datanode_read.sh | 2 +- test/test_nacm_datanode_write.sh | 2 +- test/test_pattern.sh | 2 +- test/test_perf_cli.sh | 2 +- test/test_perf_mem.sh | 2 +- test/test_perf_netconf.sh | 2 +- test/test_perf_restconf.sh | 2 +- test/test_perf_startup.sh | 2 +- test/test_restconf_err.sh | 2 +- test/test_submodule.sh | 2 +- test/test_type.sh | 2 +- test/test_type_range.sh | 2 +- test/test_union.sh | 2 +- test/test_upgrade_failsafe.sh | 2 +- test/test_upgrade_interfaces.sh | 2 +- test/test_upgrade_repair.sh | 2 +- test/test_upgrade_simple.sh | 2 +- test/test_xml_trees.sh | 2 +- test/test_xpath_functions.sh | 2 +- test/test_yang.sh | 2 +- test/test_yang_anydata.sh | 2 +- test/test_yang_bind.sh | 2 +- test/test_yang_deviation.sh | 2 +- test/test_yang_extension.sh | 2 +- test/test_yang_load.sh | 16 +++---- test/test_yang_when.sh | 2 +- 50 files changed, 181 insertions(+), 84 deletions(-) diff --git a/lib/clixon/clixon_file.h b/lib/clixon/clixon_file.h index 8219ff22..fcb7ce54 100644 --- a/lib/clixon/clixon_file.h +++ b/lib/clixon/clixon_file.h @@ -43,6 +43,9 @@ int clicon_file_dirent(const char *dir, struct dirent **ent, const char *regexp, mode_t type); +int clicon_files_recursive(const char *dir, const char *regexp, + char **dp, int *nent); + int clicon_file_copy(char *src, char *target); #endif /* _CLIXON_FILE_H_ */ diff --git a/lib/src/clixon_file.c b/lib/src/clixon_file.c index 6c0b4707..4adbe705 100644 --- a/lib/src/clixon_file.c +++ b/lib/src/clixon_file.c @@ -62,6 +62,86 @@ #include "clixon_log.h" #include "clixon_file.h" +static int +clicon_file_string_sort(const void *arg1, + const void *arg2) +{ + char *str1 = *(char **)arg1; + char *str2 = *(char **)arg2; + + return strcmp(str1, str2); +} + +int +clicon_files_recursive(const char *dir, + const char *regexp, + char **dp, + int *nent) +{ + struct dirent *dent = NULL; + char path[MAXPATHLEN]; + DIR *dirp = NULL; + regex_t re; + int res; + char errbuf[128]; + + if (regexp && (res = regcomp(&re, regexp, REG_EXTENDED)) != 0) { + regerror(res, &re, errbuf, sizeof(errbuf)); + clicon_err(OE_DB, 0, "regcomp: %s", errbuf); + return -1; + } + + if (!(dirp = opendir(dir))) { + return *nent; + } + + while ((dent = readdir(dirp)) != NULL) { + if (dent->d_type == DT_DIR) { + /* If we find a directory we might want to enter it, unless it + is the current directory (.) or parent (..) */ + if (strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0) { + continue; + } + + /* Build the new directory and enter it. */ + sprintf(path, "%s/%s", dir, dent->d_name); + *nent = clicon_files_recursive(path, regexp, dp, nent); + } else if (dent->d_type == DT_REG) { + /* If we encounter a file, match it against the regexp and + add it to the list of found files.*/ + if (regexp) { + if (regexec(&re, dent->d_name, (size_t)0, NULL, *nent) != 0) + continue; + } + + /* Add room for the new file. */ + if ((dp = (char **)realloc(dp, sizeof(char *) * (*nent + 1))) == NULL) { + clicon_err(OE_UNIX, errno, "realloc"); + *nent = -1; + goto quit; + } + + if ((dp[*nent] = (char *)malloc(1 + sizeof(char) * strlen(dir) + + strlen(dent->d_name))) == NULL) { + clicon_err(OE_UNIX, errno, "malloc"); + *nent = -1; + goto quit; + } + + sprintf(dp[*nent], "%s/%s", dir, dent->d_name); + (*nent)++; + } + } + + qsort(dp, *nent, sizeof(char *), clicon_file_string_sort); + + quit: + if (dirp) + closedir(dirp); + + return *nent; +} + /*! qsort "compar" for directory alphabetically sorting, see qsort(3) */ static int diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index 5dc3b9cc..ceff764c 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -903,57 +903,69 @@ yang_parse_find_match(clicon_handle h, cbuf *fbuf) { int retval = -1; - struct dirent *dp = NULL; + char **dp = NULL; int ndp; cbuf *regex = NULL; cxobj *x; cxobj *xc; char *dir; + int nent = 0; + int i = 0; /* get clicon config file in xml form */ if ((x = clicon_conf_xml(h)) == NULL) - goto ok; + goto ok; if ((regex = cbuf_new()) == NULL){ - clicon_err(OE_YANG, errno, "cbuf_new"); - goto done; + clicon_err(OE_YANG, errno, "cbuf_new"); + goto done; } /* RFC 6020: The name of the file SHOULD be of the form: * module-or-submodule-name ['@' revision-date] ( '.yang' / '.yin' ) * revision-date ::= 4DIGIT "-" 2DIGIT "-" 2DIGIT */ if (revision) - cprintf(regex, "^%s@%s(.yang)$", module, revision); + cprintf(regex, "^%s@%s(.yang)$", module, revision); else - cprintf(regex, "^%s(@[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?(.yang)$", - module); + cprintf(regex, "^%s(@[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?(.yang)$", + module); xc = NULL; + while ((xc = xml_child_each(x, xc, CX_ELMNT)) != NULL) { - /* Skip if not yang dir */ - if (strcmp(xml_name(xc), "CLICON_YANG_DIR") != 0 && - strcmp(xml_name(xc), "CLICON_YANG_MAIN_DIR") != 0) - continue; - dir = xml_body(xc); - /* get all matching files in this directory */ - if ((ndp = clicon_file_dirent(dir, - &dp, - cbuf_get(regex), - S_IFREG)) < 0) - goto done; - /* Entries are sorted, last entry should be most recent date - */ - if (ndp != 0){ - cprintf(fbuf, "%s/%s", dir, dp[ndp-1].d_name); - retval = 1; - goto done; - } + /* Skip if not yang dir */ + if (strcmp(xml_name(xc), "CLICON_YANG_DIR") != 0 && + strcmp(xml_name(xc), "CLICON_YANG_MAIN_DIR") != 0) + continue; + dir = xml_body(xc); + + /* get all matching files in this directory */ + dp = (char **)malloc(sizeof(char *)); + if ((ndp = clicon_files_recursive(dir, + cbuf_get(regex), + dp, + &nent)) < 0) { + goto done; + } + + /* Entries are sorted, last entry should be most recent date + */ + if (ndp != 0){ + cprintf(fbuf, "%s", dp[ndp-1]); + + for (i = 0; i < nent; i++) + if (dp[i]) + free(dp[i]); + + retval = 1; + goto done; + } } - ok: +ok: retval = 0; - done: +done: if (regex) - cbuf_free(regex); + cbuf_free(regex); if (dp) - free(dp); + free(dp); return retval; } @@ -1656,8 +1668,8 @@ yang_spec_load_dir(clicon_handle h, /* Load all yang files in dir */ for (i = 0; i < ndp; i++) { /* base = module name [+ @rev ] + .yang */ - if (oldbase) - free(oldbase); + if (oldbase) + free(oldbase); oldbase = base; base = NULL; revf = 0; diff --git a/test/lib.sh b/test/lib.sh index 503c7ee5..309e6fa4 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -219,6 +219,8 @@ if [ ! -d $dir ]; then mkdir $dir fi +dir_tmp=/var/tmp + # Default restconf configuration: http IPv4 # Can be placed in clixon-config # Note that https clause assumes there exists certs and keys in /etc/ssl,... diff --git a/test/long.sh b/test/long.sh index 98a91513..54ea39e8 100755 --- a/test/long.sh +++ b/test/long.sh @@ -50,7 +50,7 @@ cat < $cfg $cfg clixon-restconf:allow-auth-none - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/plot_perf.sh b/test/plot_perf.sh index fcd7f901..2ae78915 100755 --- a/test/plot_perf.sh +++ b/test/plot_perf.sh @@ -76,7 +76,7 @@ EOF cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon scaling /usr/local/var/example/example.sock diff --git a/test/test_augment.sh b/test/test_augment.sh index a25eaede..06ef088c 100755 --- a/test/test_augment.sh +++ b/test/test_augment.sh @@ -31,7 +31,7 @@ cat < $cfg $cfg a:test clixon-restconf:allow-auth-none - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_augment_state.sh b/test/test_augment_state.sh index 00f40713..5e090346 100755 --- a/test/test_augment_state.sh +++ b/test/test_augment_state.sh @@ -16,7 +16,7 @@ cat < $cfg $cfg a:test - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_augment_trans.sh b/test/test_augment_trans.sh index 0d497527..b30c8ab9 100755 --- a/test/test_augment_trans.sh +++ b/test/test_augment_trans.sh @@ -19,7 +19,7 @@ cat < $cfg $cfg a:test - $dir + $dir_tmp /usr/local/share/clixon $fyang2 /usr/local/lib/$APPNAME/clispec diff --git a/test/test_choice.sh b/test/test_choice.sh index 719350a8..ef3b5966 100755 --- a/test/test_choice.sh +++ b/test/test_choice.sh @@ -21,7 +21,7 @@ cat < $cfg $cfg clixon-restconf:allow-auth-none - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_cli_apipath.sh b/test/test_cli_apipath.sh index 4bab06a8..7aa6edc6 100755 --- a/test/test_cli_apipath.sh +++ b/test/test_cli_apipath.sh @@ -24,7 +24,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $fyang $clidir /usr/local/lib/$APPNAME/cli diff --git a/test/test_cli_auto_extension.sh b/test/test_cli_auto_extension.sh index 412cb873..15878398 100755 --- a/test/test_cli_auto_extension.sh +++ b/test/test_cli_auto_extension.sh @@ -27,7 +27,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp $dir /usr/local/lib/$APPNAME/backend $clidir diff --git a/test/test_cli_auto_genmodel.sh b/test/test_cli_auto_genmodel.sh index 9f77fe47..566e2c04 100755 --- a/test/test_cli_auto_genmodel.sh +++ b/test/test_cli_auto_genmodel.sh @@ -29,7 +29,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/backend $clidir diff --git a/test/test_cli_auto_sub.sh b/test/test_cli_auto_sub.sh index 9253e670..58b6aff6 100755 --- a/test/test_cli_auto_sub.sh +++ b/test/test_cli_auto_sub.sh @@ -26,7 +26,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/backend $clidir diff --git a/test/test_cli_leafref.sh b/test/test_cli_leafref.sh index 83416ade..557bd8ac 100755 --- a/test/test_cli_leafref.sh +++ b/test/test_cli_leafref.sh @@ -18,7 +18,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp example-leafref /usr/local/lib/$APPNAME/backend $APPNAME diff --git a/test/test_cli_multikey.sh b/test/test_cli_multikey.sh index 8c3ef23c..6ab99b24 100755 --- a/test/test_cli_multikey.sh +++ b/test/test_cli_multikey.sh @@ -18,7 +18,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli diff --git a/test/test_identity.sh b/test/test_identity.sh index 3e900669..a3df3737 100755 --- a/test/test_identity.sh +++ b/test/test_identity.sh @@ -18,7 +18,7 @@ cat < $cfg $cfg clixon-restconf:allow-auth-none - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_insert.sh b/test/test_insert.sh index 514b7f8f..85bd9586 100755 --- a/test/test_insert.sh +++ b/test/test_insert.sh @@ -18,7 +18,7 @@ fyang=$dir/example.yang cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli diff --git a/test/test_leaf_default.sh b/test/test_leaf_default.sh index d36553c0..c7c604d0 100755 --- a/test/test_leaf_default.sh +++ b/test/test_leaf_default.sh @@ -27,7 +27,7 @@ cat < $cfg $cfg ietf-netconf:startup - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_leafref.sh b/test/test_leafref.sh index a8ba47b0..a87b8934 100755 --- a/test/test_leafref.sh +++ b/test/test_leafref.sh @@ -12,7 +12,7 @@ fyang=$dir/leafref.yang cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_leafref_augment.sh b/test/test_leafref_augment.sh index 9efd0b69..f43211ec 100755 --- a/test/test_leafref_augment.sh +++ b/test/test_leafref_augment.sh @@ -37,7 +37,7 @@ fyang2=$dir/augment.yang cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $fyang2 /usr/local/lib/$APPNAME/clispec diff --git a/test/test_leafref_state.sh b/test/test_leafref_state.sh index 50325d2d..cc042b0d 100755 --- a/test/test_leafref_state.sh +++ b/test/test_leafref_state.sh @@ -28,7 +28,7 @@ fyangno=$dir/leafrefno.yang # No require-instance cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/lib/$APPNAME/backend diff --git a/test/test_nacm_datanode.sh b/test/test_nacm_datanode.sh index b872b9b9..4a870aea 100755 --- a/test/test_nacm_datanode.sh +++ b/test/test_nacm_datanode.sh @@ -53,7 +53,7 @@ cat < $cfg $cfg /usr/local/share/clixon $IETFRFC - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/restconf diff --git a/test/test_nacm_datanode_paths.sh b/test/test_nacm_datanode_paths.sh index 776f660e..934650b0 100755 --- a/test/test_nacm_datanode_paths.sh +++ b/test/test_nacm_datanode_paths.sh @@ -25,7 +25,7 @@ cat < $cfg $cfg /usr/local/share/clixon $IETFRFC - $dir + $dir_tmp $fyang ietf-netconf:startup /usr/local/lib/$APPNAME/clispec diff --git a/test/test_nacm_datanode_read.sh b/test/test_nacm_datanode_read.sh index 6e047b97..c958047a 100755 --- a/test/test_nacm_datanode_read.sh +++ b/test/test_nacm_datanode_read.sh @@ -33,7 +33,7 @@ cat < $cfg $cfg /usr/local/share/clixon $IETFRFC - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/restconf diff --git a/test/test_nacm_datanode_write.sh b/test/test_nacm_datanode_write.sh index 55fe39c6..6161c999 100755 --- a/test/test_nacm_datanode_write.sh +++ b/test/test_nacm_datanode_write.sh @@ -25,7 +25,7 @@ cat < $cfg $cfg /usr/local/share/clixon $IETFRFC - $dir + $dir_tmp $fyang /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/restconf diff --git a/test/test_pattern.sh b/test/test_pattern.sh index 695c8926..69324168 100755 --- a/test/test_pattern.sh +++ b/test/test_pattern.sh @@ -34,7 +34,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $fyang $regex /usr/local/lib/$APPNAME/clispec diff --git a/test/test_perf_cli.sh b/test/test_perf_cli.sh index e72e0a0f..2a784f11 100755 --- a/test/test_perf_cli.sh +++ b/test/test_perf_cli.sh @@ -55,7 +55,7 @@ EOF cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/var/$APPNAME/$APPNAME.sock diff --git a/test/test_perf_mem.sh b/test/test_perf_mem.sh index 731f8a5f..bf5d7e2e 100755 --- a/test/test_perf_mem.sh +++ b/test/test_perf_mem.sh @@ -45,7 +45,7 @@ cat < $cfg $cfg ietf-netconf:startup - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/var/$APPNAME/$APPNAME.sock diff --git a/test/test_perf_netconf.sh b/test/test_perf_netconf.sh index fbdf69ef..0d5b53f3 100755 --- a/test/test_perf_netconf.sh +++ b/test/test_perf_netconf.sh @@ -59,7 +59,7 @@ EOF cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/var/$APPNAME/$APPNAME.sock diff --git a/test/test_perf_restconf.sh b/test/test_perf_restconf.sh index 6d8df8db..7c229ea1 100755 --- a/test/test_perf_restconf.sh +++ b/test/test_perf_restconf.sh @@ -63,7 +63,7 @@ cat < $cfg $cfg clixon-restconf:allow-auth-none - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/var/$APPNAME/$APPNAME.sock diff --git a/test/test_perf_startup.sh b/test/test_perf_startup.sh index 6bc554d0..b09a5c92 100755 --- a/test/test_perf_startup.sh +++ b/test/test_perf_startup.sh @@ -55,7 +55,7 @@ EOF cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $fyang /usr/local/var/$APPNAME/$APPNAME.sock diff --git a/test/test_restconf_err.sh b/test/test_restconf_err.sh index 9d0d85eb..7f377a9a 100755 --- a/test/test_restconf_err.sh +++ b/test/test_restconf_err.sh @@ -48,7 +48,7 @@ cat < $cfg $cfg clixon-restconf:allow-auth-none /usr/local/share/clixon - $dir + $dir_tmp $fyang /usr/local/var/$APPNAME/$APPNAME.sock $dir/restconf.pidfile diff --git a/test/test_submodule.sh b/test/test_submodule.sh index 945fe611..bfdcd221 100755 --- a/test/test_submodule.sh +++ b/test/test_submodule.sh @@ -36,7 +36,7 @@ cat < $cfg clixon-restconf:allow-auth-none $cfg /usr/local/share/clixon - $dir + $dir_tmp $fmain /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli diff --git a/test/test_type.sh b/test/test_type.sh index e45a34e0..09bfb9d7 100755 --- a/test/test_type.sh +++ b/test/test_type.sh @@ -217,7 +217,7 @@ function testrun(){ cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_type_range.sh b/test/test_type_range.sh index e1f0af6a..a5dc07ff 100755 --- a/test/test_type_range.sh +++ b/test/test_type_range.sh @@ -171,7 +171,7 @@ EOF cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_union.sh b/test/test_union.sh index 431d4c96..e0e37637 100755 --- a/test/test_union.sh +++ b/test/test_union.sh @@ -15,7 +15,7 @@ fyang3=$dir/example3.yang cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang diff --git a/test/test_upgrade_failsafe.sh b/test/test_upgrade_failsafe.sh index bc6faf91..7561cd0a 100755 --- a/test/test_upgrade_failsafe.sh +++ b/test/test_upgrade_failsafe.sh @@ -98,7 +98,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/example/backend diff --git a/test/test_upgrade_interfaces.sh b/test/test_upgrade_interfaces.sh index 0b16719d..d5d635d8 100755 --- a/test/test_upgrade_interfaces.sh +++ b/test/test_upgrade_interfaces.sh @@ -36,7 +36,7 @@ cat < $cfg ietf-netconf:startup /usr/local/share/clixon interfaces:if-mib - $dir + $dir_tmp $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/example/backend diff --git a/test/test_upgrade_repair.sh b/test/test_upgrade_repair.sh index 728578eb..1cf7e98f 100755 --- a/test/test_upgrade_repair.sh +++ b/test/test_upgrade_repair.sh @@ -59,7 +59,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/example/backend diff --git a/test/test_upgrade_simple.sh b/test/test_upgrade_simple.sh index b30d33df..00c62a0f 100755 --- a/test/test_upgrade_simple.sh +++ b/test/test_upgrade_simple.sh @@ -17,7 +17,7 @@ cat < $cfg /usr/local/etc/clixon.xml *:* /usr/local/share/clixon - $dir + $dir_tmp $APPNAME hello /usr/local/lib/hello/clispec diff --git a/test/test_xml_trees.sh b/test/test_xml_trees.sh index d98e7e79..aa6d3796 100755 --- a/test/test_xml_trees.sh +++ b/test/test_xml_trees.sh @@ -17,7 +17,7 @@ fyang=$dir/example.yang cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli diff --git a/test/test_xpath_functions.sh b/test/test_xpath_functions.sh index 3b2cfbee..9944898d 100755 --- a/test/test_xpath_functions.sh +++ b/test/test_xpath_functions.sh @@ -17,7 +17,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang.sh b/test/test_yang.sh index 263ef359..6a6989a5 100755 --- a/test/test_yang.sh +++ b/test/test_yang.sh @@ -15,7 +15,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang_anydata.sh b/test/test_yang_anydata.sh index 2f2f29ca..dedc70de 100755 --- a/test/test_yang_anydata.sh +++ b/test/test_yang_anydata.sh @@ -133,7 +133,7 @@ function testrun() $cfg clixon-restconf:allow-auth-none /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $dir/yang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang_bind.sh b/test/test_yang_bind.sh index 3fbaf6c2..c2aeaf8f 100755 --- a/test/test_yang_bind.sh +++ b/test/test_yang_bind.sh @@ -27,7 +27,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang_deviation.sh b/test/test_yang_deviation.sh index d4749b32..96a6a69d 100755 --- a/test/test_yang_deviation.sh +++ b/test/test_yang_deviation.sh @@ -19,7 +19,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $dir /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang_extension.sh b/test/test_yang_extension.sh index 2e8933c2..ddefc395 100755 --- a/test/test_yang_extension.sh +++ b/test/test_yang_extension.sh @@ -29,7 +29,7 @@ cat < $cfg $cfg /usr/local/share/clixon - $dir + $dir_tmp $IETFRFC $fyang /usr/local/lib/$APPNAME/clispec diff --git a/test/test_yang_load.sh b/test/test_yang_load.sh index d0f11062..3ab9fcfb 100755 --- a/test/test_yang_load.sh +++ b/test/test_yang_load.sh @@ -60,7 +60,7 @@ new "1. Load module as file" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang1 @@ -113,7 +113,7 @@ new "2. Load old module as file" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang2 @@ -161,7 +161,7 @@ new "3. Load module with no revision" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC example @@ -204,7 +204,7 @@ new "4. Load module with old revision" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC example @@ -249,7 +249,7 @@ new "5. Load dir" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $dir @@ -294,7 +294,7 @@ new "6. Load dir override with file" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $dir @@ -339,7 +339,7 @@ new "7. Load dir override with module + revision" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $dir @@ -385,7 +385,7 @@ new "8. Load module w new revision overrided by old file" cat < $cfg $cfg - $dir + $dir_tmp /usr/local/share/clixon $IETFRFC $fyang2 diff --git a/test/test_yang_when.sh b/test/test_yang_when.sh index 4eb35388..e93dbaab 100755 --- a/test/test_yang_when.sh +++ b/test/test_yang_when.sh @@ -27,7 +27,7 @@ cat < $cfg $cfg ietf-netconf:startup /usr/local/share/clixon - $dir + $dir_tmp $dir /usr/local/lib/$APPNAME/backend $clidir