- Added transaction_arg_set()

- Modifed coverage script
This commit is contained in:
Olof hagsand 2021-09-27 16:31:21 +02:00
parent 51278d5901
commit 9b6bb3ecbf
6 changed files with 40 additions and 26 deletions

View file

@ -33,7 +33,7 @@
## 5.3.0
27 September, 2021
The 5.3 release has pagination support, YANG/auto-clilinkref changes and lots of bug fixes.
The 5.3 release has pagination support, Linkref changes in validation and auto-cli, and lots of bug fixes.
### New features
@ -50,10 +50,10 @@ The 5.3 release has pagination support, YANG/auto-clilinkref changes and lots of
* New http media: application/yang-collection+xml/json
* Updated state callback signature containing parameters for pagination
* See API changes below
* See [User manual pagination](https://clixon-docs.readthedocs.io/en/latest/misc.html#pagination)
* Work-in-progress
* Enable remaining attriute with LIST_PAGINATION_REMAINING compile-time option
* sort/direction/where etc not supported
* For documentation: [User manual pagination](https://clixon-docs.readthedocs.io/en/latest/misc.html#pagination)
* YANG Leafref feature update
* Closer adherence to RFC 7950. Some of this is changed behavior, some is new feature.
* Validation uses referred node
@ -75,12 +75,12 @@ Users may have to change how they access the system
* Looser leafref validation checks
* Leafref required-instance must be set to make strict data-node check
* See changes under new feature "YANG leafref feature update"
* See changes under new feature "YANG leafref feature update" above
* Native Restconf
* Native restconf is now default, not fcgi/nginx
* To configure with fcgi, you need to explicitly configure: `--with-restconf=fcgi`
* SSL client certs failures are returned as http 405 errors, not fail during SSL negotiation
* New clixon-config@2021-07-11.yang revision
* SSL client certs failures are returned as http `405` errors, not fail during SSL negotiation
* New `clixon-config@2021-07-11.yang` revision
* Added: `CLICON_RESTCONF_HTTP2_PLAIN`
* Removed default of `CLICON_RESTCONF_INSTALLDIR`
* The default behaviour is changed to use the config `$(sbindir)` to locate `clixon_restconf` when starting restconf internally

View file

@ -43,14 +43,14 @@
*/
/*! Transaction data describing a system transition from a src to target state
* Clicon internal, presented as void* to app's callback in the 'transaction_data'
* Clixon internal, presented as void* to app's callback in the 'transaction_data'
* type in clicon_backend_api.h
* The struct contains source and target XML tree (e.g. candidate/running)
* But primarily a set of XML tree vectors (dvec, avec, cvec) and associated lengths
* These contain the difference between src and target XML, ie "what has changed".
* It is up to the validate callbacks to ensure that these changes are OK
* It is up to the commit callbacks to enforce these changes in the "state" of
*the system.
* the system.
*/
typedef struct {
uint64_t td_id; /* Transaction id */

View file

@ -81,7 +81,6 @@ transaction_id(transaction_data td)
/*! Get plugin/application specific callback argument
* @param[in] td transaction_data
* @retval arg callback argument
* @note NYI
*/
void *
transaction_arg(transaction_data td)
@ -89,6 +88,18 @@ transaction_arg(transaction_data td)
return ((transaction_data_t *)td)->td_arg;
}
/*! Set plugin/application specific callback argument
* @param[in] td transaction_data
* @param[in] arg callback argument
*/
int
transaction_arg_set(transaction_data td,
void *arg)
{
((transaction_data_t *)td)->td_arg = arg;
return 0;
}
/*! Get source database xml tree
* @param[in] td transaction_data
* @retval src source xml tree containing original state

View file

@ -51,6 +51,7 @@
*/
uint64_t transaction_id(transaction_data td);
void *transaction_arg(transaction_data td);
int transaction_arg_set(transaction_data td, void *arg);
cxobj *transaction_src(transaction_data td);
cxobj *transaction_target(transaction_data td);
cxobj **transaction_dvec(transaction_data td);

View file

@ -13,8 +13,8 @@ TOKEN=$1
# LINKAGE=static
# Configure (clixon)
CFLAGS="-g -Wall" INSTALLFLAGS="" ./configure
sudo ldconfig
#CFLAGS="-g -Wall" INSTALLFLAGS="" ./configure
#sudo ldconfig
LDFLAGS=-coverage LINKAGE=static CFLAGS="-g -Wall -coverage" INSTALLFLAGS="" ./configure
# Build
@ -27,17 +27,19 @@ sudo make install-include
(cd example; sudo make install)
(cd util; sudo make install)
# Kludge for netconf to add as non-root
(cd test; ./test_netconf_hello.sh)
# Kludge for netconf to touch all gcda files as root
(cd test; sudo ./test_netconf_hello.sh) || true
find . -name "*.gcda" | xargs sudo chmod 777
# Run restconf as root
(cd test; clixon_restconf="clixon_restconf -r" ./sum.sh)
# Push coverage
# PUSH $TOKEN
bash <(curl -s https://codecov.io/bash) -t ${TOKEN}
# remove all coverage files (after gcov push)
# Remove all coverage files (after gcov push)
find . -name "*.gcda" | xargs rm
find . -name "*.gcno" | xargs rm
sleep 1 # ensure OK is last
echo OK