File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -36,25 +36,11 @@ A set of common Netpicker compliance use-cases.
36
36
@low (
37
37
name = ' rule_name' ,
38
38
platform = [' platform_name' ],
39
- commands = {' command_name' : ' command_to_execute' },
40
39
)
41
- def rule_name (configuration , commands , device , devices ):
40
+ def rule_name (configuration ):
42
41
assert ' keyword' in configuration
43
42
```
44
43
- ** Customize the Rule** :
45
44
- Replace `' rule_name' ` with your actual rule name.
46
45
- Specify the correct platform(s).
47
- - Define the commands needed for the test.
48
46
- 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.
You can’t perform that action at this time.
0 commit comments