aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/clamp/APIs/01__Test_CL_APIs.robot53
-rw-r--r--tests/clamp/UIs/01__Open_And_Edit_TCA.robot37
-rw-r--r--tests/clamp/UIs/02__Verify_Modification_In_UI.robot10
-rwxr-xr-xtests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot358
-rw-r--r--tests/multicloud-ocata/provision/hpa_multicloud.robot17
-rw-r--r--tests/multicloud-ocata/provision/sanity_test_multicloud.robot22
-rw-r--r--tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json484
-rw-r--r--tests/policy/api/api-test.robot2
-rw-r--r--tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json412
-rw-r--r--tests/policy/distribution/data/event.json11
-rw-r--r--tests/policy/distribution/distribution-test.robot22
-rw-r--r--tests/policy/xacml-pdp/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json412
-rw-r--r--tests/so/etsi/data/distributeServiceTemplate.json15
-rw-r--r--tests/so/etsi/data/vnfInstantiationRequest.json49
-rw-r--r--tests/so/etsi/etsi_tests.robot58
15 files changed, 1027 insertions, 935 deletions
diff --git a/tests/clamp/APIs/01__Test_CL_APIs.robot b/tests/clamp/APIs/01__Test_CL_APIs.robot
index 1a874323..3edccefd 100644
--- a/tests/clamp/APIs/01__Test_CL_APIs.robot
+++ b/tests/clamp/APIs/01__Test_CL_APIs.robot
@@ -22,48 +22,27 @@ Get Requests health check ok
List TCAs
${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/getAllNames
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName1_tca*
+ Should Contain Match ${resp} *Name1_tca*
Should Contain Match ${resp} *tca_2*
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName1_tca_3*
+ Should Contain Match ${resp} *Name1_tca_3*
Open TCA1
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName1_tca*
- Should Contain Match ${resp} *GENERATED_POLICY_ID_AT_SUBMIT*
- Should Contain Match ${resp} *onap.policy.monitoring.cdap.tca.hi.lo.app*
- Should Contain Match ${resp} *TCA Policy Scope*
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName1_tca
+ Should Contain Match ${resp} *Name1_tca*
+ Should Contain Match ${resp} *Operational Policy Item*
+ Should Contain Match ${resp} *Operational policies*
+ Should Contain Match ${resp} *Micro Service policies UPDATED*
Open TCA2
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName2_tca_2
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName2_tca_2*
- Should Contain Match ${resp} *GENERATED_POLICY_ID_AT_SUBMIT*
- Should Contain Match ${resp} *dmaap.onap-message-router*
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName2_tca_2
+ Should Contain Match ${resp} *Name2_tca_2*
+ Should Contain Match ${resp} *Operational Policy Item*
+ Should Contain Match ${resp} *1004*
Should Contain Match ${resp} *TCA Policy Scope*
Open TCA3
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca_3
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName1_tca*
- Should Contain Match ${resp} *GENERATED_POLICY_ID_AT_SUBMIT*
- Should Contain Match ${resp} *onap.policy.monitoring.cdap.tca.hi.lo.app*
- Should Contain Match ${resp} *TCA Policy Scope Version*
-
-Modify MicroService Policy TCA1
- ${data}= Get Binary File ${CURDIR}${/}data${/}microservicePolicyTca1.json
- &{headers}= Create Dictionary Content-Type=application/json
- ${resp}= POST Request ${clamp_session} /restservices/clds/v2/loop/updateMicroservicePolicy/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca data=${data} headers=${headers}
- Should Be Equal As Strings ${resp.status_code} 200
-
-Verify Modification MicroService TCA1
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca
- Should Contain Match ${resp} *version1.11*
-
-Modify Operational Policy TCA1
- ${data}= Get Binary File ${CURDIR}${/}data${/}operationalPolicyTca1.json
- &{headers}= Create Dictionary Content-Type=application/json
- ${resp}= POST Request ${clamp_session} /restservices/clds/v2/loop/updateOperationalPolicies/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca data=${data} headers=${headers}
- Should Be Equal As Strings ${resp.status_code} 200
-
-Verify Modification Operational TCA1
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca
- Should Contain Match ${resp} *Test_Field*
-
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName1_tca_3
+ Should Contain Match ${resp} *Name1_tca_3*
+ Should Contain Match ${resp} *Operational Policy Item*
+ Should Contain Match ${resp} *1004*
+ Should Contain Match ${resp} *TCA Policy Scope*
diff --git a/tests/clamp/UIs/01__Open_And_Edit_TCA.robot b/tests/clamp/UIs/01__Open_And_Edit_TCA.robot
index c0070c77..edf54e81 100644
--- a/tests/clamp/UIs/01__Open_And_Edit_TCA.robot
+++ b/tests/clamp/UIs/01__Open_And_Edit_TCA.robot
@@ -5,20 +5,17 @@ Library OperatingSystem
Library json
Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
Library XvfbRobot
-
*** Variables ***
${login} admin
${passw} password
-${SELENIUM_SPEED_FAST} .2 seconds
-${SELENIUM_SPEED_SLOW} .5 seconds
+${SELENIUM_SPEED_FAST} 1 seconds
+${SELENIUM_SPEED_SLOW} 2 seconds
${BASE_URL} https://localhost:8443
-
*** Keywords ***
Create the sessions
${auth}= Create List ${login} ${passw}
Create Session clamp ${BASE_URL} auth=${auth} disable_warnings=1
Set Global Variable ${clamp_session} clamp
-
*** Test Cases ***
Get Requests health check ok
Create the sessions
@@ -35,33 +32,5 @@ Reply to authentication popup
Run Keyword And Ignore Error Insert into prompt ${login} ${passw}
Confirm action
-Good Login to Clamp UI and Verify logged in
- Set Window Size 1920 1080
- ${title}= Get Title
- Should Be Equal CLDS ${title}
- Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60
- Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin
-
-Open TCA1 from Menu
- Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60
- Click Element xpath=//*[@id="navbar"]/ul/li[1]/a
- Wait Until Element Is Visible locator=Open CL timeout=60
- Click Element locator=Open CL
- Select From List By Label id=modelName LOOP_iYTIP_v1_0_ResourceInstanceName1_tca
- Click Button locator=OK
-
-Set Properties for HolmesModel1
- Wait Until Element Is Visible xpath=//*[@data-element-id="TCA_iYTIP_v1_0_ResourceInstanceName1_tca"] timeout=60
- Click Element xpath=//*[@data-element-id="TCA_iYTIP_v1_0_ResourceInstanceName1_tca"]
- Wait Until Element Is Visible xpath=//*[@id="editor"]/div/h3/div[2]/button[1] timeout=60
- Click Element xpath=//*[@id="editor"]/div/h3/div[2]/button[1]
- Wait Until Element Is Visible xpath=//*[@id="root.0"]/div[2]/div/div/div[2]/div/h3/div[2]/button[1]/span timeout=60
- Click Element xpath=//*[@id="root.0"]/div[2]/div/div/div[2]/div/h3/div[2]/button[1]/span
- Input Text xpath=//*[@name="root[0][metricsPerEventName][0][eventName]"] text=Event1
- Input Text xpath=//*[@name="root[0][metricsPerEventName][0][policyName]"] text=PolicyScope1
- Input Text xpath=//*[@name="root[0][metricsPerEventName][0][policyScope]"] text=TCAPolicyScope1
- Input Text xpath=//*[@name="root[0][metricsPerEventName][0][policyVersion]"] text=1.2.3
- Click Button locator=Done
-
Close Browser
- Close Browser
+ Close Browser \ No newline at end of file
diff --git a/tests/clamp/UIs/02__Verify_Modification_In_UI.robot b/tests/clamp/UIs/02__Verify_Modification_In_UI.robot
index 979547c6..84ea22e8 100644
--- a/tests/clamp/UIs/02__Verify_Modification_In_UI.robot
+++ b/tests/clamp/UIs/02__Verify_Modification_In_UI.robot
@@ -21,8 +21,8 @@ Get Requests health check ok
Should Be Equal As Strings ${resp.status_code} 200
Open TCA1
- ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_iYTIP_v1_0_ResourceInstanceName1_tca
- Should Contain Match ${resp} *LOOP_iYTIP_v1_0_ResourceInstanceName1_tca*
- Should Contain Match ${resp} *Event1*
- Should Contain Match ${resp} *1.2.3*
- Should Contain Match ${resp} *PolicyScope1*
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName1_tca
+ Should Contain Match ${resp} *Name1_tca*
+ Should Contain Match ${resp} *Operational Policy*
+ Should Contain Match ${resp} *Micro Service policies UPDATED*
+ Should Contain Match ${resp} *POLICY SUBMIT request*
diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot
index 5e971da6..af7b6f1a 100755
--- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot
+++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot
@@ -1,151 +1,259 @@
*** Settings ***
-Library OperatingSystem
-Library RequestsLibrary
-Library Process
+Library OperatingSystem
+Library RequestsLibrary
+Library Process
-Resource ../../resources/common-keywords.robot
+Resource ../../resources/common-keywords.robot
*** Variables ***
-
+${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS.json
+${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw
+${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0
*** Test Cases ***
######### Single file, SFTP
Verify single event with single 1MB SFTP file. From event poll to published file
- [TAGS] DFC_FUNCTIONAL_1
- [Documentation] Verify single event with single SFTP 1MB file from event poll to published file.
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
- Set Environment Variable MR_TC --tc100
- Set Environment Variable DR_TC --tc normal
- Set Environment Variable DR_REDIR_TC --tc normal
- Set Environment Variable NUM_FTPFILES 1
- Set Environment Variable NUM_PNFS 1
- Set Environment Variable FILE_SIZE 1MB
- Set Environment Variable FTP_TYPE SFTP
- ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
- MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
- DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
- Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
- DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim
- ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ [TAGS] DFC_FUNCTIONAL_1
+ [Documentation] Verify single event with single SFTP 1MB file from event poll to published file.
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT
+ Log To Console Dfc containter clean: ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ Set Environment Variable MR_TC --tc100
+ Set Environment Variable DR_TC --tc normal
+ Set Environment Variable DR_REDIR_TC --tc normal
+ Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES
+ Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A
+ Set Environment Variable DR_REDIR_FEEDS 2:A
+ Set Environment Variable FTP_FILE_PREFIXES A
+ Set Environment Variable NUM_FTPFILES 1
+ Set Environment Variable NUM_PNFS 1
+ Set Environment Variable FILE_SIZE 1MB
+ Set Environment Variable FTP_TYPE SFTP
+ Set Environment Variable NUM_FTP_SERVERS 1
+ Set Environment Variable DR_FEEDS 2:A
+ Set Environment Variable DR_REDIR_SIM drsim_redir
+ Set Environment Variable SFTP_SIMS sftp-server0:22
+ Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21
+
+ ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+ Log To Console Simulator-start:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+ DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+
+ ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes
+ Log To Console Consul APP write:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes
+ Log To Console Consul APP read:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes
+ Log To Console CBS merged configuration:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Sleep 10
+
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+ Log To Console Dfc-start:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+ DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim
+
+ ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
Verify single event with single 5MB SFTP file. From event poll to published file
- [TAGS] DFC_FUNCTIONAL_2
- [Documentation] Verify single event with single SFTP 5MB file from event poll to published file.
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
- Set Environment Variable MR_TC --tc101
- Set Environment Variable DR_TC --tc normal
- Set Environment Variable DR_REDIR_TC --tc normal
- Set Environment Variable NUM_FTPFILES 1
- Set Environment Variable NUM_PNFS 1
- Set Environment Variable FILE_SIZE 5MB
- Set Environment Variable FTP_TYPE SFTP
- ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
- MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
- DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
- Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
- DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 1 000 000 bytes published file data in DR redir sim
- ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ [TAGS] DFC_FUNCTIONAL_2
+ [Documentation] Verify single event with single SFTP 5MB file from event poll to published file.
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT
+ Log To Console Dfc containter clean: ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ Set Environment Variable MR_TC --tc101
+ Set Environment Variable DR_TC --tc normal
+ Set Environment Variable DR_REDIR_TC --tc normal
+ Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES
+ Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A
+ Set Environment Variable DR_REDIR_FEEDS 2:A
+ Set Environment Variable FTP_FILE_PREFIXES A
+ Set Environment Variable NUM_FTPFILES 1
+ Set Environment Variable NUM_PNFS 1
+ Set Environment Variable FILE_SIZE 5MB
+ Set Environment Variable FTP_TYPE SFTP
+ Set Environment Variable NUM_FTP_SERVERS 1
+ Set Environment Variable DR_FEEDS 2:A
+ Set Environment Variable DR_REDIR_SIM drsim_redir
+ Set Environment Variable SFTP_SIMS sftp-server0:22
+ Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21
+
+ ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+ Log To Console Simulator-start: ${cli_cmd_output.stdout}
+ MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+ DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+
+ ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes
+ Log To Console Consul APP write:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes
+ Log To Console Consul APP read:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes
+ Log To Console CBS merged configuration:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Sleep 10
+
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+ Log To Console Dfc-start:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+ DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 5 000 000 bytes published file data in DR redir sim
+
+ ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process docker stop $(docker ps -aq) shell=yes
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process docker rm $(docker ps -aq) shell=yes
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Sleep 10
Verify single event with single 50MB SFTP file. From event poll to published file
- [TAGS] DFC_FUNCTIONAL_3
- [Documentation] Verify single event with single SFTP 50MB file from event poll to published file.
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
- Set Environment Variable MR_TC --tc102
- Set Environment Variable DR_TC --tc normal
- Set Environment Variable DR_REDIR_TC --tc normal
- Set Environment Variable NUM_FTPFILES 1
- Set Environment Variable NUM_PNFS 1
- Set Environment Variable FILE_SIZE 50MB
- Set Environment Variable FTP_TYPE SFTP
- ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
- MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
- DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
- Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
- Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
- DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim
- ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
- ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ [TAGS] DFC_FUNCTIONAL_3
+ [Documentation] Verify single event with single SFTP 50MB file from event poll to published file.
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
+ Set Environment Variable MR_TC --tc102
+ Set Environment Variable DR_TC --tc normal
+ Set Environment Variable DR_REDIR_TC --tc normal
+ Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES
+ Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A
+ Set Environment Variable DR_REDIR_FEEDS 2:A
+ Set Environment Variable FTP_FILE_PREFIXES A
+ Set Environment Variable NUM_FTPFILES 1
+ Set Environment Variable NUM_PNFS 1
+ Set Environment Variable FILE_SIZE 50MB
+ Set Environment Variable FTP_TYPE SFTP
+ Set Environment Variable NUM_FTP_SERVERS 1
+ Set Environment Variable DR_FEEDS 2:A
+ Set Environment Variable DR_REDIR_SIM drsim_redir
+ Set Environment Variable SFTP_SIMS sftp-server0:22
+ Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21
+
+ ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+ Log To Console Simulator-start: ${cli_cmd_output.stdout}
+ MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+ DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+
+ ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes
+ Log To Console Consul APP write:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes
+ Log To Console Consul APP read:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes
+ Log To Console CBS merged configuration:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Sleep 10
+
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+ Log To Console Dfc-start:
+ Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+
+ Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+ Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+ DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim
+ ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
+ ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+ Log ${cli_cmd_output.stdout} ${cli_cmd_output.stderr}
######### Single file, FTPS
# Temporarily removed due to issues with the certificates for the ftsp server simulator cert.
#Verify single event with single 1MB FTPS file. From event poll to published file
-# [TAGS] DFC_FUNCTIONAL_10
-# [Documentation] Verify single event with single FTPS 1MB file from event poll to published file.
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
-# Set Environment Variable MR_TC --tc200
-# Set Environment Variable DR_TC --tc normal
-# Set Environment Variable DR_REDIR_TC --tc normal
-# Set Environment Variable NUM_FTPFILES 1
-# Set Environment Variable NUM_PNFS 1
-# Set Environment Variable FILE_SIZE 1MB
-# Set Environment Variable FTP_TYPE FTPS
-# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
-# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
-# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
-# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
-# DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim
-# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+# [TAGS] DFC_FUNCTIONAL_10
+# [Documentation] Verify single event with single FTPS 1MB file from event poll to published file.
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
+# Set Environment Variable MR_TC --tc200
+# Set Environment Variable DR_TC --tc normal
+# Set Environment Variable DR_REDIR_TC --tc normal
+# Set Environment Variable NUM_FTPFILES 1
+# Set Environment Variable NUM_PNFS 1
+# Set Environment Variable FILE_SIZE 1MB
+# Set Environment Variable FTP_TYPE FTPS
+# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+# DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim
+# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
#
#Verify single event with single 5MB FTPS file. From event poll to published file
-# [TAGS] DFC_FUNCTIONAL_11
-# [Documentation] Verify single event with single FTPS 5MB file from event poll to published file.
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
-# Set Environment Variable MR_TC --tc201
-# Set Environment Variable DR_TC --tc normal
-# Set Environment Variable DR_REDIR_TC --tc normal
-# Set Environment Variable NUM_FTPFILES 1
-# Set Environment Variable NUM_PNFS 1
-# Set Environment Variable FILE_SIZE 5MB
-# Set Environment Variable FTP_TYPE FTPS
-# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
-# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
-# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
-# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
-# DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 5 000 000 bytes published file data in DR redir sim
-# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+# [TAGS] DFC_FUNCTIONAL_11
+# [Documentation] Verify single event with single FTPS 5MB file from event poll to published file.
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
+# Set Environment Variable MR_TC --tc201
+# Set Environment Variable DR_TC --tc normal
+# Set Environment Variable DR_REDIR_TC --tc normal
+# Set Environment Variable NUM_FTPFILES 1
+# Set Environment Variable NUM_PNFS 1
+# Set Environment Variable FILE_SIZE 5MB
+# Set Environment Variable FTP_TYPE FTPS
+# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+# DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 5 000 000 bytes published file data in DR redir sim
+# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
#
#Verify single event with single 50MB FTPS file. From event poll to published file
-# [TAGS] DFC_FUNCTIONAL_12
-# [Documentation] Verify single event with single FTPS 50MB file from event poll to published file.
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
-# Set Environment Variable MR_TC --tc202
-# Set Environment Variable DR_TC --tc normal
-# Set Environment Variable DR_REDIR_TC --tc normal
-# Set Environment Variable NUM_FTPFILES 1
-# Set Environment Variable NUM_PNFS 1
-# Set Environment Variable FILE_SIZE 50MB
-# Set Environment Variable FTP_TYPE FTPS
-# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
-# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
-# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
-# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
-# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
-# DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim
-# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
-# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
+# [TAGS] DFC_FUNCTIONAL_12
+# [Documentation] Verify single event with single FTPS 50MB file from event poll to published file.
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh
+# Set Environment Variable MR_TC --tc202
+# Set Environment Variable DR_TC --tc normal
+# Set Environment Variable DR_REDIR_TC --tc normal
+# Set Environment Variable NUM_FTPFILES 1
+# Set Environment Variable NUM_PNFS 1
+# Set Environment Variable FILE_SIZE 50MB
+# Set Environment Variable FTP_TYPE FTPS
+# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT}
+# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim
+# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT}
+# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files
+# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim
+# DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim
+# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh
+# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh
#
*** Keywords ***
diff --git a/tests/multicloud-ocata/provision/hpa_multicloud.robot b/tests/multicloud-ocata/provision/hpa_multicloud.robot
deleted file mode 100644
index 95d4d554..00000000
--- a/tests/multicloud-ocata/provision/hpa_multicloud.robot
+++ /dev/null
@@ -1,17 +0,0 @@
-*** settings ***
-Library Collections
-Library RequestsLibrary
-
-*** Variables ***
-@{return_ok_list}= 200 201 202
-${queryregistration_url} /api/multicloud-ocata/v0/CloudOwner_RegionOne/registry
-
-
-*** Test Cases ***
-OcataRegistryTest
- [Documentation] Register openstack cloud resources
- ${headers} Create Dictionary Content-Type=application/json Accept=application/json
- Create Session web_session http://${SERVICE_IP}:${SERVICE_PORT} headers=${headers}
- ${resp}= Post Request web_session ${queryregistration_url}
- ${response_code}= Convert To String ${resp.status_code}
- List Should Contain Value ${return_ok_list} ${response_code}
diff --git a/tests/multicloud-ocata/provision/sanity_test_multicloud.robot b/tests/multicloud-ocata/provision/sanity_test_multicloud.robot
deleted file mode 100644
index c6262524..00000000
--- a/tests/multicloud-ocata/provision/sanity_test_multicloud.robot
+++ /dev/null
@@ -1,22 +0,0 @@
-*** settings ***
-Library Collections
-Library RequestsLibrary
-Library OperatingSystem
-Library json
-
-*** Variables ***
-@{return_ok_list}= 200 201 202
-${queryswagger_ocata_url} /api/multicloud-ocata/v0/swagger.json
-
-
-*** Test Cases ***
-OcataSwaggerTest
- [Documentation] query swagger info rest test
- ${headers} Create Dictionary Content-Type=application/json Accept=application/json
- Create Session web_session http://${SERVICE_IP}:${SERVICE_PORT} headers=${headers}
- ${resp}= Get Request web_session ${queryswagger_ocata_url}
- ${response_code}= Convert To String ${resp.status_code}
- List Should Contain Value ${return_ok_list} ${response_code}
- ${response_json} json.loads ${resp.content}
- ${swagger_version}= Convert To String ${response_json['swagger']}
- Should Be Equal ${swagger_version} 2.0
diff --git a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json
index 8795b132..810d970d 100644
--- a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json
+++ b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json
@@ -1,284 +1,266 @@
{
"tosca_definitions_version": "tosca_simple_yaml_1_0_0",
- "policy_types": [
- {
- "onap.policies.controlloop.operational.Apex": {
- "version": "1.0.0",
- "description": "Operational Policy for Control Loops using the APEX PDP",
- "properties": {
- "engine_service": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.EngineService",
- "description": "APEX Engine Service Parameters"
- },
- "inputs": {
- "type": "map",
- "description": "Inputs for handling events coming into the APEX engine",
- "entry_schema": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
- }
- },
- "outputs": {
- "type": "map",
- "description": "Outputs for handling events going out of the APEX engine",
- "entry_schema": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
- }
- },
- "environment": {
- "type": "list",
- "description": "Envioronmental parameters for the APEX engine",
- "entry_schema": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.Environment"
- }
+ "policy_types": {
+ "onap.policies.controlloop.operational.Apex": {
+ "version": "1.0.0",
+ "description": "Operational Policy for Control Loops using the APEX PDP",
+ "properties": {
+ "engine_service": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.EngineService",
+ "description": "APEX Engine Service Parameters"
+ },
+ "inputs": {
+ "type": "map",
+ "description": "Inputs for handling events coming into the APEX engine",
+ "entry_schema": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
+ }
+ },
+ "outputs": {
+ "type": "map",
+ "description": "Outputs for handling events going out of the APEX engine",
+ "entry_schema": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
+ }
+ },
+ "environment": {
+ "type": "list",
+ "description": "Envioronmental parameters for the APEX engine",
+ "entry_schema": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.Environment"
}
}
}
}
- ],
- "data_types": [
- {
- "onap.datatypes.policies.controlloop.operational.apex.EngineService": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "name": {
- "type": "string",
- "description": "Specifies the engine name",
- "required": false,
- "default": "ApexEngineService"
- },
- "version": {
- "type": "string",
- "description": "Specifies the engine version in double dotted format",
- "required": false,
- "default": "1.0.0"
- },
- "id": {
- "type": "int",
- "description": "Specifies the engine id",
- "required": true
- },
- "instance_count": {
- "type": "int",
- "description": "Specifies the number of engine threads that should be run",
- "required": true
- },
- "deployment_port": {
- "type": "int",
- "description": "Specifies the port to connect to for engine administration",
- "required": false,
- "default": 1
- },
- "policy_model_file_name": {
- "type": "string",
- "description": "The name of the file from which to read the APEX policy model",
- "required": false,
- "default": ""
- },
- "policy_type_impl": {
- "type": "string",
- "description": "The policy type implementation from which to read the APEX policy model",
- "required": false,
- "default": ""
- },
- "periodic_event_period": {
- "type": "string",
- "description": "The time interval in milliseconds for the periodic scanning event, 0 means \"don't scan\"",
- "required": false,
- "default": 0
- },
- "engine": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine",
- "description": "The parameters for all engines in the APEX engine service",
- "required": true
- }
+ },
+ "data_types": {
+ "onap.datatypes.policies.controlloop.operational.apex.EngineService": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Specifies the engine name",
+ "required": false,
+ "default": "ApexEngineService"
+ },
+ "version": {
+ "type": "string",
+ "description": "Specifies the engine version in double dotted format",
+ "required": false,
+ "default": "1.0.0"
+ },
+ "id": {
+ "type": "int",
+ "description": "Specifies the engine id",
+ "required": true
+ },
+ "instance_count": {
+ "type": "int",
+ "description": "Specifies the number of engine threads that should be run",
+ "required": true
+ },
+ "deployment_port": {
+ "type": "int",
+ "description": "Specifies the port to connect to for engine administration",
+ "required": false,
+ "default": 1
+ },
+ "policy_model_file_name": {
+ "type": "string",
+ "description": "The name of the file from which to read the APEX policy model",
+ "required": false,
+ "default": ""
+ },
+ "policy_type_impl": {
+ "type": "string",
+ "description": "The policy type implementation from which to read the APEX policy model",
+ "required": false,
+ "default": ""
+ },
+ "periodic_event_period": {
+ "type": "string",
+ "description": "The time interval in milliseconds for the periodic scanning event, 0 means \"don't scan\"",
+ "required": false,
+ "default": 0
+ },
+ "engine": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine",
+ "description": "The parameters for all engines in the APEX engine service",
+ "required": true
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.EventHandler": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "name": {
- "type": "string",
- "description": "Specifies the event handler name, if not specified this is set to the key name",
- "required": false
- },
- "carrier_technology": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology",
- "description": "Specifies the carrier technology of the event handler (such as REST/Web Socket/Kafka)",
- "required": true
- },
- "event_protocol": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.EventProtocol",
- "description": "Specifies the event protocol of events for the event handler (such as Yaml/JSON/XML/POJO)",
- "required": true
- },
- "event_name": {
- "type": "string",
- "description": "Specifies the event name for events on this event handler, if not specified, the event name is read from or written to the event being received or sent",
- "required": false
- },
- "event_name_filter": {
- "type": "string",
- "description": "Specifies a filter as a regular expression, events that do not match the filter are dropped, the default is to let all events through",
- "required": false
- },
- "synchronous_mode": {
- "type": "bool",
- "description": "Specifies the event handler is syncronous (receive event and send response)",
- "required": false,
- "default": false
- },
- "synchronous_peer": {
- "type": "string",
- "description": "The peer event handler (output for input or input for output) of this event handler in synchronous mode, this parameter is mandatory if the event handler is in synchronous mode",
- "required": false,
- "default": ""
- },
- "synchronous_timeout": {
- "type": "int",
- "description": "The timeout in milliseconds for responses to be issued by APEX torequests, this parameter is mandatory if the event handler is in synchronous mode",
- "required": false,
- "default": ""
- },
- "requestor_mode": {
- "type": "bool",
- "description": "Specifies the event handler is in requestor mode (send event and wait for response mode)",
- "required": false,
- "default": false
- },
- "requestor_peer": {
- "type": "string",
- "description": "The peer event handler (output for input or input for output) of this event handler in requestor mode, this parameter is mandatory if the event handler is in requestor mode",
- "required": false,
- "default": ""
- },
- "requestor_timeout": {
- "type": "int",
- "description": "The timeout in milliseconds for wait for responses to requests, this parameter is mandatory if the event handler is in requestor mode",
- "required": false,
- "default": ""
- }
+ "onap.datatypes.policies.controlloop.operational.apex.EventHandler": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Specifies the event handler name, if not specified this is set to the key name",
+ "required": false
+ },
+ "carrier_technology": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology",
+ "description": "Specifies the carrier technology of the event handler (such as REST/Web Socket/Kafka)",
+ "required": true
+ },
+ "event_protocol": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.EventProtocol",
+ "description": "Specifies the event protocol of events for the event handler (such as Yaml/JSON/XML/POJO)",
+ "required": true
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Specifies the event name for events on this event handler, if not specified, the event name is read from or written to the event being received or sent",
+ "required": false
+ },
+ "event_name_filter": {
+ "type": "string",
+ "description": "Specifies a filter as a regular expression, events that do not match the filter are dropped, the default is to let all events through",
+ "required": false
+ },
+ "synchronous_mode": {
+ "type": "bool",
+ "description": "Specifies the event handler is syncronous (receive event and send response)",
+ "required": false,
+ "default": false
+ },
+ "synchronous_peer": {
+ "type": "string",
+ "description": "The peer event handler (output for input or input for output) of this event handler in synchronous mode, this parameter is mandatory if the event handler is in synchronous mode",
+ "required": false,
+ "default": ""
+ },
+ "synchronous_timeout": {
+ "type": "int",
+ "description": "The timeout in milliseconds for responses to be issued by APEX torequests, this parameter is mandatory if the event handler is in synchronous mode",
+ "required": false,
+ "default": ""
+ },
+ "requestor_mode": {
+ "type": "bool",
+ "description": "Specifies the event handler is in requestor mode (send event and wait for response mode)",
+ "required": false,
+ "default": false
+ },
+ "requestor_peer": {
+ "type": "string",
+ "description": "The peer event handler (output for input or input for output) of this event handler in requestor mode, this parameter is mandatory if the event handler is in requestor mode",
+ "required": false,
+ "default": ""
+ },
+ "requestor_timeout": {
+ "type": "int",
+ "description": "The timeout in milliseconds for wait for responses to requests, this parameter is mandatory if the event handler is in requestor mode",
+ "required": false,
+ "default": ""
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "label": {
- "type": "string",
- "description": "The label (name) of the carrier technology (such as REST, Kafka, WebSocket)",
- "required": true
- },
- "plugin_parameter_class_name": {
- "type": "string",
- "description": "The class name of the class that overrides default handling of event input or output for this carrier technology, defaults to the supplied input or output class",
- "required": false
- }
+ "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "label": {
+ "type": "string",
+ "description": "The label (name) of the carrier technology (such as REST, Kafka, WebSocket)",
+ "required": true
+ },
+ "plugin_parameter_class_name": {
+ "type": "string",
+ "description": "The class name of the class that overrides default handling of event input or output for this carrier technology, defaults to the supplied input or output class",
+ "required": false
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.EventProtocol": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "label": {
- "type": "string",
- "description": "The label (name) of the event protocol (such as Yaml, JSON, XML, or POJO)",
- "required": true
- },
- "event_protocol_plugin_class": {
- "type": "string",
- "description": "The class name of the class that overrides default handling of the event protocol for this carrier technology, defaults to the supplied event protocol class",
- "required": false
- }
+ "onap.datatypes.policies.controlloop.operational.apex.EventProtocol": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "label": {
+ "type": "string",
+ "description": "The label (name) of the event protocol (such as Yaml, JSON, XML, or POJO)",
+ "required": true
+ },
+ "event_protocol_plugin_class": {
+ "type": "string",
+ "description": "The class name of the class that overrides default handling of the event protocol for this carrier technology, defaults to the supplied event protocol class",
+ "required": false
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.Environmental": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the environment variable",
- "required": true
- },
- "value": {
- "type": "string",
- "description": "The value of the environment variable",
- "required": true
- }
+ "onap.datatypes.policies.controlloop.operational.apex.Environmental": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the environment variable",
+ "required": true
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the environment variable",
+ "required": true
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "context": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context",
- "description": "The properties for handling context in APEX engines, defaults to using Java maps for context",
- "required": false
- },
- "executors": {
- "type": "map",
- "description": "The plugins for policy executors used in engines such as javascript, MVEL, Jython",
- "required": true,
- "entry_schema": {
- "description": "The plugin class path for this policy executor",
- "type": "string"
- }
+ "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "context": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context",
+ "description": "The properties for handling context in APEX engines, defaults to using Java maps for context",
+ "required": false
+ },
+ "executors": {
+ "type": "map",
+ "description": "The plugins for policy executors used in engines such as javascript, MVEL, Jython",
+ "required": true,
+ "entry_schema": {
+ "description": "The plugin class path for this policy executor",
+ "type": "string"
}
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "distributor": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
- "description": "The plugin to be used for distributing context between APEX PDPs at runtime",
- "required": false
- },
- "schemas": {
- "type": "map",
- "description": "The plugins for context schemas available in APEX PDPs such as Java and Avro",
- "required": false,
- "entry_schema": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin"
- }
- },
- "locking": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.plugin",
- "description": "The plugin to be used for locking context in and between APEX PDPs at runtime",
- "required": false
- },
- "persistence": {
- "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
- "description": "The plugin to be used for persisting context for APEX PDPs at runtime",
- "required": false
+ "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "distributor": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
+ "description": "The plugin to be used for distributing context between APEX PDPs at runtime",
+ "required": false
+ },
+ "schemas": {
+ "type": "map",
+ "description": "The plugins for context schemas available in APEX PDPs such as Java and Avro",
+ "required": false,
+ "entry_schema": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin"
}
+ },
+ "locking": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.plugin",
+ "description": "The plugin to be used for locking context in and between APEX PDPs at runtime",
+ "required": false
+ },
+ "persistence": {
+ "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
+ "description": "The plugin to be used for persisting context for APEX PDPs at runtime",
+ "required": false
}
}
},
- {
- "onap.datatypes.policies.controlloop.operational.apex.Plugin": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the executor such as Javascript, Jython or MVEL",
- "required": true
- },
- "plugin_class_name": {
- "type": "string",
- "description": "The class path of the plugin class for this executor"
- }
+ "onap.datatypes.policies.controlloop.operational.apex.Plugin": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the executor such as Javascript, Jython or MVEL",
+ "required": true
+ },
+ "plugin_class_name": {
+ "type": "string",
+ "description": "The class path of the plugin class for this executor"
}
}
}
- ]
+ }
} \ No newline at end of file
diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot
index 959df40e..31060785 100644
--- a/tests/policy/api/api-test.robot
+++ b/tests/policy/api/api-test.robot
@@ -61,7 +61,7 @@ RetrieveMonitoringPolicyTypes
${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.Monitoring headers=${headers}
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- Dictionary Should Contain Key ${resp.json()['policy_types'][0]} onap.policies.Monitoring
+ List Should Contain Value ${resp.json()['policy_types']} onap.policies.Monitoring
CreateNewMonitoringPolicy
diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json
index 1d1a4d64..f06247d7 100644
--- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json
+++ b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json
@@ -1,223 +1,213 @@
{
- "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
- "policy_types": [
- {
- "onap.policies.Monitoring": {
- "derived_from": "tosca.policies.Root",
- "description": "a base policy type for all policies that governs monitoring provisioning"
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "policy_types": {
+ "onap.policies.Monitoring": {
+ "derived_from": "tosca.policies.Root",
+ "description": "a base policy type for all policies that governs monitoring provisioning"
+ },
+ "onap.policies.monitoring.cdap.tca.hi.lo.app": {
+ "derived_from": "onap.policies.Monitoring",
+ "version": "1.0.0",
+ "properties": {
+ "tca_policy": {
+ "type": "map",
+ "description": "TCA Policy JSON",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.tca_policy"
+ }
+ }
+ }
+ }
+ },
+ "data_types": {
+ "onap.datatypes.monitoring.metricsPerEventName": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "controlLoopSchemaType": {
+ "type": "string",
+ "required": true,
+ "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
+ "constraints": [
+ {
+ "valid_values": [
+ "VM",
+ "VNF"
+ ]
}
+ ]
+ },
+ "eventName": {
+ "type": "string",
+ "required": true,
+ "description": "Event name to which thresholds need to be applied"
+ },
+ "policyName": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope Name"
},
- {
- "onap.policies.monitoring.cdap.tca.hi.lo.app": {
- "derived_from": "onap.policies.Monitoring",
- "version": "1.0.0",
- "properties": {
- "tca_policy": {
- "type": "map",
- "description": "TCA Policy JSON",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.tca_policy"
- }
- }
- }
+ "policyScope": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope"
+ },
+ "policyVersion": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope Version"
+ },
+ "thresholds": {
+ "type": "list",
+ "required": true,
+ "description": "Thresholds associated with eventName",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.thresholds"
+ }
+ }
+ }
+ },
+ "onap.datatypes.monitoring.tca_policy": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "domain": {
+ "type": "string",
+ "required": true,
+ "description": "Domain name to which TCA needs to be applied",
+ "default": "measurementsForVfScaling",
+ "constraints": [
+ {
+ "equal": "measurementsForVfScaling"
}
+ ]
+ },
+ "metricsPerEventName": {
+ "type": "list",
+ "required": true,
+ "description": "Contains eventName and threshold details that need to be applied to given eventName",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.metricsPerEventName"
+ }
}
- ],
- "data_types": [
- {
- "onap.datatypes.monitoring.metricsPerEventName": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "controlLoopSchemaType": {
- "type": "string",
- "required": true,
- "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
- "constraints": [
- {
- "valid_values": [
- "VM",
- "VNF"
- ]
- }
- ]
- },
- "eventName": {
- "type": "string",
- "required": true,
- "description": "Event name to which thresholds need to be applied"
- },
- "policyName": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope Name"
- },
- "policyScope": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope"
- },
- "policyVersion": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope Version"
- },
- "thresholds": {
- "type": "list",
- "required": true,
- "description": "Thresholds associated with eventName",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.thresholds"
- }
- }
- }
+ }
+ },
+ "onap.datatypes.monitoring.thresholds": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "closedLoopControlName": {
+ "type": "string",
+ "required": true,
+ "description": "Closed Loop Control Name associated with the threshold"
+ },
+ "closedLoopEventStatus": {
+ "type": "string",
+ "required": true,
+ "description": "Closed Loop Event Status of the threshold",
+ "constraints": [
+ {
+ "valid_values": [
+ "ONSET",
+ "ABATED"
+ ]
+ }
+ ]
+ },
+ "direction": {
+ "type": "string",
+ "required": true,
+ "description": "Direction of the threshold",
+ "constraints": [
+ {
+ "valid_values": [
+ "LESS",
+ "LESS_OR_EQUAL",
+ "GREATER",
+ "GREATER_OR_EQUAL",
+ "EQUAL"
+ ]
}
+ ]
},
- {
- "onap.datatypes.monitoring.tca_policy": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "domain": {
- "type": "string",
- "required": true,
- "description": "Domain name to which TCA needs to be applied",
- "default": "measurementsForVfScaling",
- "constraints": [
- {
- "equal": "measurementsForVfScaling"
- }
- ]
- },
- "metricsPerEventName": {
- "type": "list",
- "required": true,
- "description": "Contains eventName and threshold details that need to be applied to given eventName",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.metricsPerEventName"
- }
- }
- }
+ "fieldPath": {
+ "type": "string",
+ "required": true,
+ "description": "Json field Path as per CEF message which needs to be analyzed for TCA",
+ "constraints": [
+ {
+ "valid_values": [
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage",
+ "$.event.measurementsForVfScalingFields.meanRequestLatency",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ ]
}
+ ]
},
- {
- "onap.datatypes.monitoring.thresholds": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "closedLoopControlName": {
- "type": "string",
- "required": true,
- "description": "Closed Loop Control Name associated with the threshold"
- },
- "closedLoopEventStatus": {
- "type": "string",
- "required": true,
- "description": "Closed Loop Event Status of the threshold",
- "constraints": [
- {
- "valid_values": [
- "ONSET",
- "ABATED"
- ]
- }
- ]
- },
- "direction": {
- "type": "string",
- "required": true,
- "description": "Direction of the threshold",
- "constraints": [
- {
- "valid_values": [
- "LESS",
- "LESS_OR_EQUAL",
- "GREATER",
- "GREATER_OR_EQUAL",
- "EQUAL"
- ]
- }
- ]
- },
- "fieldPath": {
- "type": "string",
- "required": true,
- "description": "Json field Path as per CEF message which needs to be analyzed for TCA",
- "constraints": [
- {
- "valid_values": [
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage",
- "$.event.measurementsForVfScalingFields.meanRequestLatency",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
- ]
- }
- ]
- },
- "severity": {
- "type": "string",
- "required": true,
- "description": "Threshold Event Severity",
- "constraints": [
- {
- "valid_values": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- }
- ]
- },
- "thresholdValue": {
- "type": "integer",
- "required": true,
- "description": "Threshold value for the field Path inside CEF message"
- },
- "version": {
- "type": "string",
- "required": true,
- "description": "Version number associated with the threshold"
- }
- }
+ "severity": {
+ "type": "string",
+ "required": true,
+ "description": "Threshold Event Severity",
+ "constraints": [
+ {
+ "valid_values": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
}
+ ]
+ },
+ "thresholdValue": {
+ "type": "integer",
+ "required": true,
+ "description": "Threshold value for the field Path inside CEF message"
+ },
+ "version": {
+ "type": "string",
+ "required": true,
+ "description": "Version number associated with the threshold"
}
- ]
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/policy/distribution/data/event.json b/tests/policy/distribution/data/event.json
new file mode 100644
index 00000000..9dbf2790
--- /dev/null
+++ b/tests/policy/distribution/data/event.json
@@ -0,0 +1,11 @@
+{
+ "nameSpace": "org.onap.policy.apex.sample.events",
+ "name": "Event0000",
+ "version": "0.0.1",
+ "source": "REST_0",
+ "target": "apex",
+ "TestSlogan": "Test slogan for External Event0",
+ "TestMatchCase": 3,
+ "TestTimestamp": 1536363522018,
+ "TestTemperature": 9080.866
+}
diff --git a/tests/policy/distribution/distribution-test.robot b/tests/policy/distribution/distribution-test.robot
index 34dd169c..2b1c6d64 100644
--- a/tests/policy/distribution/distribution-test.robot
+++ b/tests/policy/distribution/distribution-test.robot
@@ -5,9 +5,10 @@ Library OperatingSystem
Library json
*** Test Cases ***
+
Healthcheck
[Documentation] Runs Policy Distribution Health check
- ${auth}= Create List healthcheck zb!XztG34
+ ${auth}= Create List healthcheck zb!XztG34
Log Creating session https://${POLICY_DISTRIBUTION_IP}:6969
${session}= Create Session policy https://${POLICY_DISTRIBUTION_IP}:6969 auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
@@ -15,9 +16,10 @@ Healthcheck
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['code']} 200
+
Statistics
[Documentation] Runs Policy Distribution Statistics
- ${auth}= Create List healthcheck zb!XztG34
+ ${auth}= Create List healthcheck zb!XztG34
Log Creating session https://${POLICY_DISTRIBUTION_IP}:6969
${session}= Create Session policy https://${POLICY_DISTRIBUTION_IP}:6969 auth=${auth}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
@@ -25,3 +27,19 @@ Statistics
Log Received response from policy ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['code']} 200
+
+InvokeDistributionAndRunEventOnEngine
+ Wait Until Keyword Succeeds 5 min 30 sec InvokeDistributionUsingFile And RunEventOnApexEngine
+
+*** Keywords ***
+
+InvokeDistributionUsingFile And RunEventOnApexEngine
+ Copy File ${SCRIPT_DIR}/config/distribution/csar/csar_temp.csar ${SCRIPT_DIR}/config/distribution/csar/temp.csar
+ Move File ${SCRIPT_DIR}/config/distribution/csar/temp.csar ${SCRIPT_DIR}/config/distribution/temp/sample_csar_with_apex_policy.csar
+ Sleep 20 seconds "Waiting for the Policy Distribution to call Policy API and PAP"
+ Create Session apexSession http://${APEX_IP}:23324 max_retries=1
+ ${data}= Get Binary File ${CURDIR}${/}data${/}event.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Put Request apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Remove Files ${SCRIPT_DIR}/config/distribution/temp/sample_csar_with_apex_policy.csar
diff --git a/tests/policy/xacml-pdp/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json b/tests/policy/xacml-pdp/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json
index 1d1a4d64..f06247d7 100644
--- a/tests/policy/xacml-pdp/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json
+++ b/tests/policy/xacml-pdp/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json
@@ -1,223 +1,213 @@
{
- "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
- "policy_types": [
- {
- "onap.policies.Monitoring": {
- "derived_from": "tosca.policies.Root",
- "description": "a base policy type for all policies that governs monitoring provisioning"
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "policy_types": {
+ "onap.policies.Monitoring": {
+ "derived_from": "tosca.policies.Root",
+ "description": "a base policy type for all policies that governs monitoring provisioning"
+ },
+ "onap.policies.monitoring.cdap.tca.hi.lo.app": {
+ "derived_from": "onap.policies.Monitoring",
+ "version": "1.0.0",
+ "properties": {
+ "tca_policy": {
+ "type": "map",
+ "description": "TCA Policy JSON",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.tca_policy"
+ }
+ }
+ }
+ }
+ },
+ "data_types": {
+ "onap.datatypes.monitoring.metricsPerEventName": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "controlLoopSchemaType": {
+ "type": "string",
+ "required": true,
+ "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
+ "constraints": [
+ {
+ "valid_values": [
+ "VM",
+ "VNF"
+ ]
}
+ ]
+ },
+ "eventName": {
+ "type": "string",
+ "required": true,
+ "description": "Event name to which thresholds need to be applied"
+ },
+ "policyName": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope Name"
},
- {
- "onap.policies.monitoring.cdap.tca.hi.lo.app": {
- "derived_from": "onap.policies.Monitoring",
- "version": "1.0.0",
- "properties": {
- "tca_policy": {
- "type": "map",
- "description": "TCA Policy JSON",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.tca_policy"
- }
- }
- }
+ "policyScope": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope"
+ },
+ "policyVersion": {
+ "type": "string",
+ "required": true,
+ "description": "TCA Policy Scope Version"
+ },
+ "thresholds": {
+ "type": "list",
+ "required": true,
+ "description": "Thresholds associated with eventName",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.thresholds"
+ }
+ }
+ }
+ },
+ "onap.datatypes.monitoring.tca_policy": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "domain": {
+ "type": "string",
+ "required": true,
+ "description": "Domain name to which TCA needs to be applied",
+ "default": "measurementsForVfScaling",
+ "constraints": [
+ {
+ "equal": "measurementsForVfScaling"
}
+ ]
+ },
+ "metricsPerEventName": {
+ "type": "list",
+ "required": true,
+ "description": "Contains eventName and threshold details that need to be applied to given eventName",
+ "entry_schema": {
+ "type": "onap.datatypes.monitoring.metricsPerEventName"
+ }
}
- ],
- "data_types": [
- {
- "onap.datatypes.monitoring.metricsPerEventName": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "controlLoopSchemaType": {
- "type": "string",
- "required": true,
- "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
- "constraints": [
- {
- "valid_values": [
- "VM",
- "VNF"
- ]
- }
- ]
- },
- "eventName": {
- "type": "string",
- "required": true,
- "description": "Event name to which thresholds need to be applied"
- },
- "policyName": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope Name"
- },
- "policyScope": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope"
- },
- "policyVersion": {
- "type": "string",
- "required": true,
- "description": "TCA Policy Scope Version"
- },
- "thresholds": {
- "type": "list",
- "required": true,
- "description": "Thresholds associated with eventName",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.thresholds"
- }
- }
- }
+ }
+ },
+ "onap.datatypes.monitoring.thresholds": {
+ "derived_from": "tosca.datatypes.Root",
+ "properties": {
+ "closedLoopControlName": {
+ "type": "string",
+ "required": true,
+ "description": "Closed Loop Control Name associated with the threshold"
+ },
+ "closedLoopEventStatus": {
+ "type": "string",
+ "required": true,
+ "description": "Closed Loop Event Status of the threshold",
+ "constraints": [
+ {
+ "valid_values": [
+ "ONSET",
+ "ABATED"
+ ]
+ }
+ ]
+ },
+ "direction": {
+ "type": "string",
+ "required": true,
+ "description": "Direction of the threshold",
+ "constraints": [
+ {
+ "valid_values": [
+ "LESS",
+ "LESS_OR_EQUAL",
+ "GREATER",
+ "GREATER_OR_EQUAL",
+ "EQUAL"
+ ]
}
+ ]
},
- {
- "onap.datatypes.monitoring.tca_policy": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "domain": {
- "type": "string",
- "required": true,
- "description": "Domain name to which TCA needs to be applied",
- "default": "measurementsForVfScaling",
- "constraints": [
- {
- "equal": "measurementsForVfScaling"
- }
- ]
- },
- "metricsPerEventName": {
- "type": "list",
- "required": true,
- "description": "Contains eventName and threshold details that need to be applied to given eventName",
- "entry_schema": {
- "type": "onap.datatypes.monitoring.metricsPerEventName"
- }
- }
- }
+ "fieldPath": {
+ "type": "string",
+ "required": true,
+ "description": "Json field Path as per CEF message which needs to be analyzed for TCA",
+ "constraints": [
+ {
+ "valid_values": [
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait",
+ "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage",
+ "$.event.measurementsForVfScalingFields.meanRequestLatency",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree",
+ "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ ]
}
+ ]
},
- {
- "onap.datatypes.monitoring.thresholds": {
- "derived_from": "tosca.datatypes.Root",
- "properties": {
- "closedLoopControlName": {
- "type": "string",
- "required": true,
- "description": "Closed Loop Control Name associated with the threshold"
- },
- "closedLoopEventStatus": {
- "type": "string",
- "required": true,
- "description": "Closed Loop Event Status of the threshold",
- "constraints": [
- {
- "valid_values": [
- "ONSET",
- "ABATED"
- ]
- }
- ]
- },
- "direction": {
- "type": "string",
- "required": true,
- "description": "Direction of the threshold",
- "constraints": [
- {
- "valid_values": [
- "LESS",
- "LESS_OR_EQUAL",
- "GREATER",
- "GREATER_OR_EQUAL",
- "EQUAL"
- ]
- }
- ]
- },
- "fieldPath": {
- "type": "string",
- "required": true,
- "description": "Json field Path as per CEF message which needs to be analyzed for TCA",
- "constraints": [
- {
- "valid_values": [
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait",
- "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage",
- "$.event.measurementsForVfScalingFields.meanRequestLatency",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree",
- "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
- ]
- }
- ]
- },
- "severity": {
- "type": "string",
- "required": true,
- "description": "Threshold Event Severity",
- "constraints": [
- {
- "valid_values": [
- "CRITICAL",
- "MAJOR",
- "MINOR",
- "WARNING",
- "NORMAL"
- ]
- }
- ]
- },
- "thresholdValue": {
- "type": "integer",
- "required": true,
- "description": "Threshold value for the field Path inside CEF message"
- },
- "version": {
- "type": "string",
- "required": true,
- "description": "Version number associated with the threshold"
- }
- }
+ "severity": {
+ "type": "string",
+ "required": true,
+ "description": "Threshold Event Severity",
+ "constraints": [
+ {
+ "valid_values": [
+ "CRITICAL",
+ "MAJOR",
+ "MINOR",
+ "WARNING",
+ "NORMAL"
+ ]
}
+ ]
+ },
+ "thresholdValue": {
+ "type": "integer",
+ "required": true,
+ "description": "Threshold value for the field Path inside CEF message"
+ },
+ "version": {
+ "type": "string",
+ "required": true,
+ "description": "Version number associated with the threshold"
}
- ]
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/so/etsi/data/distributeServiceTemplate.json b/tests/so/etsi/data/distributeServiceTemplate.json
index 11b98807..47a9f21b 100644
--- a/tests/so/etsi/data/distributeServiceTemplate.json
+++ b/tests/so/etsi/data/distributeServiceTemplate.json
@@ -20,7 +20,7 @@
{
"artifactName": "manualdistributiontestvnf0_modules.json",
"artifactType": "VF_MODULES_METADATA",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/manualdistributiontestvnf0_modules.json",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/manualdistributiontestvnf0_modules.json",
"artifactChecksum": "NTc0NDlkNzdmYzVmMDM3ZjMxMTE2NDBmYWJiMDM1NzY\u003d",
"artifactDescription": "Auto-generated VF Modules information artifact",
"artifactTimeout": 120,
@@ -31,7 +31,7 @@
{
"artifactName": "base_ves_med1.yaml",
"artifactType": "HEAT",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.yaml",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.yaml",
"artifactChecksum": "YTAwNTQ3NjczY2Y5MmUwZjUzZTY1ZjNhNTA0NGQyMDY\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -40,7 +40,7 @@
"generatedArtifact": {
"artifactName": "base_ves_med1.env",
"artifactType": "HEAT_ENV",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
"artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d",
"artifactDescription": "Auto-generated HEAT Environment deployment artifact",
"artifactTimeout": 120,
@@ -53,7 +53,7 @@
{
"artifactName": "base_ves_med1.env",
"artifactType": "HEAT_ENV",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
"artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d",
"artifactDescription": "Auto-generated HEAT Environment deployment artifact",
"artifactTimeout": 120,
@@ -64,7 +64,7 @@
{
"artifactName": "TOSCA.meta",
"artifactType": "OTHER",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/TOSCA.meta",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/TOSCA.meta",
"artifactChecksum": "NWE2ODcyOWY0NGI2MzEyOGViYjUxNTEwMjU5OWRhZmI\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -75,7 +75,7 @@
{
"artifactName": "descriptor.yaml",
"artifactType": "OTHER",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/descriptor.yaml",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/descriptor.yaml",
"artifactChecksum": "YWZkNTg2ZGMzZjRhZjgxNzNkODJiNjgwZmRlZjlmNDE\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -90,7 +90,7 @@
{
"artifactName": "service-Manualdistributiontestservice-csar.csar",
"artifactType": "TOSCA_CSAR",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/artifacts/service-Manualdistributiontestservice-csar.csar",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/artifacts/service-Manualdistributiontestservice-csar.csar",
"artifactChecksum": "YWYxNmUxNTlhMmE3MjA1NGVhNTBhYTdkMmU0OTZjNzM\u003d",
"artifactDescription": "TOSCA definition package of the asset",
"artifactTimeout": 0,
@@ -100,4 +100,3 @@
],
"workloadContext": "Production"
}
-
diff --git a/tests/so/etsi/data/vnfInstantiationRequest.json b/tests/so/etsi/data/vnfInstantiationRequest.json
new file mode 100644
index 00000000..a4cc5c90
--- /dev/null
+++ b/tests/so/etsi/data/vnfInstantiationRequest.json
@@ -0,0 +1,49 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "instanceName": "CsitEtsiVnfInstance",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "demo",
+ "productFamilyId": "f13844f4-dbf8-4d0e-a979-45204f3ddb4e"
+ },
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelInvariantId": "0a0b9979-863d-4b7e-b7f4-d27725a182b3",
+ "modelVersionId": "8f43a8c9-c677-462a-ae36-8ddb5990a60d",
+ "modelName": "manualDistributionTestVNF",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "82ad3aa0-edc6-410c-a217-655fb064323f",
+ "modelCustomizationName": "manualDistributionTestVNF 0"
+ },
+ "requestParameters": {
+ "userParams": [],
+ "testApi": "GR_API"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "EtsiCloudRegion",
+ "cloudOwner": "CloudOwner",
+ "tenantId": "693c7729b2364a26a3ca602e6f66187d"
+ },
+ "lineOfBusiness": {
+ "lineOfBusinessName": "EtsiCsitLineOfBusiness"
+ },
+ "platform": {
+ "platformName": "EtsiCsitPlatform"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "Sol004Zip4Service",
+ "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5",
+ "modelVersion": "1.0",
+ "modelVersionId": "99d59273-4450-4034-9141-027f0c1a807a"
+ }
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot
index b2bf3ede..e35b5364 100644
--- a/tests/so/etsi/etsi_tests.robot
+++ b/tests/so/etsi/etsi_tests.robot
@@ -5,13 +5,14 @@ Library OperatingSystem
Library json
*** Variables ***
-
+${SLEEP_INTERVAL_SEC}= 5
+${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry.
*** Test Cases ***
Distribute Service Template
Create Session sdc_controller_session http://${REPO_IP}:8085
${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json
- &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped Content-Type=application/json Accept=application/json
+ &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test/unzipped Content-Type=application/json Accept=application/json
${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers}
Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result
Should Be Equal As Strings '${resp.status_code}' '200'
@@ -23,20 +24,55 @@ Invoke Service Instantiation
${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers}
Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result
log to console ${service_instantiation_request.content}
- ${service_instantiation_json_responce}= Evaluate json.loads("""${service_instantiation_request.content}""") json
-
- ${actual_request_state}= SET VARIABLE ""
+ ${service_instantiation_json_response}= Evaluate json.loads("""${service_instantiation_request.content}""") json
+ ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId]
+ ${service_instance_Id}= Set Variable ${service_instantiation_json_response}[requestReferences][instanceId]
+ SET GLOBAL VARIABLE ${service_instance_Id}
+ ${actual_request_state}= Set Variable ""
- : FOR ${INDEX} IN RANGE 48
- \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${service_instantiation_json_responce}[requestReferences][requestId]
+ : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ log to console ${orchestration_status_request.content}
- \ ${orchestration_json_responce}= Evaluate json.loads("""${orchestration_status_request.content}""") json
- \ ${actual_request_state}= SET VARIABLE ${orchestration_json_responce}[request][requestStatus][requestState]
+ \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ Log To Console Received actual repsonse status:${actual_request_state}
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
- \ log to console Will try again after 5 seconds
- \ SLEEP 5s
+ \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ \ SLEEP ${SLEEP_INTERVAL_SEC}s
+
Log To Console final repsonse status received: ${actual_request_state}
Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
Should Be Equal As Strings '${actual_request_state}' 'COMPLETE'
+
+Invoke VNF Instantiation
+ Run Keyword If "${service_instance_Id}"!="${EMPTY}" Log to Console Service Instance ID :${service_instance_Id} received
+ ... ELSE Fail Log to Console Invalid Service Instance ID :${service_instance_Id} recieved
+
+ Create Session api_handler_session http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}vnfInstantiationRequest.json
+ ${vnf_instantiate_request_json}= evaluate json.loads('''${data}''') json
+ set to dictionary ${vnf_instantiate_request_json}[requestDetails][relatedInstanceList][0][relatedInstance] instanceId=${service_instance_Id}
+ ${vnf_instantiate_request_string}= evaluate json.dumps(${vnf_instantiate_request_json}) json
+
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${vnf_instantiate_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs data=${vnf_instantiate_request_string} headers=${headers}
+ Run Keyword If '${vnf_instantiate_request.status_code}' == '200' log to console \nexecuted with expected result
+ ${vnf_instantiate_json_response}= Evaluate json.loads("""${vnf_instantiate_request.content}""") json
+ ${request_ID}= Set Variable ${vnf_instantiate_json_response}[requestReferences][requestId]
+ ${actual_request_state}= SET VARIABLE ""
+
+ : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
+ \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
+ \ Log To Console ${orchestration_status_request.content}
+ \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
+ \ ${service_instance_Id}= SET VARIABLE ${orchestration_json_response}[request][instanceReferences][serviceInstanceId]
+ \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
+ \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ \ SLEEP ${SLEEP_INTERVAL_SEC}s
+
+ Log To Console final repsonse status received: ${actual_request_state}
+ Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${actual_request_state}' 'COMPLETE' \ No newline at end of file