Fix for VTN Manager CSIT test failures in VTN jenkins job
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF10_Li / 010__vtn_manager_pathpolicy.robot
1 *** Settings ***
2 Documentation     Test suite for VTN Manager using OF10
3 Suite Setup       Start PathSuiteVtnMaTestOF10
4 Suite Teardown    Stop PathSuiteVtnMaTest
5 Resource          ../../../libraries/VtnMaKeywordsLi.robot
6
7 *** Variables ***
8 ${pathmapdata}    {"index": 1,"condition":"flowcond_path","policy":1,"idleTimeout": 300,"hardTimeout": 0}
9 ${pathpolicydata}    {"id": 1,"default": 100000,"cost": [{"location": {"node": {"type": "OF","id": "00:00:00:00:00:00:00:01"},"port": {"type": "OF","id": "3","name": "s1-eth3"}},"cost": 1000},{"location": {"node": {"type": "OF","id": "00:00:00:00:00:00:00:04"},"port": {"type": "OF","id": "2","name": "s4-eth2"}},"cost": 1000},{"location": {"node": {"type": "OF", "id": "00:00:00:00:00:00:00:03"},"port": {"type": "OF","id": "3","name": "s3-eth3"}},"cost": 100000}]}
10
11 *** Test Cases ***
12 Check if switch1 detected
13     [Documentation]    Check if openflow:1 is detected
14     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
15
16 Check if switch2 detected
17     [Documentation]    Check if openflow:2 is detected
18     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
19
20 Check if switch3 detected
21     [Documentation]    Check if openflow:3 is detected
22     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
23
24 Check if switch4 detected
25     [Documentation]    Check if openflow:4 is detected
26     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:4
27
28 Add a vtn Tenant_path
29     [Documentation]    Add a vtn Tenant_path
30     Add a vtn    Tenant_path    {"idleTimeout": "200","hardTimeout": "600","description": "Virtual Tenant_path for Hackfest network"}
31
32 Add a vBridge vBridge1
33     [Documentation]    Add a vBridge vBridge1 in vtn Tenant_path
34     Add a vBridge    Tenant_path    vBridge1    {"ageInterval": "300","description": "vBridge1 for Tenant_path"}
35
36 Add a interface If1_path
37     [Documentation]    Add a interface if1_path into vBrdige vBridge1
38     Add a interface    Tenant_path    vBridge1    if1_path    {}
39
40 Add a portmap for interface if1_path
41     [Documentation]    Create a portmap on Interface if1 of vBridge1
42     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:01
43     ${port}    Create Dictionary    name=s1-eth1    type=OF    id=1
44     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
45     Add a portmap    Tenant_path    vBridge1    if1_path    ${portmap_data}
46
47 Add a interface If2_path
48     [Documentation]    Add a interface if2_path into vBrdige vBridge1
49     Add a interface    Tenant_path    vBridge1    if2_path    {}
50
51 Add a portmap for interface if2_path
52     [Documentation]    Create a portmap on Interface if2_path of vBridge1
53     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:03
54     ${port}    Create Dictionary    name=s3-eth3    type=OF    id=3
55     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
56     Add a portmap    Tenant_path    vBridge1    if2_path    ${portmap_data}
57
58 Ping h1 to h2 before path policy
59     [Documentation]    Verify Ping between hosts h1 and h2. To check mininet ping here added wait until time as '20s'. Since, sometimes it takes maximum '20sec' to send packet b/w hosts.
60     Wait Until Keyword Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
61
62 Verify flowEntryBeforePathPolicy
63     [Documentation]    Checking Flows on switch s1 and s3
64     [Tags]    exclude
65     Wait Until Keyword Succeeds    20s    1s    Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_before_pathpolicy}
66
67 Add a flowcondition flowcond_path
68     [Documentation]    Create a flowcondition flowcond_path
69     ${inet4}=    Create Dictionary    src=10.0.0.1    dst=10.0.0.2    protocol=1
70     ${inetMatch}=    Create Dictionary    inet4=${inet4}
71     ${ethernet}=    Create Dictionary    src=ca:9e:58:0c:1e:f0    dst=ba:bd:0f:e3:a8:c8    type=2048
72     ${matchElement}=    Create Dictionary    index=1    ethernet=${ethernet}    inetMatch=${inetMatch}
73     @{matchlist}    Create List    ${matchElement}
74     ${flowcond_data}=    Create Dictionary    name=flowcond_path    match=${matchlist}
75     Add a flowcondition    flowcond_path    ${flowcond_data}
76
77 Add a pathmap
78     [Documentation]    Create a pathmap in the vtn
79     Add a pathmap    ${pathmapdata}
80
81 Get a pathmap
82     [Documentation]    Retrieve a pathmap in the vtn
83     Get a pathmap
84
85 Add a pathpolicy
86     [Documentation]    Create a pathpolicy in the vtn
87     Add a pathpolicy    ${pathpolicydata}
88
89 Get a pathpolicy
90     [Documentation]    Retrieve a pathpolicy in the vtn
91     Get a pathpolicy
92
93 Ping h1 to h2 after path policy
94     [Documentation]    Verify Ping between hosts h1 and h2. To check mininet ping here added wait until time as '20s'. Since, sometimes it takes maximum '20sec' to send packet b/w hosts.
95     Wait Until Keyword Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
96
97 Verify flowEntryAfterPathPolicy
98     [Documentation]    Checking Flows on switch s1 and s3
99     [Tags]    exclude
100     Wait Until Keyword Succeeds    20s    1s    Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_after_pathpolicy}
101
102 Delete a pathmap
103     [Documentation]    Delete a pathmap
104     Delete a pathmap
105
106 Get a pathmap after delete
107     [Documentation]    Retrieve a pathmap in the vtn after delete to check whether it is deleted properly
108     Get a pathmap after delete
109
110 Delete a pathpolicy
111     [Documentation]    Delete a pathpolicy
112     Delete a pathpolicy
113
114 Get a pathpolicy after delete
115     [Documentation]    Retrieve a pathpolicy in the vtn after delete to check whether it is deleted properly
116     Get a pathpolicy after delete
117
118 Delete a flowcondition
119     [Documentation]    Delete a flowcondition
120     Delete a flowcondition    flowcond_path
121
122 Delete a vtn Tenant_path
123     [Documentation]    Delete a vtn Tenant_path
124     Delete a vtn    Tenant_path