Remove usage of removed RPC add-entry
[integration/test.git] / csit / suites / sxp / topology / 020_Scalability.robot
1 *** Settings ***
2 Documentation     Test suite to test scalability of SXP
3 Suite Setup       Setup SXP Environment    32
4 Suite Teardown    Clean SXP Environment    32
5 Test Setup        Clean Nodes
6 Library           RequestsLibrary
7 Library           SSHLibrary
8 Library           ../../../libraries/Sxp.py
9 Resource          ../../../libraries/SxpLib.robot
10
11 *** Variables ***
12
13 *** Test Cases ***
14 Test Mega Topology
15     [Documentation]    Stress test that contains of connecting 20 Nodes and exporting their bindings
16     [Tags]    SXP    Scalability
17     Setup Mega Topology
18     Wait Until Keyword Succeeds    10    1    Check Binding Range    2    22
19
20 Test Complex Mega Topology
21     [Documentation]    Stress test that contains of connecting 30 Nodes and exporting their bindings
22     [Tags]    SXP    Scalability
23     Setup Complex Mega Topology
24     Wait Until Keyword Succeeds    10    1    Check Binding Range    22    32
25
26 Text Bindings export
27     [Documentation]    Stress test that consist of exporting 500 Bindings under 5s
28     [Tags]    SXP    Scalability
29     : FOR    ${num}    IN RANGE    2    502
30     \    ${ip}    Get Ip From Number    ${num}
31     \    Add Bindings    ${num}    ${ip}/32    127.0.0.2
32     Add Connection    version4    listener    127.0.0.2    64999    127.0.0.1
33     Add Connection    version4    speaker    127.0.0.1    64999    127.0.0.2
34     Wait Until Keyword Succeeds    15    1    Verify Connection    version4    listener    127.0.0.2
35     Wait Until Keyword Succeeds    10    1    Check Binding Range    2    102
36
37 *** Keywords ***
38 Setup Mega Topology
39     [Arguments]    ${version}=version4
40     : FOR    ${num}    IN RANGE    2    22
41     \    ${ip}    Get Ip From Number    ${num}
42     \    Add Bindings    ${num}    ${ip}/32    ${ip}
43     \    Add Connection    ${version}    listener    ${ip}    64999    127.0.0.1
44     \    Add Connection    ${version}    speaker    127.0.0.1    64999    ${ip}
45     \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
46     \    ...    ${ip}
47
48 Setup Complex Mega Topology
49     [Arguments]    ${version}=version4
50     Setup Mega Topology    ${version}
51     ${second_num}    Convert To Integer    2
52     : FOR    ${num}    IN RANGE    22    32
53     \    ${ip}    Get Ip From Number    ${num}
54     \    ${second_ip}    Get Ip From Number    ${second_num}
55     \    Add Bindings    ${num}    ${ip}/32    ${ip}
56     \    Add Connection    ${version}    listener    ${ip}    64999    ${second_ip}
57     \    Add Connection    ${version}    speaker    ${second_ip}    64999    ${ip}
58     \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
59     \    ...    ${ip}    64999    ${second_ip}
60     \    ${second_num}    Set Variable    ${second_num + 1}
61     \    ${second_ip}    Get Ip From Number    ${second_num}
62     \    Add Connection    ${version}    listener    ${ip}    64999    ${second_ip}
63     \    Add Connection    ${version}    speaker    ${second_ip}    64999    ${ip}
64     \    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener
65     \    ...    ${ip}    64999    ${second_ip}
66
67 Check Binding Range
68     [Arguments]    ${start}    ${end}    ${node}=127.0.0.1
69     [Documentation]    Check if binding range is contained by node
70     ${resp}    Get Bindings    ${node}
71     : FOR    ${num}    IN RANGE    ${start}    ${end}
72     \    ${ip}    Get Ip From Number    ${num}
73     \    Should Contain Binding    ${resp}    ${num}    ${ip}/32    sxp
74
75 Clean Nodes
76     : FOR    ${num}    IN RANGE    1    32
77     \    ${ip}    Get Ip From Number    ${num}
78     \    Clean Bindings    ${ip}
79     \    Clean Connections    ${ip}