Skip to content

Commit

Permalink
Bugfix: change date format in hp_comware_display_clock.textfsm (#977)
Browse files Browse the repository at this point in the history
As per
https://techhub.hpe.com/eginfolib/networking/docs/switches/5940/5200-1008b_fund_cr/content/491962772.htm
output of the `display clock` commands output contains date in `MM/DD/YYYY`
format. Can confirm this on different types of HPE switches I have at my disposal.

Added test cases that cover the scenarios when time zone and daylight time
saving configurations are set.
  • Loading branch information
antonalekseev authored Sep 15, 2021
1 parent 141e2e0 commit acbd8e8
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ntc_templates/templates/hp_comware_display_clock.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Value DAY (\d+)
Value YEAR (\d+)

Start
^${TIME}\s+${TIMEZONE}\s+${DAYWEEK}\s+${DAY}/${MONTH}/${YEAR} -> Record
^${TIME}\s+${TIMEZONE}\s+${DAYWEEK}\s+${MONTH}/${DAY}/${YEAR} -> Record


8 changes: 4 additions & 4 deletions tests/hp_comware/display_clock/hp_comware_display_clock.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
parsed_sample:
- day: "01"
dayweek: "Sat"
month: "08"
time: "19:35:31"
- time: "19:35:31"
timezone: "UTC"
dayweek: "Sat"
month: "01"
day: "08"
year: "2011"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10:09:00 UTC Fri 03/16/2015
8 changes: 8 additions & 0 deletions tests/hp_comware/display_clock/hp_comware_display_clock_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
parsed_sample:
- time: "10:09:00"
timezone: "UTC"
dayweek: "Fri"
month: "03"
day: "16"
year: "2015"
2 changes: 2 additions & 0 deletions tests/hp_comware/display_clock/hp_comware_display_clock_2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
15:10:00 Z5 Fri 03/16/2015
Time Zone : Z5 add 05:00:00
8 changes: 8 additions & 0 deletions tests/hp_comware/display_clock/hp_comware_display_clock_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
parsed_sample:
- time: "15:10:00"
timezone: "Z5"
dayweek: "Fri"
month: "03"
day: "16"
year: "2015"
3 changes: 3 additions & 0 deletions tests/hp_comware/display_clock/hp_comware_display_clock_3.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
15:11:00 Z5 Fri 03/16/2015
Time Zone : Z5 add 05:00:00
Summer Time : PDT 06:00:00 08/01 06:00:00 09/01 01:00:00
8 changes: 8 additions & 0 deletions tests/hp_comware/display_clock/hp_comware_display_clock_3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
parsed_sample:
- time: "15:11:00"
timezone: "Z5"
dayweek: "Fri"
month: "03"
day: "16"
year: "2015"

0 comments on commit acbd8e8

Please sign in to comment.