The project provides integration tests for SNMP component.
It uses pytest
Python test framework.
SNMP Component source code: https://github.com/aquaticus/esphome/tree/aquaticus-snmp
SNMP Component documentation: https://aquaticus.info/snmp.html
First create a new file and call it secret.yaml
.
Add the following content and modify appropriate lines to match you config.
api_pass: "<API PASS>"
ota_pass: "<OTA PASS>"
wifi_ssid: "<WIFI SSID>"
wifi_pass: "<WIFI PASS>"
There are two yaml
files one for ESP32 and one for ESP8266.
By default, board type is set to d1_mini
(ESP8266) or wemos_d1_mini32
(ESP32).
You can modify board
token to march your test equipment.
Compile and upload test project to ESP32 and/or ESP8266 board.
Install additional Python modules:
pip install -r requirements.txt
esphome run esphome-test-snmp-esp32.yaml
esphome run esphome-test-snmp-esp8266.yaml
Tests accepts 3 (optional) arguments:
--chip
- chip type:esp32
oresp8266
; defaultesp32
--host
- host name or IP address of the board; defaultesphome-test-snmp-esp32.local
--duration
- time in seconds for stability test; default 60s
Runs integrity tests.
pytest --chip esp32 --host esphome-test-snmp-esp32.local snmp_integration_tests.py
Runs integrity tests.
pytest --chip esp32 --host esphome-test-snmp-esp8266.local snmp_integration_tests.py
For more detailed description how to run tests look at pytest documentation.