Topoprocessing - Rework the output requesting mechanism
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 060_Link_computation.robot
1 *** Settings ***
2 Documentation     Test suite to verify link computation operation on different models.
3 ...               Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIGURATION to OPERATIONAL.
4 ...               Need for this change is also a reason why main feature (odl-topoprocessing-framework) is installed after file change and not during boot.
5 ...               Tests themselves install feature required for specific model, clear karaf logs for futher synchronization, send configurational xmls and verify output.
6 ...               Topology-id on the end of each urls must match topology-id from xml. Yang models of components in topology are defined in xmls.
7 Suite Setup       Setup Environment
8 Suite Teardown    Clean Environment
9 Test Teardown     Delete Overlay Topology
10 Library           RequestsLibrary
11 Library           SSHLibrary
12 Library           XML
13 Variables         ../../../variables/topoprocessing/TopologyRequests.py
14 Variables         ../../../variables/topoprocessing/TargetFields.py
15 Variables         ../../../variables/Variables.py
16 Resource          ../../../libraries/KarafKeywords.robot
17 Resource          ../../../libraries/Utils.robot
18 Resource          ../../../libraries/TopoprocessingKeywords.robot
19
20 *** Test Cases ***
21 Link Computation Aggregation Inside
22     [Documentation]    Test of link computation with unification inside on Network Topology model
23     ${model}    Set Variable    network-topology-model
24     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    ${model}    node    network-topo:6
25     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
26     ${request}    Insert Link Computation Inside    ${request}    ${LINK_COMPUTATION_INSIDE}    n:network-topology-model    network-topo:6
27     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
28     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=4    supporting-node_count=5    node-ref_count=5    link_count=4    link-ref_count=4
29     ${overlay_node_id_28_29}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:28    bgp:29
30     ${overlay_node_id_26}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:26
31     ${overlay_node_id_30}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:30
32     ${overlay_node_id_27}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:27
33     ${topology_id}    Set Variable    network-topo:6
34     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:26:28    ${overlay_node_id_26}    ${overlay_node_id_28_29}
35     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:28:29    ${overlay_node_id_28_29}    ${overlay_node_id_28_29}
36     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:29:30-1    ${overlay_node_id_28_29}    ${overlay_node_id_30}
37     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:29:30-2    ${overlay_node_id_28_29}    ${overlay_node_id_30}
38
39 Link Computation Filtration
40     [Documentation]    Test of link computation with filtration on Network Topology model
41     ${model}    Set Variable    network-topology-model
42     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    ${model}    node    network-topo:6
43     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
44     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/32
45     ${request}    Insert Link Computation Inside    ${request}    ${LINK_COMPUTATION_INSIDE}    n:network-topology-model    network-topo:6
46     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
47     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=2    node-ref_count=2    link_count=1    link-ref_count=1
48     ${overlay_node_id_28}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:28
49     ${overlay_node_id_29}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:29
50     Check Overlay Link Source And Destination    ${model}    ${resp.content}    network-topo:6    link:28:29    ${overlay_node_id_28}    ${overlay_node_id_29}
51
52 Link Computation Aggregation Filtration
53     [Documentation]    Test of link computation with aggregation filtration on Network Topology model
54     ${model}    Set Variable    network-topology-model
55     ${target_field}    Set Variable    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
56     ${request}    Prepare Unification Filtration Topology Request    ${UNIFICATION_FILTRATION_NT}    ${model}    node    ${target_field}    network-topo:6
57     ...    ${target_field}    network-topo:1
58     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    1
59     ${request}    Insert Apply Filters    ${request}    1    1
60     ${request}    Insert Apply Filters    ${request}    2    1
61     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
62     ${request}    Insert Link Computation    ${request}    ${LINK_COMPUTATION}    n:network-topology-model    network-topo:6    network-topo:1
63     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
64     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=4    node-ref_count=4    link_count=2    link-ref_count=2
65     ${overlay_node_id_1_26}    Check Aggregated Node in Topology    ${model}    ${resp.content}    3    bgp:26    bgp:1
66     ${overlay_node_id_2_27}    Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:27    bgp:2
67     ${topology_id}    Set Variable    network-topo:1
68     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:1:2-1    ${overlay_node_id_1_26}    ${overlay_node_id_2_27}
69     Check Overlay Link Source And Destination    ${model}    ${resp.content}    ${topology_id}    link:1:2-2    ${overlay_node_id_1_26}    ${overlay_node_id_2_27}