Tidied updated tests.
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF13 / 020__vtn_pathmap_pathpolicy.robot
1 *** Settings ***
2 Documentation     Test suite for VTN Manager PathPolicy using OF13
3 Suite Setup       Start PathSuiteVtnMaTest
4 Suite Teardown    Stop PathSuiteVtnMaTest
5 Resource          ../../../libraries/VtnMaKeywords.robot
6
7 *** Variables ***
8 ${flowconditiondata}    "vtn-flow-match":[{"vtn-ether-match":{"destination-address":"ba:bd:0f:e3:a8:c8","ether-type":"2048","source-address":"ca:9e:58:0c:1e:f0","vlan-id": "1"},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]
9 ${pathmapdata}    {"input":{"tenant-name":"Tenant_path","path-map-list":[{"condition":"flowcond_path","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}
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 *** Test Cases ***
13 Check if switch1 detected
14     [Documentation]    Check if openflow:1 is detected
15     BuiltIn.Wait_Until_Keyword_Succeeds    12    3    Fetch vtn switch inventory    openflow:1
16
17 Check if switch2 detected
18     [Documentation]    Check if openflow:2 is detected
19     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:2
20
21 Check if switch3 detected
22     [Documentation]    Check if openflow:3 is detected
23     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:3
24
25 Check if switch4 detected
26     [Documentation]    Check if openflow:4 is detected
27     BuiltIn.Wait_Until_Keyword_Succeeds    3    1    Fetch vtn switch inventory    openflow:4
28
29 Add a vtn Tenant_path
30     [Documentation]    Add a vtn Tenant_path
31     Add a vtn    Tenant_path
32
33 Add a vBridge vBridge1
34     [Documentation]    Add a vBridge vBridge1 in vtn Tenant_path
35     Add a vBridge    Tenant_path    vBridge1
36
37 Add a interface If1_path
38     [Documentation]    Add a interface if1_path into vBrdige vBridge1
39     Add a interface    Tenant_path    vBridge1    if1_path
40
41 Add a portmap for interface if1_path
42     [Documentation]    Create a portmap on Interface if1 of vBridge1
43     Add a portmap    Tenant_path    vBridge1    if1_path    openflow:1    s1-eth1
44
45 Add a interface If2_path
46     [Documentation]    Add a interface if2_path into vBrdige vBridge1
47     Add a interface    Tenant_path    vBridge1    if2_path
48
49 Add a portmap for interface if2_path
50     [Documentation]    Create a portmap on Interface if2_path of vBridge1
51     Add a portmap    Tenant_path    vBridge1    if2_path    openflow:3    s3-eth3
52
53 Ping h1 to h2 before path policy
54     [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.
55     Wait_Until_Keyword_Succeeds    20s    1s    Mininet Ping Should Succeed    h1    h2
56
57 Verify flowEntryBeforePathPolicy
58     [Documentation]    Checking Flows on switch s1 and s3
59     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowEntryPathPolicy    OF13    ${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    ${flowconditiondata}
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]    Verify Ping between hosts h1 and h2.
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     Wait_Until_Keyword_Succeeds    20s    1s    Verify flowEntryPathPolicy    OF13    ${in_port}    ${out_after_pathpolicy}
84
85 Delete a pathmap
86     [Documentation]    Delete a pathmap
87     Delete a pathmap    Tenant_path
88
89 Delete a pathpolicy
90     [Documentation]    Delete a pathpolicy
91     Delete a pathpolicy    ${policy_id}
92
93 Delete a flowcondition
94     [Documentation]    Delete a flowcondition
95     Remove flowcondition    flowcond_path
96
97 Delete a vtn Tenant_path
98     [Documentation]    Delete vtn Tenant_path
99     Delete a vtn    Tenant_path