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 95917f7
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 89 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,28 @@ jobs:
run: "poetry run invoke pylint"
needs:
- "build"
test_var_names:
strategy:
fail-fast: true
matrix:
python-version: ["3.10"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v5"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Get changed files"
id: "changed-files"
uses: "tj-actions/changed-files@v43"
- name: "Run Tests"
run: "poetry run pytest tests/test_var_names.py"
env:
ALL_CHANGED_FILES: "${{ steps.changed-files.outputs.all_changed_files }}"
pytest:
strategy:
fail-fast: true
Expand Down Expand Up @@ -183,8 +205,13 @@ jobs:
PYTHON_VER=${{ env.PYTHON_VER }}
- 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"
env:
ALL_CHANGED_FILES: "${{ steps.changed-files.outputs.all_changed_files }}"
needs:
- "pylint"
publish_gh:
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 95917f7

Please sign in to comment.