Skip to content

Commit 212221b

Browse files
netpickermailsanjayhere
authored and
imi
committed
Tests and juniper (#101)
* adding wireless tests * renamed vendor names * testing juniper file * testing with rule_11.py * updated the first rule * adding EXAMPLES.md * updated the URL for EXAMPLES.md * TOC for EXAMPLES.md * Tests and juniper (#96) (#97) * adding wireless tests * renamed vendor names * testing juniper file * testing with rule_11.py * updated the first rule * adding EXAMPLES.md * updated the URL for EXAMPLES.md --------- Co-authored-by: mailsanjayhere <mailsanjayhere@gmail.com> * updating TOC * updated for EXAMPLES.md * removed example inside EXAMPLE.md * Squashed commit of the following: commit 8d3fe28 Author: Netpicker <156186606+netpicker@users.noreply.github.com> Date: Mon Aug 19 09:26:59 2024 +0200 Tests and juniper (#100) * adding wireless tests * renamed vendor names * testing juniper file * testing with rule_11.py * updated the first rule * adding EXAMPLES.md * updated the URL for EXAMPLES.md * TOC for EXAMPLES.md * Tests and juniper (#96) (#97) * adding wireless tests * renamed vendor names * testing juniper file * testing with rule_11.py * updated the first rule * adding EXAMPLES.md * updated the URL for EXAMPLES.md --------- Co-authored-by: mailsanjayhere <mailsanjayhere@gmail.com> * updating TOC * updated for EXAMPLES.md --------- Co-authored-by: mailsanjayhere <mailsanjayhere@gmail.com> --------- Co-authored-by: mailsanjayhere <mailsanjayhere@gmail.com>
1 parent 91a4ce0 commit 212221b

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

EXAMPLES.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,11 @@ A set of common Netpicker compliance use-cases.
3636
@low(
3737
name='rule_name',
3838
platform=['platform_name'],
39-
commands={'command_name': 'command_to_execute'},
4039
)
41-
def rule_name(configuration, commands, device, devices):
40+
def rule_name(configuration):
4241
assert 'keyword' in configuration
4342
```
4443
- **Customize the Rule**:
4544
- Replace `'rule_name'` with your actual rule name.
4645
- Specify the correct platform(s).
47-
- Define the commands needed for the test.
4846
- Implement the logic inside the function, using assertions to determine if the device complies with the rule.
49-
50-
**Example**:
51-
```python
52-
@medium(
53-
name='rule_no_default_route',
54-
platform=['cisco_ios'],
55-
commands={'show_route': 'show ip route'},
56-
)
57-
def rule_no_default_route(configuration, commands, device, devices):
58-
assert '0.0.0.0/0' not in commands.show_route
59-
```
60-
- **Testing Logic**: The example above checks if a default route (0.0.0.0/0) exists in the device's route table.

0 commit comments

Comments
 (0)