From fbd4bc126973b394a17a7efcdf04d306411f1fd0 Mon Sep 17 00:00:00 2001 From: bnerickson Date: Wed, 7 Dec 2022 14:02:23 -0800 Subject: [PATCH] Adding certificate application tests (#14708) --- tests/data/linux_certificate-v1.json | 65 ++++++++++++++++++++++ tests/snmpsim/linux_certificate-v1.snmprec | 10 ++++ 2 files changed, 75 insertions(+) create mode 100644 tests/data/linux_certificate-v1.json create mode 100644 tests/snmpsim/linux_certificate-v1.snmprec diff --git a/tests/data/linux_certificate-v1.json b/tests/data/linux_certificate-v1.json new file mode 100644 index 0000000000..e0aba58a60 --- /dev/null +++ b/tests/data/linux_certificate-v1.json @@ -0,0 +1,65 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.8072.3.2.10", + "sysDescr": "Linux server 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64", + "sysContact": "", + "version": "3.10.0-693.5.2.el7.x86_64", + "hardware": "Generic x86 64-bit", + "features": null, + "location": "", + "os": "linux", + "type": "server", + "serial": null, + "icon": "linux.svg" + } + ] + }, + "poller": "matches discovery" + }, + "applications": { + "discovery": { + "applications": [ + { + "app_type": "certificate", + "app_state": "UNKNOWN", + "discovered": 1, + "app_state_prev": null, + "app_status": "", + "app_instance": "", + "data": null + } + ] + }, + "poller": { + "applications": [ + { + "app_type": "certificate", + "app_state": "OK", + "discovered": 1, + "app_state_prev": "UNKNOWN", + "app_status": "", + "app_instance": "", + "data": null + } + ], + "application_metrics": [ + { + "metric": "host.realm.net_age", + "value": 1, + "value_prev": null, + "app_type": "certificate" + }, + { + "metric": "host.realm.net_remaining_days", + "value": 88, + "value_prev": null, + "app_type": "certificate" + } + ] + } + } +} diff --git a/tests/snmpsim/linux_certificate-v1.snmprec b/tests/snmpsim/linux_certificate-v1.snmprec new file mode 100644 index 0000000000..4fff272271 --- /dev/null +++ b/tests/snmpsim/linux_certificate-v1.snmprec @@ -0,0 +1,10 @@ +1.3.6.1.2.1.1.1.0|4|Linux server 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10 +1.3.6.1.2.1.1.3.0|67|77550514 +1.3.6.1.2.1.1.4.0|4| +1.3.6.1.2.1.1.5.0|4| +1.3.6.1.2.1.1.6.0|4| +1.3.6.1.2.1.25.1.1.0|67|77552962 +1.3.6.1.4.1.8072.1.3.2.2.1.21.6.100.105.115.116.114.111|2|1 +1.3.6.1.4.1.8072.1.3.2.2.1.21.11.99.101.114.116.105.102.105.99.97.116.101|2|1 +1.3.6.1.4.1.8072.1.3.2.3.1.2.11.99.101.114.116.105.102.105.99.97.116.101|4x|7b226572726f72223a20302c20226572726f72537472696e67223a2022222c202276657273696f6e223a20312c202264617461223a205b7b22636572745f6e616d65223a2022686f73742e7265616c6d2e6e6574222c2022616765223a20312c202272656d61696e696e675f64617973223a2038387d5d7d0a