testplan for Lithium ofp redesign job
[integration.git] / test / csit / suites / lispflowmapping / basic / 020_Northbound.robot
1 *** Settings ***
2 Documentation     Test suite to verify AD-SAL based Northbound is OK
3 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           RequestsLibrary
7 Library           ../../../libraries/Common.py
8 Variables         ../../../variables/Variables.py
9 Variables         ../../../variables/lispflowmapping/Variables.py
10 Resource          ../../../libraries/Utils.txt
11
12 *** Variables ***
13 ${NB_KEY}         /lispflowmapping/nb/v2/default/key
14 ${NB_MAPPING}     /lispflowmapping/nb/v2/default/mapping
15 ${EID_V4}         192.0.2.1
16
17 *** Test Cases ***
18 Add Key
19     [Documentation]    Add key for mapping registration
20     ${resp}    RequestsLibrary.Put    session    ${NB_KEY}    ${add_key}
21     Log    ${resp.content}
22     Should Be Equal As Strings    ${resp.status_code}    200
23
24 Add Mapping
25     [Documentation]    Add mapping to database
26     ${resp}    RequestsLibrary.Put    session    ${NB_MAPPING}    ${add_mapping}
27     Log    ${resp.content}
28     Should Be Equal As Strings    ${resp.status_code}    200
29
30 Get Mapping
31     [Documentation]    Get a mapping from the database
32     ${resp}    RequestsLibrary.Get    session    ${NB_MAPPING}/0/1/${EID_V4}/32
33     Log    ${resp.content}
34     Should Be Equal As Strings    ${resp.status_code}    200
35     Dictionaries Should Be Equal    ${resp.json()}    ${get_mapping}