NetworkPingComparator is a Python module for pinging two networks and displaying the difference in host reponses.
Requires pytest~=6.2.4
Use the package manager pip to install requirements.
pip install -r requirements
from network_ping_comparator import NetworkPingComparator
# define networks to test
NETWORK_1 = "192.168.1.0/24"
NETWORK_2 = "192.168.2.0/24"
# list of excluded addresses
EXCLUDED_HOST = ["0", "255"]
comparator = NetworkPingComparator(NETWORK_1, NETWORK_2)
comparator.exclude_host(EXCLUDED_HOST)
comparator.run()
result = comparator.output()
Unit tests are in ./tests/
Run using pytest at root project directory
./pytest
[None]