aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java/org
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-12-10 18:55:12 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-10 18:55:12 +0000
commit533311a4934838b67ffd0ca49d7958f69059bccd (patch)
treee612a590f1e6529f64d35193858958fa14a20edf /mso-api-handlers/mso-api-handler-infra/src/test/java/org
parente1fe1050b70e04eb35f10782ff2a655d0c3b882e (diff)
parentb3897d1aba740d95185f3c2c7016b7d674f12711 (diff)
Merge "requestid retrieval and validation in bpmn"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org')
0 files changed, 0 insertions, 0 deletions
l.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
*** Settings ***
Documentation     The main interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields
Library           OpenstackLibrary
Library         RequestsLibrary
Library           UUID
Library    OperatingSystem
Resource    ../global_properties.robot
Resource    ../json_templater.robot
Resource    openstack_common.robot


*** Variables ***
${OPENSTACK_CINDER_API_VERSION}    /v1
${OPENSTACK_CINDER_TYPES_PATH}    /types
${OPENSTACK_CINDER_VOLUMES_PATH}    /volumes
${OPENSTACK_CINDER_VOLUMES_ADD_BODY_FILE}        robot/assets/templates/cinder_add_volume.template
${OPENSTACK_CINDER_VOLUMES_TYPE}    SSD
${OPENSTACK_CINDER_AVAILABILITY_ZONE}    nova

*** Keywords ***
Get Openstack Volume Types
    [Documentation]    Returns the openstack volume types information
    [Arguments]    ${alias}
    ${resp}=    Internal Get Openstack    ${alias}    ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}   ${OPENSTACK_CINDER_TYPES_PATH}
    [Return]    ${resp.json()}

Get Openstack Volume
    [Documentation]    Returns the openstack volume information for the passed in volume id
    [Arguments]    ${alias}    ${volume_id}
    ${resp}=    Internal Get Openstack    ${alias}    ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}   ${OPENSTACK_CINDER_VOLUMES_PATH}      /${volume_id}
    [Return]    ${resp.json()}

Add Openstack Volume
    [Documentation]    Runs an Openstack Request to add a volume and returns that volume id of the created volume
    [Arguments]    ${alias}    ${name}      ${size}
    ${data_template}=    OperatingSystem.Get File    ${OPENSTACK_CINDER_VOLUMES_ADD_BODY_FILE}
    ${uuid}=    Generate UUID
    ${arguments}=    Create Dictionary    name=${name}     description=${GLOBAL_APPLICATION_ID}${uuid}  size=${size}    type=${OPENSTACK_CINDER_VOLUMES_TYPE}    availability_zone=${OPENSTACK_CINDER_AVAILABILITY_ZONE}
    ${data}=  Fill JSON Template    ${data_template}    ${arguments}
    ${resp}=    Internal Post Openstack    ${alias}    ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}   ${OPENSTACK_CINDER_VOLUMES_PATH}    data_path=    data=${data}
    Should Be Equal As Strings    200  ${resp.status_code}
    [Return]    ${resp.json()['volume']['id']}

Delete Openstack Volume
    [Documentation]    Runs an Openstack Request to delete a volume
    [Arguments]    ${alias}    ${volume_id}
    ${resp}=    Internal Delete Openstack    ${alias}    ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}   ${OPENSTACK_CINDER_VOLUMES_PATH}   /${volume_id}
    ${status_string}=    Convert To String    ${resp.status_code}
    Should Match Regexp    ${status_string}    ^(204|200|404)$
    [Return]    ${resp.text}