Skip to content

Commit

Permalink
Add CI Test for standard capture group naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgill298 committed Apr 1, 2024
1 parent 7af9f67 commit c75bb1a
Show file tree
Hide file tree
Showing 6 changed files with 400 additions and 89 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v2"
- name: "Get changed files"
id: "changed-files"
uses: "tj-actions/changed-files@v43"
- name: "Build"
uses: "docker/build-push-action@v4"
with:
Expand All @@ -108,6 +111,7 @@ jobs:
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
PYTHON_VER=${{ env.PYTHON_VER }}
ALL_CHANGED_FILES=${{ steps.changed-files.outputs.all_changed_files }}
needs:
- "bandit"
- "pydocstyle"
Expand Down Expand Up @@ -181,8 +185,12 @@ jobs:
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
PYTHON_VER=${{ env.PYTHON_VER }}
ALL_CHANGED_FILES=${{ steps.changed-files.outputs.all_changed_files }}
- name: "Debug: Show docker images"
run: "docker image ls"
- name: "Get changed files"
id: "changed-files"
uses: "tj-actions/changed-files@v43"
- name: "Run Tests"
run: "poetry run invoke pytest"
needs:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG PYTHON_VER
ARG ALL_CHANGED_FILES=0

FROM python:${PYTHON_VER}-slim

Expand Down
18 changes: 18 additions & 0 deletions ntc_templates/templates/cisco_ios_show_inventory-test.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Value NAME (.*)
Value MAC_ADDRESS (.*)
Value SERIAL (.*)
Value IP_ADDR (.*)

Start
^NAME:\s+"${NAME}",\s+DESCR:\s+"${DESCR}"
^PID:\s+${PID}.*,.*VID:\s+${VID},.*SN:\s+${SN} -> Record
^PID:\s+,.*VID:\s+${VID},.*SN: -> Record
^PID:\s+${PID}.*,.*VID:\s+${VID},.*SN: -> Record
^PID:\s+,.*VID:\s+${VID},.*SN:\s+${SN} -> Record
^PID:\s+${PID}.*,.*VID:\s+${VID}.*
^PID:\s+,.*VID:\s+${VID}.*
^.*SN:\s+${SN} -> Record
^.*SN: -> Record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
Loading

0 comments on commit c75bb1a

Please sign in to comment.