Commit graph

207 commits

Author SHA1 Message Date
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
Olof hagsand
081e6871b3 * Renamed clixon-clispec.yang to clixon-autocli.yang
* First version of clixon-autocli.yang semantics
   * Default rules for module exclusion, list-keywords, completion, treeref-state
   * Specialized rules for compress and exclusion of modules
   * See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli)
* Obsoleted and moved autocli config options from clixon-config.yang to clixon-autocli.yang as follows:
   * `CLICON_CLI_GENMODEL`, use: `autocli/module-default=false` instead
      * Removed `clicon_cli_genmodel()`
   * `CLICON_CLI_GENMODEL_TYPE`, use `autocli/list-keyword-default` and compress rules instead)
      * Removed `clicon_cli_genmodel_type()`
   * `CLICON_CLI_GENMODEL_COMPLETION`, use `autocli/completion-default` instead
      * Removed `clicon_cli_genmodel_completion()`
   * `CLICON_CLI_AUTOCLI_EXCLUDE`, use `autocli/rule/operation=exclude` instead
   * `CLICON_CLI_MODEL_TREENAME`, use constant `AUTOCLI_TREENAME` instead
     * Removed `clicon_cli_model_treename()`
* New YANG functions: yang_single_child_type, yang_find_namespace_by_prefix, yang_str2key
* Changed return values of yang_find_prefix_by_namespace
* Merged `cli_cli2xml()` into `cli2xml()`
2022-01-07 12:50:07 +01:00
Olof hagsand
50ac510803 * Fixed: Configure option CLICON_RESTCONF_PATH was marked as obsolete but was still used.
* `CLICON_RESTCONF_PATH` is now obsolete for sure
    * Instead if you use fgci/nginx:
      * Use `restconf/fcgi-socket`
      * Ensure `<CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>` is set
* Added default values to restconf-config and save fcgi-socket-path in memory
2022-01-01 11:52:18 +01:00
Olof hagsand
4fbad467df * Tests: use YANG_STANDARD_DIR from ./configure --with-yang-standard-dir=DIR instead of YANGMODELS from site.sh 2021-12-16 22:44:45 +01:00
Olof hagsand
339b744835 * Optional yangs for testing have been removed from the Clixon repo
* These were included for testing
  * If you want to run the Clixon test suite you need to point `YANGMODELS`, see test/README.md
  * The following configure options have been removed:
    * `configure --with-opt-yang-installdir=DIR`
    * `configure   --enable-optyangs`
  * You may need to specify standard YANGs using configure option `--with-yang-standard-dir=DIR`
* Updated yang ietf models with fetures for tet
* Added option `CLICON_YANG_AUGMENT_ACCEPT_BROKEN` to accept broken yangmodels.
  * This is a debug option for CI testcases where standard YANG models are broken
2021-11-29 10:28:34 +01:00
Olof hagsand
5388aace12 Refactoring for better performance of large auto-cli specs
* Fixed: [very slow execution of load_set_file #288](https://github.com/clicon/clixon/issues/288)
* New `clixon-lib@2021-11-11.yang` revision
  * Modified option: RPC stats extended with YANG stats
* Modified `clixon-config@2021-11-11.yang` revision
  * Added option:
    * CLICON_PLUGIN_CALLBACK_CHECK
    * Enable to make plugin context check before and after all callbacks.
* Added statistics for YANG: number of objects and memory used
* Use the treeref no-copy option of CLIgen to reduce memory
* Refactored cli-generation/autocli-start code
* Refactored cligen glue functions to use cligen_eval directly (remove clicon_eval,clixon_cligen_eval)
2021-11-25 12:04:05 +01:00
Olof hagsand
55377786c1 Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +02:00
Olof hagsand
8352e25860 * Restconf internal start: fail early if clixon_restconf binary is not found
* If CLICON_BACKEND_RESTCONF_PROCESS is true
2021-08-17 10:08:04 +02:00
Olof hagsand
3539a80d5e restconf fcgi mem leak in indata
test pkill needs sleep before name settles
2021-06-27 16:40:27 +02:00
Olof Hagsand
e3e36aba50 test restconf: restconf proto should be default https only for native, not fcgi 2021-06-24 14:31:59 +00:00
Olof Hagsand
2d7d3c9782 test restconf native: generete server cert if not exists 2021-06-24 13:01:19 +00:00