Commit graph

2071 commits

Author SHA1 Message Date
Kristofer Hallin
baf60e5468 Added test/mibs/ for Clixon specific MIBs. 2022-06-26 11:28:42 +02:00
Olof hagsand
6e60287bc0 SNMP frontend: forgot GET detailed type info in last commit 2022-06-26 11:28:42 +02:00
Olof hagsand
a02e78a3c1 SNMP frontend tests: Added more descriptic types of each get/set value and netsnmp instructions 2022-06-26 11:28:42 +02:00
Kristofer Hallin
a99d1e189e ifNumber should be enclosed by interface. 2022-06-26 11:28:42 +02:00
Olof hagsand
8c253cfc61 SNMP test typo in test_snmp_set 2022-06-26 11:28:42 +02:00
Olof hagsand
05f3ebb59e SNMP frontend: SNMP2YANG type conversion for snmpset 2022-06-26 11:28:42 +02:00
Kristofer Hallin
76ce6bf8d7 Test integer max and -1. 2022-06-26 11:28:42 +02:00
Olof hagsand
aa95ead1cc SNMP frontend: Reworked types for GET types translation
YANG enum type, split up enum to int into two functions
2022-06-26 11:28:42 +02:00
Kristofer Hallin
31fea9e6c8 SNMP type tests. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
657aafd3b1 Extended supported types with uint64. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
bf1643cc43 Extended supported types with uint32. 2022-06-26 11:28:42 +02:00
Kristofer Hallin
a312bd5806 Test all fields in an ifTable with only single entry, disabled for now. 2022-06-26 11:28:42 +02:00
Olof hagsand
46cb21f3e8 SNMP frontend: Generalized type handling for set functions
SPlit scalar_handler into get and set subfunctions
2022-06-26 11:28:42 +02:00
Olof hagsand
ef604be610 SNMP frontend, restructure files
Split snmp_mib_yang.c into: snmp_register.[ch] and snmp_handler.[ch]
2022-06-26 11:28:42 +02:00
Olof hagsand
f905f66efa SNMP frontend: Changed yang2xpath to us string, traverse only datanodes 2022-06-26 11:28:42 +02:00
Olof hagsand
484507b628 removed binary added by mistake 2022-06-26 11:28:42 +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
Kristofer Hallin
2366be0062 Handle errors from clixon_table_create. 2022-06-26 11:28:42 +02:00
Olof hagsand
c366962054 SNMP frontend: changed default mibyang dir to /share/mib-yangs to be same as repo
Test: new prel test_snmp_ifmib.sh
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
5172cf15fa SNMP frontend: getnext, oid sanity checks and scalar debug 2022-06-26 11:28:42 +02:00
Kristofer Hallin
59a637fdf4 New function, clixon_table_create which will clear a table and create any rows, indexes and columns to avoid collissions. 2022-06-26 11:28:42 +02:00
Olof hagsand
99cd8bacc0 SNMP frontend generic code for tables and clixon backend
Added snmp-msg translation table
Changed test-table to only GET
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
Olof hagsand
1f8b82e8e1 SNMP frontend, add int32 + string type for scalars
Added get string test
Added set value for netconf test
2022-06-26 11:28:42 +02:00
Olof hagsand
72534e864d SNNP frontend. Added SMI default value support and deviation for set 2022-06-26 11:28:42 +02:00
Kristofer Hallin
9b0cf2f7c4 For tables use a callback to create indexes, rows etc. 2022-06-26 11:28:42 +02:00
Olof hagsand
4ff2ea099c SNMP frontend table fix: handler called with heartrate, return 0 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
3bb681ffe2 SNMP frontend, main test for config false only, write test move to test_snmp_set.sh 2022-06-26 11:28:42 +02:00
Olof hagsand
182b72a4cc SNMP frontend, RPC of single variable through clixon 2022-06-26 11:28:42 +02:00
Olof hagsand
4e0d9dd987 SNMP frontend
Fixed table/scalar collision issue
Made the CS variable change said to be in previous commit
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
f9d2acf025 Minimal snmpd configuration for the Docker containers. Also change the pid-dir to /var/run/ since
that is what all the tests are expecting. Can we pass the tests now?
2022-06-26 11:28:42 +02:00
Kristofer Hallin
4182ee3540 Removed problematic MIB for now. 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
Kristofer Hallin
7bdc5045b2 In come cases we need YANG files which are converted from SNMP MIBs using smidump. For the Docker images we'll clone the from an external repository. 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
c9eae77d61 SNMP MIB to YANG conversion. Script to traverse a MIB directory and convert the MIBs to YANG files using smidump. 2022-06-26 11:28:42 +02:00
Olof hagsand
f112580546 SNMP MIB->YANG translation file handling.
Added configure option  --with-mib-generated-yang-dir=DIR with
default value /usr/share/mibyang where generated YANGs from MIBs
should be placed so that SNMP tests know where to find the YANGs.
2022-06-26 11:28:42 +02:00
Olof hagsand
2699393c4a SNMP: replaced testhandler code to use only NET-SNMP-EXAMPLES-MIB for scalar and table 2022-06-26 11:27:54 +02:00
Kristofer Hallin
4c3bbcc0ed Fix for snmpd in Alpine, snmpd crashes with the default configuration. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
0ec26df953 Fixed minor typo in comment. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
b7c8a27f67 Tests for SNMP tables. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
f443f4f9b3 Added example for tables. 2022-06-26 11:27:54 +02:00
Kristofer Hallin
0fc5bd3bfb Workaround for crashing snmpd in Alpine. 2022-06-26 11:27:54 +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
Kristofer Hallin
c584d171ee Check if we have Net-SNMP support enabled before trying to run SNMP tests. 2022-06-26 11:26:04 +02:00