Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI Test for standard capture group naming #1681

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading