Put testtool startup into its own testcase
[integration/test.git] / csit / suites / vtn / VTN_Mgr_OF10 / 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 Force Tags        exclude
6 Resource          ../../../libraries/VtnMaKeywords.robot
7
8 *** Variables ***
9 ${pathmapdata}    {"index": 1,"condition":"flowcond_path","policy":1,"idleTimeout": 300,"hardTimeout": 0}
10 ${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}]}
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    {"idleTimeout": "200","hardTimeout": "600","description": "Virtual Tenant_path for Hackfest network"}
32
33 Add a vBridge vBridge1
34     [Documentation]    Add a vBridge vBridge1 in vtn Tenant_path
35     Add a vBridge    Tenant_path    vBridge1    {"ageInterval": "300","description": "vBridge1 for Tenant_path"}
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     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:01
44     ${port}    Create Dictionary    name=s1-eth1    type=OF    id=1
45     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
46     Add a portmap    Tenant_path    vBridge1    if1_path    ${portmap_data}
47
48 Add a interface If2_path
49     [Documentation]    Add a interface if2_path into vBrdige vBridge1
50     Add a interface    Tenant_path    vBridge1    if2_path    {}
51
52 Add a portmap for interface if2_path
53     [Documentation]    Create a portmap on Interface if2_path of vBridge1
54     ${node}    Create Dictionary    type=OF    id=00:00:00:00:00:00:00:03
55     ${port}    Create Dictionary    name=s3-eth3    type=OF    id=3
56     ${portmap_data}    Create Dictionary    node=${node}    port=${port}
57     Add a portmap    Tenant_path    vBridge1    if2_path    ${portmap_data}
58
59 Ping h1 to h2 before path policy
60     [Documentation]    Ping h1 to h2, verify no packet loss
61     Mininet Ping Should Succeed    h1    h2
62
63 Verify flowEntryBeforePathPolicy
64     [Documentation]    Checking Flows on switch s1 and s3
65     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]    Ping h1 to h2, verify no packet loss
95     Mininet Ping Should Succeed    h1    h2
96
97 Verify flowEntryAfterPathPolicy
98     [Documentation]    Checking Flows on switch s1 and s3
99     Verify flowEntryPathPolicy    OF10    ${in_port}    ${out_after_pathpolicy}
100
101 Delete a pathmap
102     [Documentation]    Delete a pathmap
103     Delete a pathmap
104
105 Get a pathmap after delete
106     [Documentation]    Retrieve a pathmap in the vtn after delete to check whether it is deleted properly
107     Get a pathmap after delete
108
109 Delete a pathpolicy
110     [Documentation]    Delete a pathpolicy
111     Delete a pathpolicy
112
113 Get a pathpolicy after delete
114     [Documentation]    Retrieve a pathpolicy in the vtn after delete to check whether it is deleted properly
115     Get a pathpolicy after delete
116
117 Delete a flowcondition
118     [Documentation]    Delete a flowcondition
119     Delete a flowcondition    flowcond_path
120
121 Delete a vtn Tenant_path
122     [Documentation]    Delete a vtn Tenant_path
123     Delete a vtn    Tenant_path