Is your feature request related to a problem? Please describe.
Newbie to snmpsim and it's great. I'm using it in pytests where the code under test uses pysnmp. Currently I'm calling the command line snmpsim-command-responder in a subprocess during test setup, and killing the process during test teardown.
It'd be great if there was a context managed class which takes the command line args and does the same as the cli.
Describe the solution you'd like
A solution might be a class something like SnmpsimCommandResponder. It might be used something like:
def test_foo():
with SnmpsimCommandResponder(data_dir="data/", agent_udpv2_endpoint="127.0.0.1:1234",...):
# execute some code which makes snmp calls
A quick glance at the code, it looked like this might require some refactoring of responder.py, splitting out the argument parsing and the actual main listening loop into a separate component, but honestly not certain.
Describe alternatives you've considered
Currently running it directly in a subprocess works.
Additional context
No response
Is your feature request related to a problem? Please describe.
Newbie to
snmpsimand it's great. I'm using it in pytests where the code under test usespysnmp. Currently I'm calling the command linesnmpsim-command-responderin a subprocess during test setup, and killing the process during test teardown.It'd be great if there was a context managed class which takes the command line args and does the same as the cli.
Describe the solution you'd like
A solution might be a class something like
SnmpsimCommandResponder. It might be used something like:A quick glance at the code, it looked like this might require some refactoring of responder.py, splitting out the argument parsing and the actual main listening loop into a separate component, but honestly not certain.
Describe alternatives you've considered
Currently running it directly in a subprocess works.
Additional context
No response