[Documentation] returns a string in the direct authentacation format (e.g., grant_type=password&username=admin&password=admin).
... It can also be passed scope, client_id and client_secret arguments for the case of client specific authorization
${data}= Set Variable grant_type=password&username=${user}&password=${password}&scope=${scope}
- ${data}= Run Keyword If "${client_id}" != "${EMPTY}" Set Variable ${data}&client_id=${client_id} ELSE Set Variable
- ... ${data}
- ${data}= Run Keyword If "${client_secret}" != "${EMPTY}" Set Variable ${data}&client_secret=${client_secret} ELSE Set Variable
- ... ${data}
+ ${data}= Run Keyword If "${client_id}" != "${EMPTY}" Set Variable ${data}&client_id=${client_id}
+ ... ELSE Set Variable ${data}
+ ${data}= Run Keyword If "${client_secret}" != "${EMPTY}" Set Variable ${data}&client_secret=${client_secret}
+ ... ELSE Set Variable ${data}
[Return] ${data}
Disable Authentication On Controller
Should Be Equal As Strings ${resp.status_code} 404
Delete All Cars And Verify
- [Arguments] ${controller_ip} ${timeout}=3s
+ [Arguments] ${controller_ip} ${timeout}=3s
DeleteAllCars ${controller_ip} ${RESTCONFPORT} ${0}
Wait Until Keyword Succeeds ${timeout} 1s Check Cars Deleted ${controller_ip}
Wait Until Keyword Succeeds ${timeout} 1s Check Cars-Persons Deleted ${controller_ip}
Delete All Entries From Shards
- [Documentation] Delete All Shards.
[Arguments] @{controllers}
+ [Documentation] Delete All Shards.
: FOR ${ip} IN @{controllers}
\ Delete All Cars And Verify ${ip}
: FOR ${ip} IN @{controllers}
[Return] ${leader}
Expect No Leader
- [Documentation] No leader is elected in the car shard
[Arguments] ${shard_name}
+ [Documentation] No leader is elected in the car shard
${leader} GetLeader ${shard_name} ${3} ${1} ${1} ${RESTCONFPORT}
... ${CURRENT_CAR_LEADER}
Should Be Equal As Strings ${leader} None
Should Contain ${return string} Flushing chain `INPUT'
Should Contain ${return string} Flushing chain `FORWARD'
Should Contain ${return string} Flushing chain `OUTPUT'
-
Issue Command On Karaf Console
[Arguments] ${cmd} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=5
[Documentation] Will execute the given ${cmd} by ssh'ing to the karaf console running on ${CONTROLLER}
- ... Note that this keyword will open&close new SSH connection, without switching back to previously current session.
+ ... Note that this keyword will open&close new SSH connection, without switching back to previously current session.
Open Connection ${controller} port=${karaf_port} prompt=${KARAF_PROMPT} timeout=${timeout}
Login ${KARAF_USER} ${KARAF_PASSWORD}
Write ${cmd}
*** Keywords ***
Check Mapping Removal
[Arguments] ${json}
- Run Keyword If "${ODL_VERSION}" == "Li" Check Mapping Removal Lithium ${json} ELSE Post Log Check ${LFM_RPC_API}:get-mapping
- ... ${json} 404
+ Run Keyword If "${ODL_VERSION}" == "Li" Check Mapping Removal Lithium ${json}
+ ... ELSE Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
Check Mapping Removal Lithium
[Arguments] ${json}
Run Keyword If "${switch.mgmt_protocol}" == "ssh" Call Method ${switch} set_mgmt_user ${MININET_USER}
${connection_index}= Run Keyword If "${switch.mgmt_protocol}" == "ssh" SSHLibrary.Open Connection ${switch.mgmt_ip} prompt=${switch.mgmt_prompt} timeout=30s
Run Keyword If "${switch.mgmt_protocol}" == "ssh" Login With Public Key ${switch.mgmt_user} ${switch.ssh_key} any
- ${connection_index}= Run Keyword If "${switch.mgmt_protocol}" == "telnet" Telnet.Open Connection ${switch.mgmt_ip} ELSE Set Variable
- ... ${connection_index}
+ ${connection_index}= Run Keyword If "${switch.mgmt_protocol}" == "telnet" Telnet.Open Connection ${switch.mgmt_ip}
+ ... ELSE Set Variable ${connection_index}
[Return] ${connection_index}
Configure Connection Index And Prompt Wrapper
[Documentation] Wraps the Execute Command keyword so that depending on the switch.mgmt_protocol the right
... library (Telnet or SSHLibrary) is used.
${output}= Run Keyword If "${switch.mgmt_protocol}" == "ssh" SSHLibrary.Execute Command ${cmd}
- ${output}= Run Keyword If "${switch.mgmt_protocol}" == "telnet" Telnet.Execute Command ${cmd} ELSE Set Variable
- ... ${output}
+ ${output}= Run Keyword If "${switch.mgmt_protocol}" == "telnet" Telnet.Execute Command ${cmd}
+ ... ELSE Set Variable ${output}
[Return] ${output}
Connect To Switch
[Documentation] Prepare the Hbase Filter from Tsdr List output
${left_str}= Remove Space on String ${left_str}
${right_str}= Remove Space on String ${right_str} 1
- ${x}= Run Keyword If '${left_str}' == 'MetricID' Catenate ${SPACE} _ ELSE IF
- ... '${left_str}' == 'ObjectKeys' Catenate ${right_str} _ ELSE IF '${left_str}' == 'TimeStamp'
- ... Get Epoch Time ${right_str} ELSE Catenate ${SPACE}
+ ${x}= Run Keyword If '${left_str}' == 'MetricID' Catenate ${SPACE} _
+ ... ELSE IF '${left_str}' == 'ObjectKeys' Catenate ${right_str} _
+ ... ELSE IF '${left_str}' == 'TimeStamp' Get Epoch Time ${right_str}
+ ... ELSE Catenate ${SPACE}
[Return] ${x}
Create the Hbase table row
${vlanmap_bridge2} {"vlan": "300"}
${pathpolicy_topo} sudo mn --controller=remote,ip=${CONTROLLER} --custom topo-3sw-2host_multipath.py --topo pathpolicytopo --switch ovsk,protocols=OpenFlow13
@{PATHMAP_ATTR} "index":"1" "condition":"flowcond_path" "policy":"1"
-${policy_id} 1
+${policy_id} 1
@{PATHPOLICY_ATTR} "id":"1" "type":"OF" "name":"s4-eth2"
-${custom} ${CURDIR}/${CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH}
+${custom} ${CURDIR}/${CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH}
*** Keywords ***
Start SuiteVtnMa
Add a pathmap
[Arguments] ${pathmap_data}
[Documentation] Create a pathmap for a vtn
- ${json_data}= json.dumps ${pathmap_data}
+ ${json_data}= json.dumps ${pathmap_data}
${resp}= RequestsLibrary.Put session ${REST_CONTEXT}/pathmaps/${policy_id} data=${pathmap_data} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 201
Get a pathmap
[Documentation] Get a pathmap for a vtn.
- ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathmaps
+ ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathmaps
: FOR ${pathElement} IN @{PATHMAP_ATTR}
\ should Contain ${resp.content} ${pathElement}
Add a pathpolicy
[Arguments] ${pathpolicy_data}
[Documentation] Create a pathpolicy for a vtn
- ${json_data}= json.dumps ${pathpolicy_data}
+ ${json_data}= json.dumps ${pathpolicy_data}
${resp}= RequestsLibrary.Put session ${REST_CONTEXT}/pathpolicies/${policy_id} data=${pathpolicy_data} headers=${HEADERS}
Should Be Equal As Strings ${resp.status_code} 201
Get a pathpolicy
[Documentation] Get a pathpolicy for a vtn.
- ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathpolicies/${policy_id}
+ ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathpolicies/${policy_id}
: FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR}
\ should Contain ${resp.content} ${pathpolicyElement}
Get a pathmap after delete
[Documentation] Get a pathmap for a vtn.
- ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathmaps
+ ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathmaps
: FOR ${pathElement} IN @{PATHMAP_ATTR}
\ should Not Contain ${resp.content} ${pathElement}
Get a pathpolicy after delete
[Documentation] Get a pathpolicy for a vtn after delete.
- ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathpolicies/${policy_id}
+ ${resp}= RequestsLibrary.Get session ${REST_CONTEXT}/pathpolicies/${policy_id}
: FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR}
\ should Not Contain ${resp.content} ${pathpolicyElement}
Get Cars From Follower2 After Restart
[Documentation] Get cars in follower and verify
Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
-
Get All The Cars From The Second Follower
[Documentation] Add cars to the follower and verify
Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
-
*** Test Cases ***
Delete All Entries
[Documentation] Make sure the shards are cleared for testing.
- Delete All Entries From Shards @{controllers}
+ Delete All Entries From Shards @{controllers}
Get Car Leader And Followers
[Documentation] Find leader and followers in the car shard
Check Contents Of Car Leader Shards
[Documentation] Check all content using Leader
- Check Elements In Shards ${CURRENT_CAR_LEADER} ${NUM_ENTRIES}
+ Check Elements In Shards ${CURRENT_CAR_LEADER} ${NUM_ENTRIES}
Check Contents Of Car Follower1 Shards
[Documentation] Check all content using first follower
- Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
+ Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
Check Contents Of Car Follower2 Shards
[Documentation] Check all content using second follower
- Check Elements In Shards @{CAR_FOLLOWERS}[1] ${NUM_ENTRIES}
+ Check Elements In Shards @{CAR_FOLLOWERS}[1] ${NUM_ENTRIES}
Get Old Car Leader
[Documentation] Find leader in the car shard
Check Contents Of New Car Follower1 Shards
[Documentation] Check all content using first follower
- Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
+ Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
Readd People From New Car Leader
[Documentation] Add 100 persons and get persons from Leader
- Add People And Verify Without Init ${NEW_CAR_LEADER} ${NUM_ENTRIES}
+ Add People And Verify Without Init ${NEW_CAR_LEADER} ${NUM_ENTRIES}
Repurchase 100 Cars Using New Car Follower1
[Documentation] Repurchase 100 cars using Follower1
Check Contents Of New Car Leader Shards After Repurchase
[Documentation] Check all content using new Leader
- Check Elements In Shards ${NEW_CAR_LEADER} ${NUM_ENTRIES}
+ Check Elements In Shards ${NEW_CAR_LEADER} ${NUM_ENTRIES}
Check Contents Of New Car First Follower Shards After Repurchase
[Documentation] Check all content using first follower
- Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
+ Check Elements In Shards @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
Start Old Car Leader
[Documentation] Start Leader controller
Check Contents Of Old Leader Shards
[Documentation] Check all content using old Leader
- Check Elements In Shards ${OLD_CAR_LEADER} ${NUM_ENTRIES}
+ Check Elements In Shards ${OLD_CAR_LEADER} ${NUM_ENTRIES}
Readd People From Old Leader
[Documentation] Add 100 persons and get persons from Leader
- Wait Until Keyword Succeeds 30 2s Add People And Verify Without Init ${OLD_CAR_LEADER} ${NUM_ENTRIES}
+ Wait Until Keyword Succeeds 30 2s Add People And Verify Without Init ${OLD_CAR_LEADER} ${NUM_ENTRIES}
Repurchase 100 Cars Using Old Leader
[Documentation] Repurchase 100 cars using Follower1
Check Contents Of Old Leader Shards After Repurchase
[Documentation] Check all content using Leader
- Check Elements In Shards ${OLD_CAR_LEADER} ${NUM_ENTRIES}
-
+ Check Elements In Shards ${OLD_CAR_LEADER} ${NUM_ENTRIES}
${result}= Get Lines Containing String ${group_output} output:${port-id1}
Should Contain ${result} type=${group-type}
Should Contain ${result} output:${port-id1}
- Run Keyword If "${port-id2-state}" == "up" Should Contain ${result} output:${port-id2} ELSE Should not Contain
- ... ${result} output:${port-id2}
+ Run Keyword If "${port-id2-state}" == "up" Should Contain ${result} output:${port-id2}
+ ... ELSE Should not Contain ${result} output:${port-id2}
*** Test Cases ***
Check if switch1 detected
[Documentation] Check if openflow:1 is detected
- BuiltIn.Wait_Until_Keyword_Succeeds 12 3 Fetch vtn switch inventory openflow:1
+ BuiltIn.Wait_Until_Keyword_Succeeds 12 3 Fetch vtn switch inventory openflow:1
Check if switch2 detected
[Documentation] Check if openflow:2 is detected
- BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:2
+ BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:2
Check if switch3 detected
[Documentation] Check if openflow:3 is detected
- BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:3
+ BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:3
Check if switch4 detected
[Documentation] Check if openflow:4 is detected
- BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:4
+ BuiltIn.Wait_Until_Keyword_Succeeds 3 1 Fetch vtn switch inventory openflow:4
Add a vtn Tenant_path
[Documentation] Add a vtn Tenant_path
Add a interface If2_path
[Documentation] Add a interface if2_path into vBrdige vBridge1
- Add a interface Tenant_path vBridge1 if2_path {}
+ Add a interface Tenant_path vBridge1 if2_path {}
Add a portmap for interface if2_path
[Documentation] Create a portmap on Interface if2_path of vBridge1
${matchElement}= Create Dictionary index=1 ethernet=${ethernet} inetMatch=${inetMatch}
@{matchlist} Create List ${matchElement}
${flowcond_data}= Create Dictionary name=flowcond_path match=${matchlist}
- Add a flowcondition flowcond_path ${flowcond_data}
+ Add a flowcondition flowcond_path ${flowcond_data}
Add a pathmap
[Documentation] Create a pathmap in the vtn
Delete a vtn Tenant_path
[Documentation] Delete a vtn Tenant_path
Delete a vtn Tenant_path
-
-
-
-