aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/so/direct_instantiate.robot
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-04-16 14:24:29 -0500
committerBrian Freeman <bf1936@att.com>2019-04-16 14:24:38 -0500
commite12b626ab2141e59d74314dc24713b295dac9d53 (patch)
tree2c9a5467ad28f50a7c85e255dcc4bb5fb604f4c5 /robot/resources/so/direct_instantiate.robot
parent4230caee7aaa5d34e9fb84f61d9f116f7224cc6a (diff)
Tie in SoUtils for direct to SO
Issue-ID: INT-1028 Change-Id: I263381efc078cf154262a52627a10e2c4b265ec9 Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/so/direct_instantiate.robot')
-rw-r--r--robot/resources/so/direct_instantiate.robot49
1 files changed, 49 insertions, 0 deletions
diff --git a/robot/resources/so/direct_instantiate.robot b/robot/resources/so/direct_instantiate.robot
new file mode 100644
index 00000000..afd99ad6
--- /dev/null
+++ b/robot/resources/so/direct_instantiate.robot
@@ -0,0 +1,49 @@
+*** Settings ***
+Documentation Instantiate VNF
+
+Library OperatingSystem
+Library Collections
+Library String
+Library DateTime
+Library SoUtils
+
+
+*** Variables ***
+
+
+*** Keywords ***
+Instantiate Service Direct To SO
+ [Documentation] Creates an entire service from a CSAR
+ [Arguments] ${service} ${csar_file} ${vnf_template_file}
+ # Example: ${csar_file}= Set Variable /tmp/csar/service-Vfw20190413133734-csar.csar
+ # Example: ${vnf_template_file}= Set Variable /var/opt/ONAP/testsuite/eteutils/vcpeutils/preload_templates/template.vfw_vfmodule.json
+ ${name_suffix}= Get Current Date exclude_millis=True
+ ${name_suffix}= Evaluate '${name_suffix}'.replace(' ','')
+ ${name_suffix}= Evaluate '${name_suffix}'.replace(':','')
+ ${heatbridge}= Set Variable false
+ ${preload_dict}= Copy Dictionary ${GLOBAL_PRELOAD_PARAMETERS['defaults']}
+ ${template}= Create Dictionary
+ @{keys}= Get Dictionary Keys ${preload_dict}
+ :for ${key} in @{keys}
+ \ ${value}= Get From Dictionary ${preload_dict} ${key}
+ \ ${tmp_value}= Set Variable If 'GLOBAL_' in $value ${value}
+ \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} \$ ${EMPTY}
+ \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} { ${EMPTY}
+ \ ${tmp_value}= Run Keyword If 'GLOBAL_' in $value Replace String ${tmp_value} } ${EMPTY}
+ \ ${value}= Set Variable If 'GLOBAL_' in $value ${GLOBAL_INJECTED_PROPERTIES["${tmp_value}"]} ${value}
+ \ ${new_key}= Catenate \$ { ${key} }
+ \ ${new_key}= Evaluate '${new_key}'.replace(' ','')
+ \ Set To Dictionary ${template} ${new_key} ${value}
+
+ ${tmp_key1}= Catenate \$ { ecompnet }
+ ${tmp_key1}= Evaluate '${tmp_key1}'.replace(' ','')
+ ${tmp_key2}= Catenate \$ { GLOBAL_INJECTED_UBUNTU_1404_IMAGE }
+ ${tmp_key2}= Evaluate '${tmp_key2}'.replace(' ','')
+ # ecompnet 13 , 14, 15
+ Set To Dictionary ${template} ${tmp_key1} 14 ${tmp_key2} ${GLOBAL_INJECTED_UBUNTU_1404_IMAGE}
+
+ Log ${preload_dict}
+ Log ${template}
+ Create Entire Service ${csar_file} ${vnf_template_file} ${template} ${name_suffix} ${GLOBAL_INJECTED_REGION} ${GLOBAL_INJECTED_OPENSTACK_TENANT_ID} ${heatbridge}
+
+