New OpenFlow REST perf test
[integration/test.git] / csit / suites / openflowplugin / Clustering_Bulkomatic / 030__Cluster_Reconcilliation_Multi_DPN.robot
1 *** Settings ***
2 Documentation     Test suite for Cluster with Bulk Flows - Reconcilliation in a multi DPN environment
3 Suite Setup       ClusterManagement Setup
4 Suite Teardown    Delete All Sessions
5 Resource          ../../../libraries/BulkomaticKeywords.robot
6 Resource          ../../../libraries/MininetKeywords.robot
7 Resource          ../../../libraries/ClusterManagement.robot
8 Resource          ../../../libraries/ClusterOpenFlow.robot
9 Resource          ../../../libraries/Utils.robot
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${operation_timeout}    100s
14 ${flow_count_per_switch}    1000
15 ${switch_count}    3
16 ${flow_count_after_add}    3000
17 ${flow_count_after_del}    0
18 ${orig_json_config_add}    sal_add_bulk_flow_config.json
19 ${orig_json_config_get}    sal_get_bulk_flow_config.json
20 ${orig_json_config_del}    sal_del_bulk_flow_config.json
21
22 *** Test Cases ***
23 Check Shards Status And Initialize Variables
24     [Documentation]    Check Status for all shards in OpenFlow application.
25     ClusterOpenFlow.Check OpenFlow Shards Status
26     ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
27     ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
28     ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
29     Set Suite Variable    ${temp_json_config_add}
30     Set Suite Variable    ${temp_json_config_get}
31     Set Suite Variable    ${temp_json_config_del}
32
33 Get Inventory Follower Before Cluster Restart
34     [Documentation]    Find a follower in the inventory config shard
35     ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
36     ${Follower_Node_1}=    Get From List    ${Inventory_Followers}    0
37     ${Follower_Node_2}=    Get From List    ${Inventory_Followers}    1
38     Set Suite Variable    ${Follower_Node_1}
39     Set Suite Variable    ${Follower_Node_2}
40     Set Suite Variable    ${Inventory_Leader}
41
42 Start Mininet Connect To Follower Node1
43     [Documentation]    Start mininet with connection to Follower Node1.
44     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_${Follower_Node_1}_IP}    --topo linear,${switch_count} --switch ovsk,protocols=OpenFlow13
45     Set Suite Variable    ${mininet_conn_id}
46
47 Add Bulk Flow From Follower
48     [Documentation]    3000 Flows (1K per DPN) in 3 DPN added via Follower Node1 and verify it gets applied in all instances.
49     BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_1}    ${operation_timeout}
50
51 Get Bulk Flows and Verify In Cluster
52     [Documentation]    Initiate get operation and check flow count across cluster nodes
53     BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
54
55 Verify Flows In Switch Before Cluster Restart
56     [Documentation]    Verify flows are installed in switch before cluster restart.
57     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${flow_count_after_add}    ${operation_timeout}
58
59 Stop Mininet Connected To Follower Node1 and Exit
60     [Documentation]    Stop mininet and exit connection.
61     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
62     Utils.Clean Mininet System
63
64 Start Mininet Reconnect To Follower Node1
65     [Documentation]    Start mininet with reconnection to follower node1.
66     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_${Follower_Node_1}_IP}    --topo linear,${switch_count} --switch ovsk,protocols=OpenFlow13
67     Set Suite Variable    ${mininet_conn_id}
68
69 Verify Flows In Switch Reconnected To Follower Node1
70     [Documentation]    Verify 1K flows per DPN installed in switch after it is reconnected to follower node1.
71     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${flow_count_after_add}    ${operation_timeout}
72
73 Stop Mininet Connected To Follower Node1
74     [Documentation]    Stop mininet and exit connection.
75     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
76     Utils.Clean Mininet System
77
78 Start Mininet Connect To Follower Node2
79     [Documentation]    Start mininet with connection to follower node2.
80     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_${Follower_Node_2}_IP}    --topo linear,${switch_count} --switch ovsk,protocols=OpenFlow13
81     Set Suite Variable    ${mininet_conn_id}
82
83 Verify Flows In Switch Connected To Follower Node2
84     [Documentation]    Verify 1K flows per DPN installed in switch after it is connected to follower node2.
85     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${flow_count_after_add}    ${operation_timeout}
86
87 Stop Mininet Connected To Follower Node2
88     [Documentation]    Stop mininet and exit connection.
89     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
90     Utils.Clean Mininet System
91
92 Start Mininet Connect To Inventory Leader
93     [Documentation]    Start mininet with connection to inventroy leader.
94     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_${Inventory_Leader}_IP}    --topo linear,${switch_count} --switch ovsk,protocols=OpenFlow13
95     Set Suite Variable    ${mininet_conn_id}
96
97 Verify Flows In Switch Connected To Leader
98     [Documentation]    Verify 1K flows per DPN installed in switch after it is connected to inventory leader.
99     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${flow_count_after_add}    ${operation_timeout}
100
101 Stop Mininet Connected To Inventory Leader
102     [Documentation]    Stop mininet and exit connection.
103     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
104     Utils.Clean Mininet System
105
106 Delete All Flows From Follower Node1
107     [Documentation]    3000 Flows deleted via Follower Node1 and verify it gets applied in all instances.
108     BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_1}    ${operation_timeout}
109
110 Verify No Flows In Cluster
111     [Documentation]    Verify flow count is 0 across cluster nodes.
112     BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}