Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consider providing a way to start snmpsim-command-responder in python directly #184

@rhoban13

Description

@rhoban13

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:snmpsimSNMP SimulatorideaSuggestions/advice on new things, but might not be mature enough to work on.priority:lowLow priority items.up for grabsPull requests are welcomeworkaround availableWhile this is a bug, feasible workarounds exist so users can continue their work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions