Repository: networktocode/ntc-templates

Issue:
arista_eos_show_version (Updates)
Can we add uptime to show version? This new textfsm format with the added variable seems to work.

```
Value MODEL (\S+)
Value HW_VERSION (\S+)
Value SERIAL_NUMBER (\S+)
Value SYS_MAC (\S+)
Value IMAGE (\S+)
Value TOTAL_MEMORY (\d+)
Value FREE_MEMORY (\d+)
Value UPTIME (Uptime: .+)

Start
  ^Arista\s+${MODEL}
  ^Hardware\s+version:\s+${HW_VERSION}
  ^Serial\s+number:\s+${SERIAL_NUMBER}
  ^System\s+MAC\s+address:\s+${SYS_MAC}
  ^Software\s+image\s+version:\s+${IMAGE}
  ^Total\s+memory:\s+${TOTAL_MEMORY}
  ^Free\s+memory:\s+${FREE_MEMORY}
  ^${UPTIME}
```
```
Arista DCS-7010T-48-R
Hardware version: 12.03
Serial number: JPE18523609
Hardware MAC address: 985d.82b8.faf5
System MAC address: 985d.82b8.faf5

Software image version: 4.28.9M
Architecture: i686
Internal build version: 4.28.9M-33818481.4289M
Internal build ID: ecbeee98-6249-4e05-84e6-60b46a08f83e
Image format version: 3.0
Image optimization: Strata-4GB

Uptime: 3 weeks, 0 days, 20 hours and 45 minutes
Total memory: 3982456 kB
Free memory: 2076700 kB
```


Discussion:
> Can we add uptime to show version? This new textfsm format with the added variable seems to work.
> 
> ```
> Value MODEL (\S+)
> Value HW_VERSION (\S+)
> Value SERIAL_NUMBER (\S+)
> Value SYS_MAC (\S+)
> Value IMAGE (\S+)
> Value TOTAL_MEMORY (\d+)
> Value FREE_MEMORY (\d+)
> Value UPTIME (Uptime: .+)
> ```

Sure.

We might want to tweak that a little, but I get the idea.

Did you see my note on issue #2108 about whether you're up for putting a pull request together?
i cant seem to figure out how to do this pull request. Concept of branches is new to me. Do i  select release7_8_0 as my Brach and then submit the PR?
> i cant seem to figure out how to do this pull request. Concept of branches is new to me. Do i select release7_8_0 as my Brach and then submit the PR?

Branch from the main branch -- in the case of ntc-templates it's named _master_.

Along the lines of my note on issue #2108, you'll want to first [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the ntc-templates repo so you have your own "copy" on GitHub that you can create branches and push to.

(Eventually when all of your changes/commits are checked into your branch you'd submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) against/to the networktocode/ntc-templates repo. Don't fret, this stuff is a learning process.)

Additionally, it will be necessary to confirm if we already have test data that covers this or if more test data is needed.

Since you have several items you recently pointed out, let me know if there are any I should work on.
_(Should you choose to accept the mission, I want to give you the opportunity of seizing the learning opportunity!)_ :sunglasses:
Ok i think i have the 2 PR submitted correctly i think




Patch:
diff --git a/ntc_templates/templates/arista_eos_show_version.textfsm b/ntc_templates/templates/arista_eos_show_version.textfsm
index 4a40948dbb..dd7a031747 100644
--- a/ntc_templates/templates/arista_eos_show_version.textfsm
+++ b/ntc_templates/templates/arista_eos_show_version.textfsm
@@ -5,12 +5,19 @@ Value SYS_MAC (\S+)
 Value IMAGE (\S+)
 Value TOTAL_MEMORY (\d+)
 Value FREE_MEMORY (\d+)
+Value UPTIME (.+)
 
 Start
   ^Arista\s+${MODEL}
-  ^Hardware\s+version:\s+${HW_VERSION}
-  ^Serial\s+number:\s+${SERIAL_NUMBER}
+  ^Hardware\s+version:(\s+${HW_VERSION})?
+  ^Hardware\s+MAC\s+address:\s+\S+
+  ^Serial\s+number:(\s+${SERIAL_NUMBER})?
   ^System\s+MAC\s+address:\s+${SYS_MAC}
   ^Software\s+image\s+version:\s+${IMAGE}
