Skip to content

Commit 2353938

Browse files
authored
Update test_snmp_server.py
1 parent 7cc2120 commit 2353938

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/test_snmp_server.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,21 @@
1515
from .utils import (
1616
assert_connect_is_logged,
1717
IP,
18+
connect_to,
1819
load_logs_from_file,
1920
wait_for_server,
2021
)
2122

2223
PORT = "50161"
2324

24-
2525
@pytest.mark.parametrize(
2626
"server_logs",
2727
[{"server": QSNMPServer, "port": PORT}],
2828
indirect=True,
2929
)
30-
def test_snmp_server(server_logs):
31-
with wait_for_server(PORT):
32-
g = getCmd(
33-
SnmpEngine(),
34-
CommunityData("public"),
35-
UdpTransportTarget((IP, int(PORT))),
36-
ContextData(),
37-
ObjectType(ObjectIdentity("1.3.6.1.4.1.9.9.618.1.4.1.0")),
38-
)
39-
next(g)
30+
def test_postgres_server(server_logs):
31+
with wait_for_server(PORT), connect_to(IP, PORT, udp=True) as connection:
32+
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')
4033

4134
logs = load_logs_from_file(server_logs)
4235

0 commit comments

Comments
 (0)