Skip to content

Tests and juniper #101

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 19 commits into from
Aug 20, 2024
Merged
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
16 changes: 1 addition & 15 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,11 @@ A set of common Netpicker compliance use-cases.
@low(
name='rule_name',
platform=['platform_name'],
commands={'command_name': 'command_to_execute'},
)
def rule_name(configuration, commands, device, devices):
def rule_name(configuration):
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