Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
fix: partial fix for dynamic MIB loading
Browse files Browse the repository at this point in the history
- Fixed one MIB file name in unit-test
  • Loading branch information
lstoppa authored and lingy1028 committed Jul 20, 2021
1 parent b42ee99 commit 9d55d14
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lookups/mibs_list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ PYSNMP-SOURCE-MIB
PYSNMP-USM-MIB
VMSTORE-MIB
VERITAS-APPLIANCE-MONITORING-MIB
HOST-RESOURCES-MIB
NETSERVER-MIB
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ sc4snmp-mib-server = "splunk_connect_for_snmp_mib_server.snmp_mib_server:main"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "DEBUG"

5 changes: 1 addition & 4 deletions tests/lookups/mibs_list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@ FIBRE-CHANNEL-FE-MIB
HPR-IP-MIB
PYSNMP-MIB
PYSNMP-SOURCE-MIB
PYSNMP-USM-MIB
VMSTORE-MIB
VERITAS-APPLIANCE-MONITORING-MIB
HOST-RESOURCES-MIB
PYSNMP-USM-MIBVMSTORE-MIB
5 changes: 2 additions & 3 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def test_translate_all_snmp_simulator_data_types(self):
"sc4snmp.IF-MIB.ifPhysAddress_2",
"sc4snmp.SNMPv2-MIB.sysORID_7",
"sc4snmp.TCP-MIB.tcpConnRemAddress_195_218_254_105_51684_194_67_10_226_22",
"sc4snmp.HOST-RESOURCES-MIB.hrDeviceErrors_1025",
"sc4snmp.NETSERVER-MIB.hrDeviceErrors_1025",
"sc4snmp.IF-MIB.ifHighSpeed_2",
"sc4snmp.SNMPv2-MIB.sysUpTime_0",
"sc4snmp.1_3_6_1_4_1_2021_10_1_6_1",
Expand Down Expand Up @@ -313,13 +313,12 @@ def test_more_mib_files(self):
expected_values = [
"sc4snmp.VMSTORE-MIB.mirrorLatency",
"sc4snmp.VERITAS-APPLIANCE-MONITORING-MIB.vrtssystemName",
"sc4snmp.HOST-RESOURCES-MIB.hrSystemProcesses",
"sc4snmp.NETSERVER-MIB.hrSystemProcesses",
]

for i in range(0, len(input_var_binds)):
translated_metrics = self.my_translator.format_metric_data(
input_var_binds[i]
)
translated_dict = json.loads(translated_metrics)
# logger.info(translated_dict)
assert translated_dict["metric_name"] == expected_values[i]

0 comments on commit 9d55d14

Please sign in to comment.