Skip to content

Commit

Permalink
Update test_snmp_server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
giga-a authored Sep 24, 2024
1 parent 7cc2120 commit 2353938
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions tests/test_snmp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,21 @@
from .utils import (
assert_connect_is_logged,
IP,
connect_to,
load_logs_from_file,
wait_for_server,
)

PORT = "50161"


@pytest.mark.parametrize(
"server_logs",
[{"server": QSNMPServer, "port": PORT}],
indirect=True,
)
def test_snmp_server(server_logs):
with wait_for_server(PORT):
g = getCmd(
SnmpEngine(),
CommunityData("public"),
UdpTransportTarget((IP, int(PORT))),
ContextData(),
ObjectType(ObjectIdentity("1.3.6.1.4.1.9.9.618.1.4.1.0")),
)
next(g)
def test_postgres_server(server_logs):
with wait_for_server(PORT), connect_to(IP, PORT, udp=True) as connection:
connection.send(b'\x30\x2e\x02\x01\x01\x04\x06\x70\x75\x62\x6c\x69\x63\xa0\x21\x02\x04\x00\xab\x61\x67\x02\x01\x00\x02\x01\x00\x30\x13\x30\x11\x06\x0d\x2b\x06\x01\x04\x01\x09\x09\x84\x6a\x01\x04\x01\x00\x05\x00')

logs = load_logs_from_file(server_logs)

Expand Down

0 comments on commit 2353938

Please sign in to comment.