Skip to content

Tests and juniper #110

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

Merged
merged 36 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
71691c6
adding wireless tests
mailsanjayhere Aug 2, 2024
ced476c
renamed vendor names
mailsanjayhere Aug 2, 2024
a32f586
testing juniper file
mailsanjayhere Aug 2, 2024
b45c401
testing with rule_11.py
mailsanjayhere Aug 2, 2024
592c5de
updated the first rule
mailsanjayhere Aug 2, 2024
addcd0a
adding EXAMPLES.md
mailsanjayhere Aug 19, 2024
01883e8
updated the URL for EXAMPLES.md
mailsanjayhere Aug 19, 2024
e4473f7
Merge branch 'main' into tests_and_juniper
netpicker Aug 19, 2024
b4d1115
TOC for EXAMPLES.md
mailsanjayhere Aug 19, 2024
1bb817e
Tests and juniper (#96) (#97)
netpicker Aug 19, 2024
634ffa1
Merge branch 'tests_and_juniper' of https://github.com/netpicker/pyte…
mailsanjayhere Aug 19, 2024
cb25c11
updating TOC
mailsanjayhere Aug 19, 2024
8f545d5
Merge branch 'main' into tests_and_juniper
netpicker Aug 19, 2024
1575a16
updated for EXAMPLES.md
mailsanjayhere Aug 19, 2024
d8e6bfb
one more update
mailsanjayhere Aug 19, 2024
e0225d7
Merge branch 'main' into tests_and_juniper
netpicker Aug 19, 2024
d046490
removed example inside EXAMPLE.md
mailsanjayhere Aug 20, 2024
cc1fe9d
Squashed commit of the following:
netpicker Aug 20, 2024
eaa20b5
Merge branch 'main' into tests_and_juniper
netpicker Aug 20, 2024
33a850c
changed entire file contents
mailsanjayhere Aug 20, 2024
6a2e73a
Merge branch 'tests_and_juniper' of https://github.com/netpicker/pyte…
mailsanjayhere Aug 20, 2024
5830aeb
Merge branch 'main' into tests_and_juniper
netpicker Aug 20, 2024
e14a500
fixed typo for devices
mailsanjayhere Aug 20, 2024
a6aeaab
Merge branch 'tests_and_juniper' of https://github.com/netpicker/pyte…
mailsanjayhere Aug 20, 2024
a6b5929
Merge branch 'main' into tests_and_juniper
netpicker Aug 20, 2024
6aef930
update EXAMPLES.md README.md
mailsanjayhere Aug 20, 2024
5ff7b35
Merge branch 'tests_and_juniper' of https://github.com/netpicker/pyte…
mailsanjayhere Aug 20, 2024
949ccf0
removed few items from TOC
mailsanjayhere Aug 20, 2024
eb15933
replaced : with = in commands check
mailsanjayhere Aug 20, 2024
9bed9ed
added 2nd example for multiple lines check
mailsanjayhere Aug 21, 2024
973b666
Merge branch 'main' into tests_and_juniper
netpicker Aug 21, 2024
0b45225
updated example 2
mailsanjayhere Aug 21, 2024
691eac5
Merge branch 'main' into tests_and_juniper
netpicker Aug 21, 2024
25e3767
add 4th example
mailsanjayhere Aug 21, 2024
c4303c9
added textfsm example
mailsanjayhere Aug 21, 2024
233d350
Merge branch 'main' into tests_and_juniper
netpicker Aug 21, 2024
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
Prev Previous commit
Next Next commit
Merge branch 'main' into tests_and_juniper
  • Loading branch information
netpicker authored Aug 20, 2024
commit eaa20b54966f9411d07a4d809bdb0338c2c5b13c
29 changes: 0 additions & 29 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,3 @@ A set of common Netpicker compliance use-cases.
- Replace `'rule_name'` with your actual rule name.
- Specify the correct platform(s).
- Implement the logic inside the function, using assertions to determine if the device complies with the rule.

### 3. **Write the Netpicker Rule**
- **Basic Structure**: Use the Netpicker rule template:
```python
@low(
name='rule_name',
platform=['platform_name'],
commands={'command_name': 'command_to_execute'},
)
def rule_name(configuration, commands, device, devices):
assert 'keyword' in configuration
```
- **Customize the Rule**:
- Replace `'rule_name'` with your actual rule name.
- Specify the correct platform(s).
- Define the commands needed for the test.
- Implement the logic inside the function, using assertions to determine if the device complies with the rule.

**Example**:
```python
@medium(
name='rule_no_default_route',
platform=['cisco_ios'],
commands={'show_route': 'show ip route'},
)
def rule_no_default_route(configuration, commands, device, devices):
assert '0.0.0.0/0' not in commands.show_route
```
- **Testing Logic**: The example above checks if a default route (0.0.0.0/0) exists in the device's route table.
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.