Skip to content

Commit 728b8ce

Browse files
committed
Add test_project files
1 parent 276dc31 commit 728b8ce

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

.github/workflows/run-mock_project.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ jobs:
2525
run: uv sync --all-extras --dev
2626

2727
- name: Run tests
28-
run: ssh-keyscan -p 2222 localhost
28+
run: uv run pytest
29+
working-directory: test_project
2930

test_project/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Test Project
2+
3+
This project demonstrates the use of the custom netmiko cli test
4+
5+
## Setup
6+
7+
A Linux container needs to be running and expose SSH over port 2222
8+
9+
The GitHub Action workflow stats the container:
10+
11+
```yaml
12+
services:
13+
box01:
14+
image: ghcr.io/network-unit-testing-system/nuts-testclient:latest
15+
ports:
16+
- 2222:22
17+
```
18+
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
box01:
3+
hostname: sw01
4+
platform: linux
5+
username: admin
6+
password: admin

test_project/nr-config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
inventory:
2+
plugin: SimpleInventory
3+
options:
4+
host_file: "inventory_data/hosts.yaml"

test_project/tests/test_ip_addr.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- test_class: TestNetmikoCLI
2+
test_module: example_custom_netmiko_cli_test.netmiko_cli
3+
test_execution:
4+
command_string: ip addr show
5+
use_timing: False
6+
test_data:
7+
- host: box01
8+
contains: "127.0.0.1/8"
9+
not_contains: "DOWN"

0 commit comments

Comments
 (0)