diff --git a/ntc_templates/templates/cisco_xr_show_run_hostname.textfsm b/ntc_templates/templates/cisco_xr_show_run_hostname.textfsm new file mode 100644 index 0000000000..1ee0df875b --- /dev/null +++ b/ntc_templates/templates/cisco_xr_show_run_hostname.textfsm @@ -0,0 +1,9 @@ +Value HOSTNAME (\S+) + +Start + # Capture date output by XR by 'show run hostname' first + ^\S+ \S+ \S+ .*$$ + # Capture hostname + ^hostname ${HOSTNAME}$$ + ^\s*$$ + ^. -> Error diff --git a/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.raw b/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.raw new file mode 100644 index 0000000000..9dc5a1ad1c --- /dev/null +++ b/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.raw @@ -0,0 +1,2 @@ +Thu Aug 29 16:30:30.674 CDT +hostname rtr-01 diff --git a/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.yml b/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.yml new file mode 100644 index 0000000000..0c59487392 --- /dev/null +++ b/tests/cisco_xr/show_run_hostname/cisco_xr_show_run_hostname.yml @@ -0,0 +1,3 @@ +--- +parsed_sample: + - hostname: "rtr-01"