Commit graph

217 commits

Author SHA1 Message Date
Olof hagsand
d84c529ff1 [Code formatting: Change indentation style to space](https://github.com/clicon/clixon/issues/379)
* Applies to all c/h/y/l/sh files and .editorconfig
2022-10-27 14:21:17 +02:00
Phil Heller
8abcda6f85 confirmed-commit fixes, tests
- fixed typo preventing evaluation of confirmed-commit logic in backend_startup
- fixed uninitialized variable warnings
- added details to CHANGELOG.MD
- added capabilities advertisement for confirmed-commit 1.0 and 1.1
- added xml hello message that uses only eom framing, for simplicity in asynch tests
- add stty restore after wait_restconf to fix console corruption in tests
- adjust test_confirmed_commit to drop perms and run as the invoking user.  This will require running user to have permissions on /usr/local/var/example
- added CLI tests
2022-10-03 21:47:09 -06:00
Olof hagsand
e3f3d772c7 Fixed: [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369) 2022-09-28 15:04:11 +02:00
Olof hagsand
3b58d010a3 Test: expecteof_netconf use fix string grep, fix err funciton call-by-value 2022-09-19 14:58:16 +02:00
Olof hagsand
ddf01503c6 libressl requires -new to openssl commands, thanks krihal 2022-09-06 12:49:08 +02:00
Olof hagsand
5e2643c382 Test: remove testdir also if skip test 2022-09-03 13:07:26 +02:00
Olof hagsand
71fc85af0b restconf: removed try to reply on http on https error, fails on openssl 3
test: pipe background restconf to /dev/null
2022-09-02 19:44:53 +02:00
Olof hagsand
2eb9c6cda1 Refactored YANG min/max validation code, created new clixon_validate_minmax.[ch]
Added new recursive minmax check for non-presence containers
This makes validation checks stricter, including check of incoming RPCs
Renamed xml_yang_check_list_unique_minmax() to xml_yang_minmax_recurse()
Fixed again: [YANG min-elements within non-presence container does not work](https://github.com/clicon/clixon/issues/355)
2022-09-01 18:29:17 +02:00
Olof hagsand
7e783952eb Restconf callhome: Added YANG connection-type, test: added NACM 2022-08-12 15:05:18 +02:00
Olof hagsand
e724dd7f40 Test: Added detail env var to sum.sh, Changed make test to include detailed test 2022-07-21 09:08:18 +02:00
Olof hagsand
49d19b263c SNMP: Internal cache handling for rowstatus
Test: prefix SN=0 instead of CS=0 for override clixon_snmp start
2022-07-11 10:07:48 +02:00
Kristofer Hallin
ebf251455f Bugfix. 2022-06-26 11:30:29 +02:00
Kristofer Hallin
5962852e9f More table tests for IF-MIB. 2022-06-26 11:30:29 +02:00
Kristofer Hallin
5194514993 New type, Timeticks. 2022-06-26 11:30:29 +02:00
Kristofer Hallin
cb3aef450d More tests for ENTITY-MIB. 2022-06-26 11:29:40 +02:00
Olof hagsand
ef640772df SNMP Frontend, fix handling of snmpd down and memory leaks
If snmpd is down, clixon_snmp does not start
If snmpd stops, clixon_snmp quits
Mem leaks fixed
2022-06-26 11:29:40 +02:00
Kristofer Hallin
a3d0b74e4b Validate both numerical and lexical OIDs. 2022-06-26 11:29:40 +02:00
Kristofer Hallin
2e529290ea Added snmpbulkget. 2022-06-26 11:29:40 +02:00
Kristofer Hallin
44d7d898bb snmpset tests re-written. 2022-06-26 11:29:40 +02:00
Kristofer Hallin
9be8cc51b3 Moved generic SNMP functions to lib.sh 2022-06-26 11:29:40 +02:00
Olof hagsand
eb8d0c0b3a SNMP frontend: added -z zap command-line option and pid-file exclusive check, fixed mem check 2022-06-26 11:28:42 +02:00
Olof hagsand
42f21a309a SNMP frontend: conflict typos, snmp pidfile 2022-06-26 11:28:42 +02:00
Olof hagsand
62a32faf9c SNMP frontend. New snmp_lib.[ch] and rearranged code into lib
Test: renamed WITH_SNMP -> ENABLE_SNMP
2022-06-26 11:28:42 +02:00
Kristofer Hallin
bbcea8b780 Don't rely on the pid-file to see if snmpd is running or not. 2022-06-26 11:28:42 +02:00
Olof hagsand
214b7cc0c7 SNMP frontend test changes
Added a CS variable, set to 0 if you started clixon_snmp yourself (eg in gdb)
Also added BE (backend) with the same purpose for backend
2022-06-26 11:28:42 +02:00
Kristofer Hallin
5a09dcbf13 Change dockerfiles and start scripts to install Net-SNMP, configure snmpd properly
and make sure it is started. This is needed for the SNMP tests (test_snm*) to run properly.
Since we can't rely on systemd in Alpine we start snmpd from the startsystem-scripts.
2022-06-26 11:28:42 +02:00
Olof hagsand
df687f7180 Clixon SNMP frontend
Added two new config options to clixon-config.yang: `CLICON_HTTP_DATA_ROOT`
Added new files: apps/snmp/snmp_mib_yang.[ch] for generic MIB/YANG handling
Test: killall quiet
Test: added specific MIB for generic code: <CLICON_SNMP_MIB>NET-SNMP-EXAMPLES-MIB</CLICON_SNMP_MIB>
2022-06-26 11:28:42 +02:00
Kristofer Hallin
ee06652e86 SNMP tests: Don't start snmpd, check if the system have snmpd started otherwise present instructions for how to configure and start it. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
366b1cb42f Valgrind tests for clixon_snmp. 2022-06-26 11:27:54 +02:00
Olof hagsand
28514c6750 Clixon SNMP frontend update
* Integration of testhandler.c gives proper callback handling
* YANG `clixon-config@2022-03-21.yang` changes:
    * Added option:
      * `CLICON_SNMP_AGENT_SOCK`
2022-06-26 11:27:54 +02:00
Olof hagsand
33c77c8a09 Cleanup, debug stmts, diff vars and obsolete compile options 2022-06-23 15:40:47 +02:00
Olof hagsand
87c65c3541 Fixed: [RPC edit-config payloads are not fully validated](https://github.com/clicon/clixon/issues/337) 2022-06-20 15:08:50 +02:00
Olof hagsand
7065d6f760 Test: restconf CN variable, strip curl newline
Fixed a few compile warnings
2022-05-12 09:40:12 +02:00
Olof hagsand
28bd146e5c Added clixon_netconf command-line option -0and changed -H to -1
* `-0` means dont send hello, but fix netconf base version to 0 and use EOM framing
    * `-1` means dont send hello, but fix netconf base version to 1 and use chunked framing
2022-04-29 19:07:12 +02:00
Olof hagsand
84d88c8ad8 Restconf http-data server updates
Check data paths for .., ~ and soft links
Changed semantics of `CLICON_HTTP_DATA_PATH` and `_ROOT`
Change URI catch-all to 404 instead of 400
Fixed some memory leaks
2022-04-26 17:42:53 +02:00
Olof hagsand
e0100a6e3c Fixed: YANG if-feature in config file did not work, was always on
Test: unset test variables
2022-04-23 16:49:09 +02:00
Olof hagsand
404d05950a HTTP data server updates
Check of enable-http-data config option
HTTP/2 Return 400 bad request if no path match
Test: updated yang file revisions, extended restconf config with http-data
2022-04-22 15:23:38 +02:00
Olof hagsand
e1bec5f6dd Test: Ensured HVER/RCPROTO work as envvars to test and documented it 2022-04-20 15:16:17 +02:00
Olof hagsand
fa077839f0 Misc sanity checks and documentation 2022-04-19 14:19:29 +02:00
Olof hagsand
ecac027d18 CLI argument to shell example callback
Save state of netconf chunked framing between inputs
Treat EBADF in internal protocol (triggered by freebsd+notifications)
Test: chunked encoding: use printf instead of echo
2022-04-11 19:09:26 +02:00
Olof hagsand
c038c9a27f * Implementation of "chunked framing" according to RFC6242 for Netconf 1.1.
* First hello is 1.0 EOM framing, then successing rpc is chunked framing
  * See
    * [Netconf framing](https://github.com/clicon/clixon/issues/50), and
    * [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314)
* C:
  * Moved netconf framing code from netconf application to clixon lib
* Test:
  * New expecteof_netconf and adjusted other expect scripts to handle NETCONF 1.1 framing
2022-03-28 12:36:44 +02:00
Olof hagsand
61661e6940 Restconf and http/1 modifications for http/1-only 2022-02-15 15:48:37 +01:00
Olof hagsand
12dddfd794 * RESTCONF,
* Refactored http1 code
  * fixed some http1/http2 only compile issues
2022-02-14 21:03:23 +01:00
Olof hagsand
3ebc78e3ae Tests for duplication bugfix https://github.com/clicon/clixon/issues/301 2022-02-10 17:14:51 +01:00
Olof hagsand
4aa74fa1d8 * Restconf native http/1, first working version
* Renamed files clixon_http -> restconf_http
  * Split main file into restconf_native.c
  * Remove all evhtp code and libevhtp/libevent dependency
2022-02-08 18:59:47 +01:00
Olof hagsand
dadf4a778a * HTTP/1 native parser as part of the RESTCONF client
* Fixed memory error in opendir/readdir in clicon_file_dirent
* Remove MAXPATH in parsers
* New string-del function
2022-02-08 16:59:08 +01:00
Olof hagsand
0ed34b4fab - test: IEEE yang models directory structure changed, ietf+ieee tests modified
- yang parse minor lex edits: added comments and \r in some rules
2022-02-08 12:03:47 +01:00
Olof hagsand
61e8841642 test: sleep typo, override YANG_INSTALLDIR in docker tests 2022-02-07 15:43:38 +01:00
Olof hagsand
2165a1368b test: helloworld to work in a minimal (openwrt) environment 2022-02-07 14:16:20 +01:00
Olof hagsand
4102ca8a46 * configure --with-wwwdir=<dir> is removed
* test:
  * new test_helloworld.sh smoketest added for testing basic functions
  * stripped restconf fcgi default config
  * added yang variable
2022-02-07 13:31:39 +01:00