Tidied new and updated test suites
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF10 / 020__vtn_pathmap_pathpolicy.robot
1 *** Settings ***
2 Documentation     Test suite for VTN Manager PathPolicy using OF10
3 Suite Setup       Start PathSuiteVtnMaTestOF10
4 Suite Teardown    Stop PathSuiteVtnMaTest
5 Resource          ../../../libraries/VtnMaKeywords.robot
6
7 *** Variables ***
8 ${pathmapdata}    {"input":{"tenant-name":"Tenant_path","path-map-list":[{"condition":"flowcond_path","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}
9 ${pathpolicydata}    {"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"1000"},{"port-desc":"openflow:3,3,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
31
32 Add a vBridge vBridge1
33     [Documentation]    Add a vBridge vBridge1 in vtn Tenant_path
34     Add a vBridge    Tenant_path    vBridge1
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     Add a portmap    Tenant_path    vBridge1    if1_path    openflow:1    s1-eth1
43
44 Add a interface If2_path
45     [Documentation]    Add a interface if2_path into vBrdige vBridge1
46     Add a interface    Tenant_path    vBridge1    if2_path
47
48 Add a portmap for interface if2_path
49     [Documentation]    Create a portmap on Interface if2_path of vBridge1
50     Add a portmap    Tenant_path    vBridge1    if2_path    openflow:3    s3-eth3
51
52 Ping h1 to h2 before path policy
53     [Documentation]    Ping h1 to h2, verify no packet loss
54     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
55
56 Verify flowEntryBeforePathPolicy
57     [Documentation]    Checking Flows on switch s1 and s3
58     [Tags]    exclude
59     Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_before_pathpolicy}
60
61 Add a flowcondition flowcond_path
62     [Documentation]    Create a flowcondition flowcond_path
63     Add a flowcondition    flowcond_path
64
65 Add a pathmap
66     [Documentation]    Create a pathmap in the vtn
67     Add a pathmap    ${pathmapdata}
68
69 Add a pathpolicy
70     [Documentation]    Create a pathpolicy in the vtn
71     Add a pathpolicy    ${pathpolicydata}
72
73 Get a pathpolicy
74     [Documentation]    Retrieve a pathpolicy in the vtn
75     Get a pathpolicy    ${policy_id}
76
77 Ping h1 to h2 after path policy
78     [Documentation]    Ping h1 to h2, verify no packet loss
79     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
80
81 Verify flowEntryAfterPathPolicy
82     [Documentation]    Checking Flows on switch s1 and s3
83     [Tags]    exclude
84     Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_after_pathpolicy}
85
86 Delete a pathmap
87     [Documentation]    Delete a pathmap
88     Delete a pathmap    Tenant_path
89
90 Delete a pathpolicy
91     [Documentation]    Delete a pathpolicy
92     Delete a pathpolicy    ${policy_id}
93
94 Delete a flowcondition
95     [Documentation]    Delete a flowcondition
96     Remove flowcondition    flowcond_path
97
98 Delete a vtn Tenant_path
99     [Documentation]    Delete a vtn Tenant_path
100     Delete a vtn    Tenant_path