aboutsummaryrefslogtreecommitdiffstats
path: root/test/hpa_automation
diff options
context:
space:
mode:
authorItohan <itohan.ukponmwan@intel.com>2019-05-24 23:52:26 +0000
committerGary Wu <gwu@futurewei.com>2019-05-29 17:23:41 +0000
commit1f3c8d6b67fcfdc0bcb95d3b283b232a4bb56cbb (patch)
treec2e9afce785c164cfad09ccb0e1cbdbe7aaaeb9a /test/hpa_automation
parentc43f25d5a256091c17d4f15d1c9287906cd4a7b7 (diff)
Modified hpa_automation.py script
-Added more files required to run this script -Added a README file -Added sample hpa polices Issue-ID: INT-905 INT-904 INT-794 Signed-off-by: Itohan Ukponmwan <itohan.ukponmwan@intel.com> Change-Id: I5c77924863a9517ecaf7caaeb860c3c113a7b9d2
Diffstat (limited to 'test/hpa_automation')
-rw-r--r--test/hpa_automation/heat/README.md16
-rwxr-xr-xtest/hpa_automation/heat/hpa_automation.py40
-rwxr-xr-xtest/hpa_automation/heat/hpa_automation_config.json6
-rw-r--r--test/hpa_automation/heat/insert_policy_models_heat.py30
-rw-r--r--test/hpa_automation/heat/pdp_service_expose.yaml36
-rw-r--r--test/hpa_automation/heat/sample_vfw_hpa_preload.txt168
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/query_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt1
11 files changed, 269 insertions, 32 deletions
diff --git a/test/hpa_automation/heat/README.md b/test/hpa_automation/heat/README.md
new file mode 100644
index 000000000..93c6b5b59
--- /dev/null
+++ b/test/hpa_automation/heat/README.md
@@ -0,0 +1,16 @@
+## Guide for hpa_automation.py script in heat
+
+These guide describes how to run the hpa_automation.py script. It can be used to run the vFW and vDNS end to end use cases.
+
+## Prerequisites
+
+ 1. Install ONAP CLI. See [link](https://onap.readthedocs.io/en/dublin/submodules/cli.git/docs/installation_guide.html)
+ 2. Install python mysql.connector (pip install mysql-connector-python)
+ 3. Must have connectivity to the ONAP, a k8s vm already running is recommended as connectivity to the ONAP k8s network is required for the SDC onboarding section.
+ 4. Create policies for homing using the temp_resource_module_name specified in hpa_automation_config.json. Sample policies can be seen in the sample_vfw_policies directory. Be sure to specify the right path to the directory in hpa_automation_config.json
+ 5. Create Nodeport for Policy pdp using the pdp_service_expose.yaml file (copy pdp_service_expose.yaml in hpa_automation/heat to rancher and run kubectl apply -f pdp_expose.yaml)
+ 6. Put in the CSAR file to be used to create service models and specify its path in hpa_automation_config.json
+ 7. Modify the SO bpmn configmap to change the SO vnf adapter endpoint to v2. See step 4 [here](https://onap.readthedocs.io/en/casablanca/submodules/integration.git/docs/docs_vfwHPA.html#docs-vfw-hpa)
+ 8. Prepare sdnc_preload file and put in the right path to its location in hpa_automation_config.json
+ 9. Put in the right parameters for automation in hpa_automation_config.json
+ 10. Ensure the insert_policy_models_heat.py script is in the same location as the hpa_automation.py script as the automation scripts calls the insert_policy_models_heat.py script.
diff --git a/test/hpa_automation/heat/hpa_automation.py b/test/hpa_automation/heat/hpa_automation.py
index 1bbf3a40d..cc6dc68b0 100755
--- a/test/hpa_automation/heat/hpa_automation.py
+++ b/test/hpa_automation/heat/hpa_automation.py
@@ -1,23 +1,14 @@
#!/usr/bin/python
-#Prerequisites for machine to run this
-#Put in required parameters in hpa_automation_config.json
-#Install python-pip (apt install python-pip)
-#Install python mysql.connector (pip install mysql-connector-python)
-#Install ONAP CLI
-#Must have connectivity to the ONAP, a k8s vm already running is recommended
-#Create Preload File, the script will modify the parameters required from serivce model, service instance
-#and vnf instance
-#Create policies for homing
-#Put in CSAR file
-#modify so-bpmn configmap and change version to v2
+'''
+Read the README file before running this script
+'''
import json
import os
import mysql.connector as mariadb
import time
-
def get_parameters(file):
parameters = json.load(file)
return parameters
@@ -63,6 +54,7 @@ def register_cloud_helper(cloud_region, values, parameters):
multicloud_register_string = "oclip multicloud-register-cloud -y {} -x {} -m {}".format(parameters["cloud-owner"], \
cloud_region, parameters["multicloud_url"])
os.system(multicloud_register_string)
+ time.sleep(2)
def register_all_clouds(parameters):
cloud_dictionary = parameters["cloud_region_data"]
@@ -237,11 +229,10 @@ def create_service_model(parameters, vf_unique_id):
#VNF Deployment Section
-
def add_policies(parameters):
resource_string = (os.popen("oclip get-resource-module-name -u {} -p {} -m {} |grep {}".format(\
parameters["sdc_creator"], parameters["sdc_password"], parameters["sdc_catalog_url"], \
- parameters["service-model-name"] ))).read()
+ parameters["vf-name"] ))).read()
resource_module_name = (get_out_helper_2(resource_string))[1]
#Put in the right resource module name in all policies located in parameters["policy_directory"]
@@ -249,21 +240,15 @@ def add_policies(parameters):
parameters["policy_directory"], parameters["temp_resource_module_name"], resource_module_name))
#Upload policy models
- for model in os.listdir(parameters["policy_models_directory"]):
- os.system("oclip policy-type-create -x {} -u {} -p {} -m {}".format(model, parameters["policy_username"], \
- parameters["policy_password"], parameters["policy_url"]))
- time.sleep(0.5)
-
- #print("Put in the resourceModuleName {} in your policy files in {}. ".format(resource_module_name, \
- #(parameters["policy_directory"])))
- #raw_input("Press Enter to continue...")
-
+ os.system("python insert_policy_models.py {} {} {}".format(parameters["policy_db_ip"], parameters["policy_db_user"], \
+ parameters["policy_db_password"]))
#Loop through policy, put in resource_model_name and create policies
for policy in os.listdir(parameters["policy_directory"]):
policy_name = "{}.{}".format(parameters["policy_scope"], os.path.splitext(policy)[0])
policy_file = (os.path.join(parameters["policy_directory"], policy))
- #Create policy
+
+ #Create policy
os.system("oclip policy-create-outdated -m {} -u {} -p {} -x {} -S {} -T {} -o {} -b $(cat {})".format(parameters["policy_url"],\
parameters["policy_username"], parameters["policy_password"], policy_name, parameters["policy_scope"], \
parameters["policy_config_type"], parameters["policy_onapName"], policy_file))
@@ -347,8 +332,6 @@ def create_vnf(parameters, service_dict, db_dict, vf_model_dict):
vf_model_invariant_uuid = vf_model_dict["vf_model_invariant_uuid"]
vf_model_version = vf_model_dict["vf_model_version"]
-
-
vf_model_customization_name = db_dict["vf_model_customization_name"]
vf_model_customization_id = db_dict["vf_model_customization_id"]
@@ -471,10 +454,7 @@ vf_model_dict = create_vf_model(parameters, vsp_id)
vf_id = vf_model_dict["vf_id"]
vf_unique_id = vf_model_dict["vf_unique_id"]
service_model_list = create_service_model(parameters, vf_unique_id)
-
-#add_policies function not currently working, using curl commands
-#add_policies(parameters)
-
+add_policies(parameters)
service_dict = create_service_instance(parameters, service_model_list)
service_model_uuid = service_dict["service_uuid"]
db_dict = query_db(parameters, service_model_uuid, vf_id)
diff --git a/test/hpa_automation/heat/hpa_automation_config.json b/test/hpa_automation/heat/hpa_automation_config.json
index ff21bfe89..94ef7c81b 100755
--- a/test/hpa_automation/heat/hpa_automation_config.json
+++ b/test/hpa_automation/heat/hpa_automation_config.json
@@ -25,15 +25,17 @@
"so_mariadb_password" : "secretpassword",
"so_mariadb_db" : "catalogdb",
"multicloud_url" : "http://10.12.6.235:30280",
-"policy_url" : "https://10.12.6.235:30240",
+"policy_url" : "https://10.12.6.235:30694",
"policy_username" : "testpdp",
"policy_password" : "alpha123",
-"policy_models_directory" : "/root/automation_stuff/optf-osdf/osdf/models/policy/placement/tosca_upload/",
"policy_directory" : "/root/automation_stuff/vfw_policies",
"policy_scope" : "OSDF_CASABLANCA",
"policy_onapName" : "SampleDemo",
"policy_config_type": "MicroService",
"policy_pdp_group" : "default",
+"policy_db_ip" : "10.42.5.60",
+"policy_db_user" : "root",
+"policy_db_password" : "secret",
"//" : "Put in a temp resource module name, should be the same in policy files, script will replace it in policies",
"temp_resource_module_name" : "resource_name",
diff --git a/test/hpa_automation/heat/insert_policy_models_heat.py b/test/hpa_automation/heat/insert_policy_models_heat.py
new file mode 100644
index 000000000..68a1d23bf
--- /dev/null
+++ b/test/hpa_automation/heat/insert_policy_models_heat.py
@@ -0,0 +1,30 @@
+import mysql.connector
+import sys
+
+mydb = mysql.connector.connect(
+ host= sys.argv[1],
+ user= sys.argv[2],
+ passwd= sys.argv[3],
+ database="onap_sdk",
+)
+
+mycursor = mydb.cursor()
+
+sql = "INSERT INTO microservicemodels (modelname, description, dependency, imported_by, attributes, ref_attributes, sub_attributes, version, annotation, enumValues, dataOrderInfo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
+val = [
+ ('hpaPolicy', 'HPA Tests Model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,resources=MANY-true,flavorFeatures=flavorFeatures_properties:MANY-true:description-null', '{"directives_properties":{"attributes":"directives_attributes_properties:required-false:MANY-true:description-null","type":"string:defaultValue-null:required-false:MANY-false:description-null"},"directives_attributes_properties":{"attribute_name":"string:defaultValue-null:required-false:MANY-false:description-null","attribute_value":"string:defaultValue-null:required-false:MANY-false:description-null"},"flavorProperties_properties":{"score":"string:defaultValue-null:required-false:MANY-false:description-null","hpa-feature-attributes":"hpa-feature-attributes_properties:required-true:MANY-true:description-null","directives":"directives_properties:required-true:MANY-true:description-null","hpa-version":"string:defaultValue-null:required-true:MANY-false:description-null","hpa-feature":"string:defaultValue-null:required-true:MANY-false:description-null","mandatory":"string:defaultValue-null:required-true:MANY-false:description-null","architecture":"string:defaultValue-null:required-true:MANY-false:description-null"},"flavorFeatures_properties":{"directives":"directives_properties:required-true:MANY-true:description-null","flavorProperties":"flavorProperties_properties:required-true:MANY-true:description-null","id":"string:defaultValue-null:required-true:MANY-false:description-null","type":"string:defaultValue-null:required-true:MANY-false:description-null"},"hpa-feature-attributes_properties":{"unit":"string:defaultValue-null:required-false:MANY-false:description-null","hpa-attribute-value":"string:defaultValue-null:required-true:MANY-false:description-null","hpa-attribute-key":"string:defaultValue-null:required-true:MANY-false:description-null","operator":"OPERATOR:defaultValue-null:required-false:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true', 'OPERATOR=[<,<equal-sign,>,>equal-sign,equal-sign,!equal-sign,any,all,subset,], POLICYTYPE=[hpa,]', '""'),
+ ('distancePolicy', 'distancePolicy', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,distanceProperties=distanceProperties_properties:MANY-false:description-null,policyType=POLICYTYPE:MANY-false,resources=MANY-true,applicableResources=APPLICABLERESOURCES:MANY-false', '{"distanceProperties_properties":{"locationInfo":"string:defaultValue-null:required-true:MANY-false:description-null","distance":"distance_properties:required-true:MANY-false:description-null"},"distance_properties":{"unit":"UNIT:defaultValue-null:required-true:MANY-false:description-null","value":"string:defaultValue-null:required-true:MANY-false:description-null","operator":"OPERATOR:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true', 'OPERATOR=[<,<equal-sign,>,>equal-sign,equal-sign,], APPLICABLERESOURCES=[any,all,], POLICYTYPE=[distance_to_location,] ', '""'),
+ ('optimizationPolicy', 'Optimization policy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'objectiveParameter=objectiveParameter_properties:MANY-false:description-null,policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,objective=objectiveParameter_properties:MANY-false:description-null', '{"parameterAttributes_properties":{"customerLocationInfo":"string:defaultValue-null:required-true:MANY-false:description-null","parameter":"string:defaultValue-null:required-true:MANY-false:description-null","resources":"string:defaultValue-null:required-true:MANY-false:description-null","weight":"string:defaultValue-null:required-true:MANY-false:description-null","operator":"OPERATOR:defaultValue-null:required-true:MANY-false:description-null"},"objectiveParameter_properties":{"parameterAttributes":"parameterAttributes_properties:required-true:MANY-true:description-null","operator":"OPERATOR:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true', 'OPERATOR=[*,+,-,/,%,], POLICYTYPE=[placement_optimization,]', '""'),
+ ('queryPolicy', 'Query policy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,queryProperties=queryProperties_properties:MANY-true:description-null', '{"queryProperties_properties":{"attribute_location":"string:defaultValue-null:required-true:MANY-false:description-null","attribute":"string:defaultValue-null:required-true:MANY-false:description-null","value":"string:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true', 'POLICYTYPE=[request_param_query,]', '""'),
+ ('vnfPolicy', 'VnfPolicy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,resources=MANY-true,vnfProperties=vnfProperties_properties:MANY-true:description-null,applicableResources=APPLICABLERESOURCES:MANY-false', '{"vnfProperties_properties":{"serviceType":"string:defaultValue-null:required-true:MANY-false:description-null","inventoryProvider":"string:defaultValue-null:required-true:MANY-false:description-null","inventoryType":"INVENTORYTYPE:defaultValue-null:required-true:MANY-false:description-null","customerId":"string:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true', 'INVENTORYTYPE=[serviceInstanceId,vnfName,cloudRegionId,vimId,], APPLICABLERESOURCES=[any,all,], POLICYTYPE=[vnfPolicy,]', '""'),
+ ('vim_fit', 'Capacity policy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,capacityProperties=capacityProperties_properties:MANY-false:description-null,resources=MANY-true,applicableResources=APPLICABLERESOURCES:MANY-false', '{"capacityProperties_properties":{"request":"string:defaultValue-null:required-true:MANY-false:description-null","controller":"string:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true ', ' APPLICABLERESOURCES=[any,all,], POLICYTYPE=[vim_fit,]', '""'),
+ ('affinityPolicy', 'Affinity policy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,affinityProperties=affinityProperties_properties:MANY-false:description-null,resources=MANY-true,applicableResources=APPLICABLERESOURCES:MANY-false', '{"affinityProperties_properties":{"qualifier":"QUALIFIER:defaultValue-null:required-true:MANY-false:description-null","category":"string:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true ', ' APPLICABLERESOURCES=[any,all,], POLICYTYPE=[zone,], QUALIFIER=[same,different,]', '""'),
+ ('pciPolicy', 'Pci policy model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,resources=MANY-true,pciProperties=pciProperties_properties:MANY-true:description-null', '{"pciProperties_properties":{"pciOptimizationTimeConstraint":"string:defaultValue-null:required-false:MANY-false:description-null","pciOptimizationNwConstraint":"string:defaultValue-null:required-false:MANY-false:description-null","algoCategory":"string:defaultValue-null:required-false:MANY-false:description-null","pciOptmizationAlgoName":"string:defaultValue-null:required-false:MANY-false:description-null","pciOptimizationPriority":"string:defaultValue-null:required-false:MANY-false:description-null"}}', 'test1', 'olicyScope=matching-true, policyType=matching-true ', ' POLICYTYPE=[pciPolicy,]', '""'),
+ ('subscriberPolicy', 'Subscriber Policy Model', '[]', 'demo', 'identity=string:defaultValue-null:required-true:MANY-false:description-null', 'policyScope=MANY-true,policyType=POLICYTYPE:MANY-false,properties=properties_properties:MANY-false:description-type of a policy', '{"properties_properties":{"provStatus":"PROVSTATUS:defaultValue-null:required-true:MANY-false:description-null","subscriberName":"SUBSCRIBERNAME:defaultValue-null:required-true:MANY-false:description-null","subscriberRole":"SUBSCRIBERROLE:defaultValue-null:required-true:MANY-false:description-null"}}', 'test1', 'policyScope=matching-true, policyType=matching-true, properties=matching-true ', ' SUBSCRIBERNAME=[], SUBSCRIBERROLE=[], POLICYTYPE=[subscriberPolicy,], PROVSTATUS=[]', '""')
+]
+
+mycursor.executemany(sql, val)
+
+mydb.commit()
+
+print(mycursor.rowcount, "was inserted.")
diff --git a/test/hpa_automation/heat/pdp_service_expose.yaml b/test/hpa_automation/heat/pdp_service_expose.yaml
new file mode 100644
index 000000000..11ccf26ee
--- /dev/null
+++ b/test/hpa_automation/heat/pdp_service_expose.yaml
@@ -0,0 +1,36 @@
+# Please edit the object below. Lines beginning with a '#' will be ignored,
+# and an empty file will abort the edit. If an error occurs while saving this file will be
+# reopened with the relevant failures.
+#
+apiVersion: v1
+kind: Service
+metadata:
+ annotations:
+ msb.onap.org/service-info: '[ { "serviceName": "pdp", "version": "v1", "url":
+ "/pdp", "protocol": "REST", "port": "8081", "visualRange":"1" }, ]'
+ creationTimestamp: 2019-04-17T18:49:51Z
+ labels:
+ app: pdp
+ chart: pdp-4.0.0
+ heritage: Tiller
+ release: dev-policy
+ name: policy-pdp
+ namespace: onap
+ resourceVersion: "15043"
+ selfLink: /api/v1/namespaces/onap/services/pdp
+ uid: 95215ada-6141-11e9-a5ab-0201c4470b4f
+spec:
+ clusterIP: 10.43.200.169
+ ports:
+ - name: pdp
+ port: 8081
+ nodePort: 30694
+ protocol: TCP
+ targetPort: 8081
+ selector:
+ app: pdp
+ release: dev-policy
+ sessionAffinity: None
+ type: NodePort
+status:
+ loadBalancer: {}
diff --git a/test/hpa_automation/heat/sample_vfw_hpa_preload.txt b/test/hpa_automation/heat/sample_vfw_hpa_preload.txt
new file mode 100644
index 000000000..9e7289e6e
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_hpa_preload.txt
@@ -0,0 +1,168 @@
+{
+ "input": {
+ "request-information": {
+ "notification-url": "openecomp.org",
+ "order-number": "1",
+ "order-version": "1",
+ "request-action": "PreloadVNFRequest",
+ "request-id": "test"
+ },
+ "sdnc-request-header": {
+ "svc-action": "reserve",
+ "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
+ "svc-request-id": "test"
+ },
+ "vnf-topology-information": {
+ "vnf-assignments": {
+ "availability-zones": [],
+ "vnf-networks": [],
+ "vnf-vms": []
+ },
+
+
+ "vnf-parameters": [
+ {
+ "vnf-parameter-name": "vfw_image_name",
+ "vnf-parameter-value": "ubuntu-16.04"
+ },
+ {
+ "vnf-parameter-name": "firewall_flavor_name",
+ "vnf-parameter-value": "a"
+ },
+ {
+ "vnf-parameter-name": "sink_flavor_name",
+ "vnf-parameter-value": "b"
+ },
+ {
+ "vnf-parameter-name": "packetgen_flavor_name",
+ "vnf-parameter-value": "c"
+ },
+ {
+ "vnf-parameter-name": "public_net_id",
+ "vnf-parameter-value": "external"
+ },
+ {
+ "vnf-parameter-name": "unprotected_private_net_id",
+ "vnf-parameter-value": "unprotected_private_net_00"
+ },
+ {
+ "vnf-parameter-name": "protected_private_net_id",
+ "vnf-parameter-value": "protected_private_net_00"
+ },
+ {
+ "vnf-parameter-name": "onap_private_net_id",
+ "vnf-parameter-value": "oam_onap_vnf_test"
+ },
+
+
+ {
+ "vnf-parameter-name": "onap_private_subnet_id",
+ "vnf-parameter-value": "oam_onap_vnf_test"
+ },
+ {
+ "vnf-parameter-name": "unprotected_private_net_cidr",
+ "vnf-parameter-value": "192.168.10.0/24"
+ },
+ {
+ "vnf-parameter-name": "protected_private_net_cidr",
+ "vnf-parameter-value": "192.168.20.0/24"
+ },
+ {
+ "vnf-parameter-name": "onap_private_net_cidr",
+ "vnf-parameter-value": "10.0.0.0/16"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_ip_0",
+ "vnf-parameter-value": "192.168.10.100"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_ip_1",
+ "vnf-parameter-value": "192.168.20.100"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_ip_2",
+ "vnf-parameter-value": "10.0.200.1"
+ },
+ {
+ "vnf-parameter-name": "vpg_private_ip_0",
+ "vnf-parameter-value": "192.168.10.200"
+ },
+ {
+ "vnf-parameter-name": "vpg_private_ip_1",
+ "vnf-parameter-value": "10.0.200.2"
+ },
+ {
+ "vnf-parameter-name": "vsn_private_ip_0",
+ "vnf-parameter-value": "192.168.20.250"
+ },
+ {
+ "vnf-parameter-name": "vsn_private_ip_1",
+ "vnf-parameter-value": "10.0.200.3"
+ },
+
+ {
+ "vnf-parameter-name": "vfw_name_0",
+ "vnf-parameter-value": "vfw"
+ },
+ {
+ "vnf-parameter-name": "vpg_name_0",
+ "vnf-parameter-value": "vpktgen"
+ },
+ {
+ "vnf-parameter-name": "vsn_name_0",
+ "vnf-parameter-value": "vsink"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_0_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_1_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vfw_private_2_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vpg_private_0_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vpg_private_1_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vsn_private_0_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vsn_private_1_port_vnic_type",
+ "vnf-parameter-value": "normal"
+ },
+ {
+ "vnf-parameter-name": "vf_module_id",
+ "vnf-parameter-value": "HpaVf0..base_vfw..module-0"
+ },
+ {
+ "vnf-parameter-name": "sec_group",
+ "vnf-parameter-value": "default"
+ },
+
+ {
+ "vnf-parameter-name": "template_type",
+ "vnf-parameter-value": "heat"
+ }
+
+
+ ],
+ "vnf-topology-identifier": {
+ "generic-vnf-name": "vfw-hpa-vnf",
+ "generic-vnf-type": "hpa-vf-0 0",
+ "service-type": "e34efe67-b461-4978-8462-2e1217da48c7",
+ "vnf-name": "vfw-cli-stack",
+ "vnf-type": "HpaVf0..base_vfw..module-0"
+
+ }
+ }
+ }}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx b/test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx
new file mode 100644
index 000000000..fcea4689b
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx
@@ -0,0 +1 @@
+{\"service\":\"distancePolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"distance_to_location\",\"applicableResources\":\"any\",\"identity\":\"distance-vFW\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"distanceProperties\":{\"distance\":{\"value\":\"100\",\"unit\":\"km\",\"operator\":\"<\"},\"locationInfo\":\"customer_loc\"},\"resources\":[\"vFW\",\"resource_name\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"DistancePolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.Distance_vFWHPA_2\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt b/test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt
new file mode 100644
index 000000000..e1567dbbb
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt
@@ -0,0 +1 @@
+{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"firewall_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"512\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"memoryPageSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"hugePages\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]},{\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"isolate\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"logicalCpuThreadPinningPolicy\"},{\"hpa-attribute-value\":\"dedicated\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"logicalCpuPinningPolicy\"}],\"architecture\":\"generic\",\"hpa-feature\":\"cpuPinning\"}],\"id\":\"vfw\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"packetgen_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"1\",\"operator\":\">=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"7\",\"unit\":\"GB\",\"operator\":\">=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]}],\"id\":\"vgenerator\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"sink_flavor_name\"}],\"type\":\"flavor_directives\"}],\"id\":\"vsink\",\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[],\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW\",\"resources\":[\"vFW\",\"resource_name\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.hpa_policy_vFWHPA_2\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt
new file mode 100644
index 000000000..24c075be6
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt
@@ -0,0 +1 @@
+{\"service\":\"optimizationPolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"placement_optimization\",\"objective\":\"minimize\",\"objectiveParameter\":{\"operator\":\"sum\",\"parameterAttributes\":[{\"parameter\":\"distance\",\"operator\":\"product\",\"customerLocationInfo\":\"customer_loc\",\"weight\":\"1\",\"resources\":[\"vGMuxInfra\"]},{\"parameter\":\"distance\",\"operator\":\"product\",\"customerLocationInfo\":\"customer_loc\",\"weight\":\"1\",\"resources\":[\"vG\"]},{\"parameter\":\"hpa_score\",\"operator\":\"product\",\"weight\":\"200\",\"resources\":[\"vG\"]},{\"parameter\":\"distance\",\"operator\":\"product\",\"customerLocationInfo\":\"customer_loc\",\"weight\":\"100\",\"resources\":[\"vFW\",\"resource_name\"]},{\"parameter\":\"hpa_score\",\"operator\":\"product\",\"weight\":\"200\",\"resources\":[\"vFW\",\"resource_name\"]}]},\"identity\":\"optimization\",\"policyScope\":[\"vcpe\",\"us\",\"international\",\"ip\",\"vGMuxInfra\",\"vG\",\"vfw\"]},\"priority\":\"5\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"3\",\"description\":\"PlacementOptimizationPolicyforvGMuxInfra\",\"policyName\":\"OSDF_CASABLANCA.Placement_Optimization_3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/query_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/query_policy.txt
new file mode 100644
index 000000000..39fb11614
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/query_policy.txt
@@ -0,0 +1 @@
+{\"service\":\"queryPolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"request_param_query\",\"queryProperties\":[{\"attribute\":\"customerLatitude\",\"attribute_location\":\"customerLatitude\"},{\"attribute\":\"customerLongitude\",\"attribute_location\":\"customerLongitude\"}],\"identity\":\"vFW_Query_Policy\",\"serviceName\":\"vFW\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"QuerypolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.QueryPolicy_vFWHPA_3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt
new file mode 100644
index 000000000..075c7349e
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt
@@ -0,0 +1 @@
+{\"service\":\"vnfPolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"vnfPolicy\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"vnf_vFW\",\"resources\":[\"vFW\",\"resource_name\"],\"applicableResources\":\"any\",\"vnfProperties\":[{\"equipmentRole\":\"\",\"inventoryProvider\":\"aai\",\"inventoryType\":\"cloud\",\"serviceType\":\"\",\"customerId\":\"\",\"orchestrationStatus\":\"\"}]},\"priority\":\"6\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"3\",\"description\":\"vnfPolicy\",\"policyName\":\"OSDF_CASABLANCA.vnfPolicy_vFWHPA_3\",\"version\":\"test1\",\"riskType\":\"test\"}