Support only Fluorine+ distributions
[integration/test.git] / csit / libraries / DataModels.robot
1 *** Settings ***
2 Documentation       Library to deal with mdsal data models. Initially, as a common place to show and
3 ...                 debug a list of data models.
4
5 Library             RequestsLibrary
6 Resource            ../variables/netvirt/Variables.robot
7
8
9 *** Variables ***
10 @{internal_data_models}     ${EMPTY}
11
12
13 *** Keywords ***
14 Get Model Dump
15     [Documentation]    Will output a list of mdsal models using ${data_models} list
16     [Arguments]    ${controller_ip}    ${data_models}=@{internal_data_models}    ${restconf_root}=restconf
17     # while feature request in bug 7892 is not done, we will quickly timeout and not retry the model dump get
18     # request. This is because when it's done in a failed cluster state, it could take 20s for the reesponse to
19     # to come back as the internal clustering times out waiting for a leader which will not come. When bug 7892
20     # is resolved, we can remove the timeout=1 and max_retries=0, but likely have to modify the request itself to
21     # pass a timeout to restconf
22     Create Session
23     ...    model_dump_session
24     ...    http://${controller_ip}:${RESTCONFPORT}
25     ...    auth=${AUTH}
26     ...    headers=${HEADERS}
27     ...    timeout=1
28     ...    max_retries=0
29     FOR    ${model}    IN    @{data_models}
30         ${resp}=    RequestsLibrary.Get Request    model_dump_session    ${restconf_root}/${model}
31         ${pretty_output}=    To Json    ${resp.text}    pretty_print=True
32         Log    ${pretty_output}
33     END
34
35 Verify No Ingress Dispatcher Non-Default Flow Entries
36     [Documentation]    Verify the ingress dispatcher table has no non-default flows after neutron was cleaned up
37     [Arguments]    ${ovs_ip}
38     ${flow_output}=    Run Command On Remote System
39     ...    ${ovs_ip}
40     ...    sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE} table=${DISPATCHER_TABLE} | grep -v "priority=0"
41     Log    ${flow_output}
42     #Should Not Contain    ${flow_output}    table=${DISPATCHER_TABLE} # Skipping test verification until bug 7451 is resolved
43
44 Verify Flows Are Cleaned Up On All OpenStack Nodes
45     [Documentation]    Verify flows are cleaned up from all OpenStack nodes
46     FOR    ${ip}    IN    @{OS_ALL_IPS}
47         Run Keyword And Continue On Failure    Verify No Ingress Dispatcher Non-Default Flow Entries    ${ip}
48     END