Commit graph

2785 commits

Author SHA1 Message Date
Kristofer Hallin
eb6185c888 Validate both numerical and lexical OIDs. 2022-06-03 06:20:02 +02:00
Kristofer Hallin
2a181fd5de Added snmpbulkget. 2022-06-02 19:35:32 +02:00
Kristofer Hallin
8e1705495c Only run certain tests if snmp_debug is set. 2022-06-02 19:34:07 +02:00
Olof hagsand
b6bfcb69f7 Text syntax parser/loader
Added support for list x y;
Uses a mechanism to parse as unknown XML body and post-parsing replace with list keys
Fixed example and test to work with new TEXT syntax
2022-06-02 19:28:49 +02:00
Kristofer Hallin
c42379e874 First set of tests using bulkget. 2022-06-02 19:25:10 +02:00
Kristofer Hallin
a33db6ef15 snmpset tests re-written. 2022-06-02 16:21:59 +02:00
Olof hagsand
0c79298e76 Changed C-API for xml translation/print the internal cxobj tree data structure to other formats
New API is as follows:
  * `clixon_xml2file()` - Print internal tree as XML to file
  * `clixon_xml2cbuf()` - Print internal tree as XML to buffer
  * `clixon_json2file()` - Print internal tree as JSON to file
  * `clixon_json2cbuf()` - Print internal tree as JSON to buffer
  * `clixon_cli2file()` - Print internal tree as CLI format to file
  * `clixon_txt2file()` - Print internal tree as text format to file
