Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Instantiate VNF |
| 3 | |
| 4 | Library OperatingSystem |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library DateTime |
| 8 | Library SoUtils |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame^] | 9 | Library ONAPLibrary.PreloadData |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 10 | Resource ../global_properties.robot |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 11 | |
DR695H | 8ade70b | 2019-07-09 18:10:53 -0400 | [diff] [blame] | 12 | *** Variables *** |
| 13 | ${VNF_KEYPAIR_SSH_KEY} robot/assets/keys/onap_dev_public.txt |
| 14 | |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 15 | *** Keywords *** |
| 16 | Instantiate Service Direct To SO |
| 17 | [Documentation] Creates an entire service from a CSAR |
| 18 | [Arguments] ${service} ${csar_file} ${vnf_template_file} |
| 19 | # Example: ${csar_file}= Set Variable /tmp/csar/service-Vfw20190413133734-csar.csar |
DR695H | ffe5abf | 2019-06-20 16:58:49 -0400 | [diff] [blame] | 20 | # Example: ${vnf_template_file}= Set Variable /var/opt/ONAP/testsuite/vcpeutils/preload_templates/template.vfw_vfmodule.json |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 21 | ${name_suffix}= Get Current Date exclude_millis=True |
| 22 | ${name_suffix}= Evaluate '${name_suffix}'.replace(' ','') |
| 23 | ${name_suffix}= Evaluate '${name_suffix}'.replace(':','') |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame^] | 24 | Set Directory preload ./demo/preload_data |
| 25 | ${preload_dict}= Get Default Preload Data preload |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 26 | ${template}= Create Dictionary |
| 27 | @{keys}= Get Dictionary Keys ${preload_dict} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 28 | :FOR ${key} IN @{keys} |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 29 | \ ${value}= Get From Dictionary ${preload_dict} ${key} |
| 30 | \ ${tmp_value}= Set Variable If 'GLOBAL_' in $value ${value} |
| 31 | \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} \$ ${EMPTY} |
| 32 | \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} { ${EMPTY} |
| 33 | \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} } ${EMPTY} |
| 34 | \ ${value}= Set Variable If 'GLOBAL_' in $value ${GLOBAL_INJECTED_PROPERTIES["${tmp_value}"]} ${value} |
| 35 | \ ${new_key}= Catenate \$ { ${key} } |
| 36 | \ ${new_key}= Evaluate '${new_key}'.replace(' ','') |
| 37 | \ Set To Dictionary ${template} ${new_key} ${value} |
| 38 | |
| 39 | ${tmp_key1}= Catenate \$ { ecompnet } |
| 40 | ${tmp_key1}= Evaluate '${tmp_key1}'.replace(' ','') |
| 41 | ${tmp_key2}= Catenate \$ { GLOBAL_INJECTED_UBUNTU_1404_IMAGE } |
| 42 | ${tmp_key2}= Evaluate '${tmp_key2}'.replace(' ','') |
| 43 | # ecompnet 13 , 14, 15 |
Brian Freeman | 9d85d0b | 2019-04-17 13:46:53 -0500 | [diff] [blame] | 44 | # use same method as sdnc preload robot script |
| 45 | ${ecompnet}= Evaluate str((${GLOBAL_BUILD_NUMBER}%128)+128) |
| 46 | |
| 47 | Set To Dictionary ${template} ${tmp_key1} ${ecompnet} ${tmp_key2} ${GLOBAL_INJECTED_UBUNTU_1404_IMAGE} |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 48 | |
| 49 | Log ${preload_dict} |
| 50 | Log ${template} |
Brian Freeman | ecd3860 | 2019-05-06 09:48:01 -0500 | [diff] [blame] | 51 | ${service_instance_id}= Create Entire Service ${csar_file} ${vnf_template_file} ${template} ${name_suffix} ${GLOBAL_INJECTED_REGION} ${GLOBAL_INJECTED_OPENSTACK_TENANT_ID} |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 52 | Log ServiceInstanceId:${service_instance_id} |
Brian Freeman | 9d85d0b | 2019-04-17 13:46:53 -0500 | [diff] [blame] | 53 | Should Not Be Equal As Strings ${service_instance_id} None |
Brian Freeman | e12b626 | 2019-04-16 14:24:29 -0500 | [diff] [blame] | 54 | |