Commit 9296d9f6 authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

templating and minor fix added

parent da5b9e4b
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
*** Settings ***
Library    String
Resource   environment/variables.txt 
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library    OperatingSystem
@@ -27,7 +28,6 @@ Requests a grant for a particular VNF lifecycle operation - Synchronous mode
    Check Operation Occurrence Id existence 
    Check HTTP Response Body Json Schema Is    grant


Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
    [Documentation]    Test ID: 7.3.2.1.2
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
@@ -114,7 +114,8 @@ Send Request Grant Request in Synchronous mode
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/grantRequest.json
    ${template}=    Get File    jsons/grantRequest.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${vnfdId}    flavourId=${flavourId}
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}
@@ -125,7 +126,8 @@ Send Request Grant Request in Asynchronous mode
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/grantRequest.json
    ${template}=    Get File    jsons/grantRequest.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${vnfdId}    flavourId=${flavourId}
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}
@@ -136,7 +138,8 @@ Send Request for a new Grant Forbiden Operation
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/grantRejectedRequest.json
    ${template}=    Get File    jsons/grantRejectedRequest.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${vnfdId}    flavourId=${flavourId}
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants    ${body}
    ${body}=    Output    response
    Set Suite Variable    ${response}    ${body}
@@ -145,7 +148,8 @@ Send Request Grant Request
    Set Headers    {"Accept": "${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/grantRequest.json
    ${template}=    Get File    jsons/grantRequest.json
    ${body}=        Format String   ${template}    vnfInstanceId=${vnfInstanceId}   vnfLcmOpOccId=${vnfLcmOpOccId}    vnfdId=${vnfdId}    flavourId=${flavourId}
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants    ${body}    allow_redirects=false
    ${resp}    Output    response
    ${result}=    evaluate    json.loads(json.dumps(${resp}))    json
+0 −3
Original line number Diff line number Diff line
@@ -8,9 +8,6 @@ Documentation This resource represents an individual grant. The client can us
...    It is determined by means outside the scope of the present document, such as configuration or policy,
...    how long an individual grant is available.

*** Variables ***
${response}    {}

*** Test Cases ***
POST Individual Grant - Method not implemented
    [Documentation]    Test ID: 7.3.2.2.1
+6 −6
Original line number Diff line number Diff line
@@ -14,12 +14,7 @@ ${apiVersion} v1

${SYNC_MODE}    1




${response}


${response}    {}

${VNFM_HOST}      localhost    # Hostname of the VNFM
${VNFM_PORT}      8080    # Listening port of the VNFM
@@ -42,3 +37,8 @@ ${sub_filter_invalid} filter_invalid
${subscriptionId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${notification_ep}    notification
${VrQuotaAvailNotification}    {}

${vnfInstanceId}    myVnfInstanceId
${vnfLcmOpOccId}    myLcmOccId
${vnfdId}    myVnF
${flavourId}    string
 No newline at end of file
+12 −12
Original line number Diff line number Diff line
{
  "vnfInstanceId": "string",
  "vnfLcmOpOccId": "string",
  "vnfdId": "string",
  "flavourId": "string",
{{
  "vnfInstanceId": "{vnfInstanceId}",
  "vnfLcmOpOccId": "{vnfLcmOpOccId}",
  "vnfdId": "{vnfdId}",
  "flavourId": "{flavourId}",
  "operation": "INSTANTIATE",
  "isAutomaticInvocation": true,
  "_links": {
    "vnfLcmOpOcc": {
  "_links": {{
    "vnfLcmOpOcc": {{
      "href": "string"
    },
    "vnfInstance": {
    }},
    "vnfInstance": {{
      "href": "string"
    }
  }
}
 No newline at end of file
    }}
  }}
}}
 No newline at end of file
+12 −12
Original line number Diff line number Diff line
{
  "vnfInstanceId": "myVnfInstanceId",
  "vnfLcmOpOccId": "myLcmOccId",
  "vnfdId": "myVnF",
  "flavourId": "string",
{{
  "vnfInstanceId": "{vnfInstanceId}",
  "vnfLcmOpOccId": "{vnfLcmOpOccId}",
  "vnfdId": "{vnfdId}",
  "flavourId": "{flavourId}",
  "operation": "INSTANTIATE",
  "isAutomaticInvocation": true,
  "_links": {
    "vnfLcmOpOcc": {
  "_links": {{
    "vnfLcmOpOcc": {{
      "href": "string"
    },
    "vnfInstance": {
    }},
    "vnfInstance": {{
      "href": "string"
    }
  }
}
 No newline at end of file
    }}
  }}
}}
 No newline at end of file