-
Notifications
You must be signed in to change notification settings - Fork 1
/
04-genie-learn.robot
32 lines (27 loc) · 1.23 KB
/
04-genie-learn.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
*** Settings ***
Library pyats.robot.pyATSRobot
Library unicon.robot.UniconRobot
Library genie.libs.robot.GenieRobot
Library Collections
Suite Setup Run Keywords use testbed "testbed.yaml" AND connect to all devices
*** Variables ***
&{OSPF_MODELS} # will contain parsed OSPF models from all devices
@{DEVICES} r1 r2 r3 # r1,r2 are iosxe, r3 is iosxr device
*** Test Cases ***
Verify OSPF hello intervals
[Documentation] Check that no interface uses hello-interval <= 5 sec
[Tags] robot:continue-on-failure
FOR ${device} IN @{DEVICES}
${model}= learn OSPF on device ${device}
${result}= dq query data=${model}
... filters=value_operator('hello_interval', '<=', 5).get_values('[10]')
Should Be Empty ${result} msg=Interfaces ${result} on ${device} have too low hello-interval
END
*** Keywords ***
learn OSPF on device
[Arguments] ${device}
${result}= learn "ospf" on device "${device}"
# convert result to qdict.. a bit ugly
${qdict}= Evaluate genie.conf.base.utils.QDict($result.to_dict())
Log Dictionary ${qdict}
RETURN ${qdict}