From 2fc5d16d495ac86bacaff2dbfa213b2f47498ac9 Mon Sep 17 00:00:00 2001 From: ogenstad Date: Wed, 11 Jan 2017 11:56:24 +0100 Subject: [PATCH] get_snmp without acl --- napalm_eos/utils/textfsm_templates/snmp_config.tpl | 1 + .../no_acl/expected_result.json | 11 +++++++++++ .../show_running_config___section_snmp_server.text | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 test/unit/mocked_data/test_get_snmp_information/no_acl/expected_result.json create mode 100644 test/unit/mocked_data/test_get_snmp_information/no_acl/show_running_config___section_snmp_server.text diff --git a/napalm_eos/utils/textfsm_templates/snmp_config.tpl b/napalm_eos/utils/textfsm_templates/snmp_config.tpl index 2340e09..491beb0 100644 --- a/napalm_eos/utils/textfsm_templates/snmp_config.tpl +++ b/napalm_eos/utils/textfsm_templates/snmp_config.tpl @@ -10,5 +10,6 @@ Start ^snmp-server\scontact\s${Contact} ^snmp-server\schassis-id\s${Chassis_ID} ^snmp-server\scommunity\s${Community}\s((${Mode} ${ACL})|(group\s(.*))) -> Next.Record + ^snmp-server\scommunity\s${Community}\s${Mode} -> Next.Record EOF diff --git a/test/unit/mocked_data/test_get_snmp_information/no_acl/expected_result.json b/test/unit/mocked_data/test_get_snmp_information/no_acl/expected_result.json new file mode 100644 index 0000000..5984bcc --- /dev/null +++ b/test/unit/mocked_data/test_get_snmp_information/no_acl/expected_result.json @@ -0,0 +1,11 @@ +{ + "community": { + "public": { + "mode": "ro", + "acl": "" + } + }, + "contact": "noc@cloudflare.com", + "location": "Marseille, France", + "chassis_id": "edge02.mrs01" +} diff --git a/test/unit/mocked_data/test_get_snmp_information/no_acl/show_running_config___section_snmp_server.text b/test/unit/mocked_data/test_get_snmp_information/no_acl/show_running_config___section_snmp_server.text new file mode 100644 index 0000000..5abad6f --- /dev/null +++ b/test/unit/mocked_data/test_get_snmp_information/no_acl/show_running_config___section_snmp_server.text @@ -0,0 +1,4 @@ +snmp-server contact noc@cloudflare.com +snmp-server location Marseille, France +snmp-server chassis-id edge02.mrs01 +snmp-server community public ro