2ddcd2c4041125d54b3069bc12f86281272ac246
[integration/test.git] / test / csit / suites / sp-of13 / 020__MD_SAL_NSF_OF13 / 040__restconf_frm.txt
1 *** Settings ***
2 Documentation     Test suite for RESTCONF FRM
3 Suite Setup       Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           ../../../libraries/RequestsLibrary.py
7 Library           ../../../libraries/Common.py
8 Variables         ../../../variables/Variables.py
9
10 *** Variables ***
11
12 ${REST_CON}        /restconf/config/opendaylight-inventory:nodes
13 ${REST_OPR}        /restconf/operational/opendaylight-inventory:nodes
14 ${BODY1}                   <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
15 ${BODY2}                   <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>1</output-node-connector><max-length>60</max-length></output-action></action></apply-actions></instruction></instructions></flow>
16
17 *** Test Cases *** 
18 Add a flow - Sending IPv4 Dest Address and Eth type
19     [Documentation]    Push a flow through REST-API
20     [Tags]   Push
21     ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY1}
22     Should Be Equal As Strings    ${resp.status_code}    200
23         
24 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
25     [Documentation]    Verify the flow
26     [Tags]   Get
27     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
28     Should Be Equal As Strings    ${resp.status_code}    200  
29     Should Contain     ${resp.content}    139    
30
31 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
32     [Documentation]    Verify the flow
33     [Tags]   Get
34     Sleep   30
35     ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
36     Should Be Equal As Strings    ${resp.status_code}    200
37     Should Contain     ${resp.content}    10.0.10.1
38
39 Remove a flow - - Sending IPv4 Dest Address and Eth type
40     [Documentation]    Remove a flow
41     [Tags]    remove
42     ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/2/flow/139    
43     Should Be Equal As Strings    ${resp.status_code}    200
44    
45 Verify after deleting flow config - Sending IPv4 Dest Address and Eth type
46     [Documentation]    Verify the flow
47     [Tags]   Get
48     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
49     Should Be Equal As Strings    ${resp.status_code}    200  
50     Should Not Contain     ${resp.content}    139
51
52 # Reason in using high time is, I used STOPWATCH to check the timer after deleting the flow config
53 Verify after deleting flow operational - Sending IPv4 Dest Address and Eth type
54     [Documentation]    Verify the flow
55     [Tags]   Get
56     Sleep   30
57     ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
58     Should Be Equal As Strings    ${resp.status_code}    200
59     Should Not Contain     ${resp.content}    10.0.10.1
60  
61 Add a flow - Output to physical port#
62     [Documentation]    Push a flow through REST-API
63     [Tags]   Push
64     ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/2/flow/152    data=${BODY2}
65     Should Be Equal As Strings    ${resp.status_code}    200
66
67 Verify after adding flow config - Output to physical port#
68     [Documentation]    Verify the flow
69     [Tags]   Get
70     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
71     Should Be Equal As Strings    ${resp.status_code}    200  
72     Should Contain     ${resp.content}    152
73  
74 Verify after adding flow operational - Output to physical port#
75     [Documentation]    Verify the flow
76     [Tags]   Get
77     Sleep    30         
78     ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
79     Should Be Equal As Strings    ${resp.status_code}    200
80     Should Contain     ${resp.content}    10.0.20.1
81
82 Remove a flow - Output to physical port#
83     [Documentation]    Remove a flow
84     [Tags]    remove
85     ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/2/flow/152    
86     Should Be Equal As Strings    ${resp.status_code}    200
87
88 Verify after deleting flow config - Output to physical port#
89     [Documentation]    Verify the flow
90     [Tags]   Get
91     ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
92     Should Be Equal As Strings    ${resp.status_code}    200 
93     Should Not Contain     ${resp.content}    152
94
95 Verify after deleting flow operational - Output to physical port#
96     [Documentation]    Verify the flow
97     [Tags]   Get
98     Sleep    40
99     ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
100     Should Be Equal As Strings    ${resp.status_code}    200
101     Should Not Contain     ${resp.content}    10.0.20.1
102