+  ^Architecture:\s+\S+
+  ^Internal\s+build\s+(version|ID):\s+\S+
+  ^Image\s+(format\s+version|optimization):\s+\S+
+  ^Uptime:\s+${UPTIME}
   ^Total\s+memory:\s+${TOTAL_MEMORY}
   ^Free\s+memory:\s+${FREE_MEMORY} -> Record
+  ^. -> Error


Test patch:
diff --git a/tests/arista_eos/show_version/arista_eos_show_version.yml b/tests/arista_eos/show_version/arista_eos_show_version.yml
index 1a3d84e356..8f44196ecb 100644
--- a/tests/arista_eos/show_version/arista_eos_show_version.yml
+++ b/tests/arista_eos/show_version/arista_eos_show_version.yml
@@ -1,9 +1,10 @@
 ---
 parsed_sample:
   - free_memory: "301240"
-    total_memory: "2028860"
     hw_version: ""
     image: "4.14.7M"
     model: "vEOS"
     serial_number: ""
     sys_mac: "2803.829a.1347"
+    total_memory: "2028860"
+    uptime: "1 hour and 5 minutes"
diff --git a/tests/arista_eos/show_version/arista_eos_show_version2.raw b/tests/arista_eos/show_version/arista_eos_show_version2.raw
new file mode 100644
index 0000000000..896b9daf64
--- /dev/null
+++ b/tests/arista_eos/show_version/arista_eos_show_version2.raw
@@ -0,0 +1,16 @@
+Arista CCS-720XP-24ZY4-F
+Hardware version: 11.00
+Serial number: JPE11400249
+Hardware MAC address: fcbd.67c7.ffe7
+System MAC address: fcbd.67c7.ffe7
+
+Software image version: 4.27.6M
+Architecture: i686
+Internal build version: 4.27.6M-28481162.4276M
+Internal build ID: f62c8154-2e05-4650-be1e-c30774deec7e
+Image format version: 2.0
+Image optimization: DEFAULT
+
+Uptime: 134 weeks, 5 days, 23 hours and 44 minutes
+Total memory: 3982820 kB
+Free memory: 1807180 kB
\ No newline at end of file
diff --git a/tests/arista_eos/show_version/arista_eos_show_version2.yml b/tests/arista_eos/show_version/arista_eos_show_version2.yml
new file mode 100644
index 0000000000..726b120970
--- /dev/null
+++ b/tests/arista_eos/show_version/arista_eos_show_version2.yml
@@ -0,0 +1,10 @@
+---
+parsed_sample:
+  - free_memory: "1807180"
+    hw_version: "11.00"
+    image: "4.27.6M"
+    model: "CCS-720XP-24ZY4-F"
+    serial_number: "JPE11400249"
+    sys_mac: "fcbd.67c7.ffe7"
+    total_memory: "3982820"
+    uptime: "134 weeks, 5 days, 23 hours and 44 minutes"
diff --git a/tests/arista_eos/show_version/arista_eos_show_version3.raw b/tests/arista_eos/show_version/arista_eos_show_version3.raw
new file mode 100644
index 0000000000..a90f2ad9cc
--- /dev/null
+++ b/tests/arista_eos/show_version/arista_eos_show_version3.raw
@@ -0,0 +1,16 @@
+Arista DCS-7010T-48-R
+Hardware version: 12.03
+Serial number: JPE18523609
+Hardware MAC address: 985d.82b8.faf5
+System MAC address: 985d.82b8.faf5
+
+Software image version: 4.28.9M
+Architecture: i686
+Internal build version: 4.28.9M-33818481.4289M
+Internal build ID: ecbeee98-6249-4e05-84e6-60b46a08f83e
+Image format version: 3.0
+Image optimization: Strata-4GB
+
+Uptime: 3 weeks, 0 days, 20 hours and 45 minutes
+Total memory: 3982456 kB
+Free memory: 2076700 kB
\ No newline at end of file
diff --git a/tests/arista_eos/show_version/arista_eos_show_version3.yml b/tests/arista_eos/show_version/arista_eos_show_version3.yml
new file mode 100644
index 0000000000..ae24d057b5
--- /dev/null
+++ b/tests/arista_eos/show_version/arista_eos_show_version3.yml
@@ -0,0 +1,10 @@
+---
+parsed_sample:
+  - free_memory: "2076700"
+    hw_version: "12.03"
+    image: "4.28.9M"
+    model: "DCS-7010T-48-R"
+    serial_number: "JPE18523609"
+    sys_mac: "985d.82b8.faf5"
+    total_memory: "3982456"
+    uptime: "3 weeks, 0 days, 20 hours and 45 minutes"