From 892fc933c018a53c914c82a07193c964bdee8159 Mon Sep 17 00:00:00 2001 From: wvandeun <7521270+wvandeun@users.noreply.github.com> Date: Thu, 2 Apr 2020 14:36:22 +0200 Subject: [PATCH] Enhancement: cisco_asa_show_inventory support inventory items w/o SN (#638) --- templates/cisco_asa_show_inventory.textfsm | 1 + .../cisco_asa_show_inventory_empty_sn.raw | 5 +++++ .../cisco_asa_show_inventory_empty_sn.yml | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.raw create mode 100644 tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.yml diff --git a/templates/cisco_asa_show_inventory.textfsm b/templates/cisco_asa_show_inventory.textfsm index bd9ff41d9c..45ea920a1b 100644 --- a/templates/cisco_asa_show_inventory.textfsm +++ b/templates/cisco_asa_show_inventory.textfsm @@ -7,6 +7,7 @@ Value SN (\S+) Start ^Name:\s+"${NAME}"\s*,\s+DESCR:\s+"${DESCR}" ^PID:\s+${PID}\s*,\s+VID:\s+${VID}\s*,\s+SN:\s+${SN} -> Record + ^PID:\s+${PID}\s*,\s+VID:\s+${VID}\s*,\s+SN: -> Record ^\s*$$ ^show_inventory_all\s+\S+ -> NoRecord ^.+ -> Error diff --git a/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.raw b/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.raw new file mode 100644 index 0000000000..0ddaca7f70 --- /dev/null +++ b/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.raw @@ -0,0 +1,5 @@ +Name: "Chassis", DESCR: "ASA 5506-X with FirePOWER services, 8GE, AC, DES" +PID: ASA5506 , VID: V01 , SN: JMX8318372GB + +Name: "Storage Device 1", DESCR: "ASA 5506-X SSD" +PID: ASA5506-SSD , VID: N/A , SN: \ No newline at end of file diff --git a/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.yml b/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.yml new file mode 100644 index 0000000000..51c4462b25 --- /dev/null +++ b/tests/cisco_asa/show_inventory/cisco_asa_show_inventory_empty_sn.yml @@ -0,0 +1,12 @@ +--- +parsed_sample: + - name: "Chassis" + descr: "ASA 5506-X with FirePOWER services, 8GE, AC, DES" + pid: "ASA5506" + sn: "JMX8318372GB" + vid: "V01" + - name: "Storage Device 1" + descr: "ASA 5506-X SSD" + pid: "ASA5506-SSD" + sn: "" + vid: "N/A"