- Fixed: [xml2txt last param not used #204](https://github.com/clicon/clixon/issues/204)

- test: coverage test scripts for CI
This commit is contained in:
Olof hagsand 2021-04-20 10:26:48 +02:00
parent e9b07cebab
commit 1d29d29415
5 changed files with 37 additions and 5 deletions

View file

@ -79,10 +79,12 @@ The 5.1 release contains more RESTCONF native mode restructuring, new multi-yang
Developers may need to change their code
* `str2cvec`: Renamed to `uri_str2cvec` and added a decode parameter:
* To keep existing semantics: `str2cvec(...,cvp) -> str2cvec(...,1, cvp)`
* Removed `cli_debug()`. Use `cli_debug_backend()` or `cli_debug_restconf()` instead.
* Removed `yspec_free()` - replace with `ys_free()`
* Added xerr output parameter to `xmldb_get0()`
* Removed `endtag` parameter of `clixon_xml_parse_file()`
* `xmldb_get0()`: Added xerr output parameter to
* `clixon_xml_parse_file()`: Removed `endtag` parameter.
* Restconf authentication callback (ca_auth) signature changed (again)
* Minor modification to 5.0 change: userp removed.
* New version is: `int ca_auth(h, req, auth_type, authp)`, where

View file

@ -962,7 +962,7 @@ upgrade_callback_reg_fn(clicon_handle h,
const char *ns,
void *arg)
{
upgrade_callback_t *uc;
upgrade_callback_t *uc = NULL;
plugin_module_struct *ms = plugin_module_struct_get(h);
if (ms == NULL){

View file

@ -208,7 +208,7 @@ xml2txt(FILE *f,
cxobj *x,
int level)
{
return xml2txt_recurse(f, x, fprintf, 0);
return xml2txt_recurse(f, x, fprintf, level);
}
/*! Translate from XML to CLI commands

View file

@ -19,7 +19,7 @@
#
# Typical run: ./cicd.sh 2>&1 | tee cilog
set -eux # x
set -eux
if [ $# -ne 2 ]; then
echo "usage: $0 <host> <restconf>"

30
test/cicd/coverage.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/sh
# Run coverage using codecov
# Assume pwd is in top-level srcdir
set -eux
if [ $# -ne 1 ]; then
echo "usage: $0 <token>"
exit -1
fi
TOKEN=$1
# LINKAGE=static
# Configure (clixon)
LDFLAGS=-coverage CFLAGS="-O2 -Wall -coverage" ./configure --with-restconf=native
# Build
sh ./test/cicd/clixon-mk.sh
# Kludge to run restconf as root, and touch all gcda files, cant do as wwwuser
(cd test; clixon_restconf="/www-data/clixon_restconf -r" ./test_api.sh)
find . -name "*.gcda" | xargs sudo chmod 777
# Run all tests
(cd test; ./sum.sh)
#GITHUB_SHA=
# Push upstream
# The -f dont seem to work
bash <(curl -s https://codecov.io/bash) -f '!clixon_util*' -f '!example' -t ${TOKEN}