2022-06-01 20:02:27 +02:00
Olof hagsand
87719c623c Text syntax parser/loader
Leaf-list syntax using: "id [ leaf leaf ...]" syntax for output and input
Variables using \n\r in text
Added clixon_xvec_merge()
2022-06-01 11:08:19 +02:00
Olof hagsand
820ed5686b Text syntax parser/loader
Added string quites around text containing spaces
Added support for colon in text
2022-06-01 11:07:55 +02:00
Olof hagsand
2ece0b8f51 * Experimental text syntax parser/loader
* Added new text syntax parsing and loading from CLI
  * Unified text output functions to `xml2txt` and moved to clixon_text_syntax.[ch]
    * The following are removed: `cli_xml2txt` and `xml2txt_cb`
  * Text output format changed:
    * Namespace/modulename added to top-level
  * See [Support performant load_config_file(...) for TEXT format](https://github.com/clicon/clixon/issues/324)
2022-06-01 11:07:15 +02:00
Olof hagsand
43a57dad79 Changed C-API for xml translation/print to other formats.
* Added `skiptop` parameter, if set only apply to children of a node, skip top node
    * default is 0
* Functions are merged, ie removed and replaced with more generic functions
* `xml2json_cbuf()`: Added `skiptop` parameter: `xml2json_cbuf(..., int skiptop)`
* `xml2json()` and `xml2json_cb()` merged into `xml2json_file()` with `skiptop`
    * Replace `xml2json(...)` with `xml2json_file(..., stdout, 0)`
    * Replace `xml2json_cb(...)` with `xml2json_file(..., 0)`
* `clicon_xml2cbuf()`: Added `skiptop` parameter: `clicon_xml2cbuf(..., int skiptop)`
* `xml2cli()`: Added `skiptop` parameter: `xml2cli(..., int skiptop)`
2022-06-01 10:48:39 +02:00
Kristofer Hallin
118e198a1e test_snmp_types.sh are now test_snmp_get.sh 2022-05-31 21:11:04 +02:00
Kristofer Hallin
ad34885303 No copy 2022-05-31 21:10:18 +02:00
Kristofer Hallin
03988e4a0f Some variables and functions now live in lib.sh 2022-05-31 21:03:04 +02:00
Kristofer Hallin
0bceddd75d Copy Clixon MIB from test/mib/ to system MIB directory. 2022-05-31 21:01:54 +02:00
Kristofer Hallin
6969149a20 Modified the CLIXON-TYPES-MIB to use other OID, avoid collisions. 2022-05-31 21:00:35 +02:00
Kristofer Hallin
ee0f238fad SNMP get tests for various types. 2022-05-31 20:56:05 +02:00
Kristofer Hallin
0c370065a6 Moved generic SNMP functions to lib.sh 2022-05-31 20:55:39 +02:00
Olof hagsand
724b94137f Test, fixed the fix of previous commits 2022-05-30 15:47:54 +02:00
Olof hagsand
ebe3d8e454 Test: fixed an occasional error in actions depending on hostname inclduing '92' 2022-05-30 15:36:37 +02:00
Olof hagsand
8e6ba7fa53 test of cligen expand bug #332 2022-05-30 15:27:19 +02:00
Kristofer Hallin
73710ca7bf Re-structured entity tests. 2022-05-30 15:23:40 +02:00
Kristofer Hallin
73e54009a8 Merge branch 'snmp' of https://github.com/clicon/clixon into snmp 2022-05-30 14:18:08 +02:00
Kristofer Hallin
ce0a53511a Install the needed MIB for our Docker tests and wait a few seconds for snmpd to start. 2022-05-30 14:17:55 +02:00
Kristofer Hallin
0f8d50d5a4 Added ENTITY-MIB needed for tests. 2022-05-30 13:46:23 +02:00
Kristofer Hallin
72f1ecbdb2 Added MIBs needed for tests. 2022-05-30 13:43:14 +02:00
Olof hagsand
5740d37737 Clixon 5.8.0.pre 2022-05-30 12:30:37 +02:00
Olof hagsand
739193a3de SNMP frontend: Types and indexes
Added timestamp and inet address
First go at index names
2022-05-30 11:34:35 +02:00
Kristofer Hallin
25e92bf15d Verify all table elements for system MIB tests. 2022-05-29 14:55:57 +02:00
Kristofer Hallin
9b42d00219 Losts of new tests for ENTITY-MIB. 2022-05-28 21:46:45 +02:00
Kristofer Hallin
ba354dac46 One more entry for IF-MIB tests. 2022-05-28 21:29:29 +02:00
Olof hagsand
b2fbcb395c SNMP frontend, forgot add some files in last commit 2022-05-28 15:37:44 +02:00
Olof hagsand
02983a025a SNMP frontend: special case for SnmpAdminString with not null-terminated string 2022-05-28 15:30:16 +02:00
Olof hagsand
bf110058bc SNMP Frontend, fixed remaining types: phys-addr, timeticks, binary, objectid 2022-05-28 10:48:17 +02:00
Kristofer Hallin
04d51b6a56 Initial entity tests. 2022-05-27 16:10:38 +02:00
Kristofer Hallin
a8175e3c63 Don't load any of the MIBs we want to test, we will register the OIDs ourselves. 2022-05-26 20:27:08 +02:00
Kristofer Hallin
4d82b69946 System tests for SNMP. 2022-05-26 20:17:43 +02:00
Olof hagsand
b2be7e9e1b SNMP frontend, new preli table handling code
Skipped data set and use table-helper only
Specialized SNMP error handling
2022-05-26 19:04:51 +02:00
Kristofer Hallin
1a2edb7a2a Removed test_snmp.sh, replaced by other tests. 2022-05-26 11:00:22 +02:00
Kristofer Hallin
934e4a776b Added test/mibs/ for Clixon specific MIBs. 2022-05-25 21:38:02 +02:00
Olof hagsand
f6b762f4a5 SNMP frontend: forgot GET detailed type info in last commit 2022-05-25 20:24:27 +02:00
Olof hagsand
a7df2cd2f2 SNMP frontend tests: Added more descriptic types of each get/set value and netsnmp instructions 2022-05-24 11:16:44 +02:00
Kristofer Hallin
d838f16e6a ifNumber should be enclosed by interface. 2022-05-23 21:37:34 +02:00
Olof hagsand
0fa35b6926 SNMP test typo in test_snmp_set 2022-05-23 14:42:29 +02:00
Olof hagsand
675f4c9f7e SNMP frontend: SNMP2YANG type conversion for snmpset 2022-05-23 14:33:32 +02:00
Kristofer Hallin
d78f6c5ac7 Test integer max and -1. 2022-05-23 09:51:32 +02:00
Olof hagsand
7a1dc5da50 SNMP frontend: Reworked types for GET types translation
YANG enum type, split up enum to int into two functions
2022-05-23 09:27:32 +02:00
Kristofer Hallin
e44d76cc3a SNMP type tests. 2022-05-23 09:27:27 +02:00
Kristofer Hallin
91bed5589a Extended supported types with uint64. 2022-05-22 21:09:03 +02:00
Kristofer Hallin
aea2760cb0 Extended supported types with uint32. 2022-05-21 09:49:08 +02:00