Modify flowfilter and pathpolicy robot files for VTN Manager RESTCONF
[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
10 ${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"}]}} 
11
12
13 *** Test Cases ***
14 Check if switch1 detected
15     [Documentation]    Check if openflow:1 is detected
16     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
17
18 Check if switch2 detected
19     [Documentation]    Check if openflow:2 is detected
20     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
21
22 Check if switch3 detected
23     [Documentation]    Check if openflow:3 is detected
24     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
25
26 Check if switch4 detected
27     [Documentation]    Check if openflow:4 is detected
28     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:4
29
30 Add a vtn Tenant_path
31     [Documentation]    Add a vtn Tenant_path
32     Add a vtn    Tenant_path
33
34 Add a vBridge vBridge1
35     [Documentation]    Add a vBridge vBridge1 in vtn Tenant_path
36     Add a vBridge    Tenant_path    vBridge1
37
38 Add a interface If1_path
39     [Documentation]    Add a interface if1_path into vBrdige vBridge1
40     Add a interface    Tenant_path    vBridge1    if1_path
41
42 Add a portmap for interface if1_path
43     [Documentation]    Create a portmap on Interface if1 of vBridge1
44     Add a portmap    Tenant_path    vBridge1    if1_path    openflow:1    s1-eth1
45
46 Add a interface If2_path
47     [Documentation]    Add a interface if2_path into vBrdige vBridge1
48     Add a interface    Tenant_path    vBridge1    if2_path
49
50 Add a portmap for interface if2_path
51     [Documentation]    Create a portmap on Interface if2_path of vBridge1
52     Add a portmap    Tenant_path    vBridge1    if2_path    openflow:3    s3-eth3
53
54 Ping h1 to h2 before path policy
55     [Documentation]    Ping h1 to h2, verify no packet loss
56     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
57
58 Verify flowEntryBeforePathPolicy
59     [Documentation]    Checking Flows on switch s1 and s3
60     [Tags]    exclude
61     Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_before_pathpolicy}
62
63 Add a flowcondition flowcond_path
64     [Documentation]    Create a flowcondition flowcond_path
65     Add a flowcondition    flowcond_path
66
67 Add a pathmap
68     [Documentation]    Create a pathmap in the vtn
69     Add a pathmap    ${pathmapdata}
70
71 Add a pathpolicy
72     [Documentation]    Create a pathpolicy in the vtn
73     Add a pathpolicy    ${pathpolicydata}
74
75 Get a pathpolicy
76     [Documentation]    Retrieve a pathpolicy in the vtn
77     Get a pathpolicy    ${policy_id}
78
79 Ping h1 to h2 after path policy
80     [Documentation]    Ping h1 to h2, verify no packet loss
81     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
82
83 Verify flowEntryAfterPathPolicy
84     [Documentation]    Checking Flows on switch s1 and s3
85     [Tags]    exclude
86     Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_after_pathpolicy}
87
88 Delete a pathmap
89     [Documentation]    Delete a pathmap
90     Delete a pathmap    Tenant_path
91
92 Delete a pathpolicy
93    [Documentation]    Delete a pathpolicy
94    Delete a pathpolicy    ${policy_id}
95
96 Delete a flowcondition
97     [Documentation]    Delete a flowcondition
98     Remove flowcondition    flowcond_path
99
100 Delete a vtn Tenant_path
101     [Documentation]    Delete a vtn Tenant_path
102     Delete a vtn    Tenant_path