Migrate request invocations (controller)
[integration/test.git] / csit / libraries / UnimgrKeywords.robot
1 *** Settings ***
2 Documentation       Unimgr keywords defination that will be used in Unimgr suite.
3
4 Library             OperatingSystem
5 Library             SSHLibrary
6 Library             String
7 Resource            ./OVSDB.robot
8 Resource            ./Utils.robot
9 Variables           ../variables/Variables.py
10
11
12 *** Variables ***
13 ${Bridge_Name}              ovsbr0
14 ${UniMgr_Variables_DIR}     ../variables/unimgr
15
16
17 *** Keywords ***
18 Setup Unimgr Test Environment
19     [Documentation]    Establish the Opendayligh session and prepair the Mininet VMs
20     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
21     Prepair Unimgr Test Environment    ${TOOLS_SYSTEM_IP}
22     Prepair Unimgr Test Environment    ${TOOLS_SYSTEM_2_IP}
23
24 Prepair Unimgr Test Environment
25     [Documentation]    delete the ovs bridge and manager then set the manager to a passive mode ptcp:6640.
26     [Arguments]    ${Mininet_IP}
27     Run Command On Remote System    ${Mininet_IP}    sudo ovs-vsctl del-manager
28     Run Command On Remote System    ${Mininet_IP}    sudo ovs-vsctl del-br ${Bridge_Name}
29     Run Command On Remote System    ${Mininet_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDBPORT}
30     ${stdout}    Run Command On Remote System    ${Mininet_IP}    sudo ovs-vsctl show
31     Should Contain    ${stdout}    "ptcp:${OVSDBPORT}"
32
33 Get Add Uni Json
34     [Documentation]    read the add_uni.json file and replace the IPaddress and MACaddress with the give arguments.
35     [Arguments]    ${IP-Address}    ${MAC-Address}
36     ${json}    OperatingSystem.Get File    ${UniMgr_Variables_DIR}/add_uni.json
37     ${temp}    Replace String    ${json}    {mac-address}    ${MAC-Address}
38     ${uniJson}    Replace String    ${temp}    {uni-ip}    ${IP-Address}
39     RETURN    ${uniJson}
40
41 Get Add Evc Json
42     [Documentation]    read the add_evc.json file and replace the IP-address with the give arguments.
43     [Arguments]    ${UNI1-IP}    ${UNI2-IP}
44     ${Json}    OperatingSystem.Get File    ${UniMgr_Variables_DIR}/add_evc.json
45     ${temp}    Replace String    ${Json}    {uni1-ip}    ${UNI1-IP}
46     ${evcJson}    Replace String    ${temp}    {uni2-ip}    ${UNI2-IP}
47     RETURN    ${evcJson}