aboutsummaryrefslogtreecommitdiffstats
path: root/test/hpa_automation
diff options
context:
space:
mode:
authorItohan <itohan.ukponmwan@intel.com>2019-10-07 21:21:19 +0000
committerBrian Freeman <bf1936@att.com>2019-10-14 17:47:30 +0000
commit76ea974699c8de79070ededf2de74132f760b957 (patch)
tree4729e021547b8b654ad0f13b2f7704a419a98cc8 /test/hpa_automation
parent3e92cbf5f658e0e31a03bf05f62cc18169a9c59f (diff)
Fixed Bugs in HPA automtion script
Signed-off-by: Itohan Ukponmwan <itohan.ukponmwan@intel.com> Issue-ID: INT-1137 Change-Id: Ib681f797bb9ed631cfe36507425bcbd1fc2b5561
Diffstat (limited to 'test/hpa_automation')
-rwxr-xr-xtest/hpa_automation/heat/hpa_automation.py1
-rwxr-xr-xtest/hpa_automation/heat/hpa_automation_config.json4
-rw-r--r--test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload.txt (renamed from test/hpa_automation/heat/sample_vfw_hpa_preload.txt)4
-rw-r--r--test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload_sriov.txt175
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/DistancePolicy.tx (renamed from test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx)2
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/hpa_policy_test1.txt (renamed from test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt)2
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/optimization_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/query_policy.txt (renamed from test/hpa_automation/heat/sample_vfw_policies/query_policy.txt)2
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/vnf_policy.txt (renamed from test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt)2
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/DistancePolicy.tx1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/hpa_policy_test2.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/optimization_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/query_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/vnf_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/DistancePolicy.tx1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/hpa_policy_test3.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/optimization_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/query_policy.txt1
-rw-r--r--test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/vnf_policy.txt1
20 files changed, 195 insertions, 9 deletions
diff --git a/test/hpa_automation/heat/hpa_automation.py b/test/hpa_automation/heat/hpa_automation.py
index bd893d7fb..ab1d8d07f 100755
--- a/test/hpa_automation/heat/hpa_automation.py
+++ b/test/hpa_automation/heat/hpa_automation.py
@@ -483,6 +483,7 @@ add_policies(parameters)
service_dict = create_service_instance(parameters, service_model_list)
print "service instance parameters={}".format(service_dict)
service_model_uuid = service_dict["service_uuid"]
+time.sleep(2)
db_dict = query_db(parameters, service_model_uuid, vf_id)
#Wait for Service instance to be created then create VNF Instance
diff --git a/test/hpa_automation/heat/hpa_automation_config.json b/test/hpa_automation/heat/hpa_automation_config.json
index 70ec2681e..9587ffd42 100755
--- a/test/hpa_automation/heat/hpa_automation_config.json
+++ b/test/hpa_automation/heat/hpa_automation_config.json
@@ -13,7 +13,7 @@
"sdc_governor" : "gv0001",
"sdc_operator" : "op0001",
"csar-file-path" : "/root/vfw_hpa.zip",
-"sdnc_url" : "http://10.12.5.110:30208",
+"sdnc_url" : "https://10.12.5.110:30267",
"sdnc_user" : "admin",
"sdnc_password" : "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U",
"sdnc_preload_file" : "/root/integration/test/hpa_automation/heat/sample_vfw_hpa_preload.txt",
@@ -137,7 +137,7 @@
"//" : "Onboarding parameters",
"vendor-name" : "hpa-vendor",
"entitlement-pool-name" : "hpa-pool",
-"start-date" : "09/30/2019",
+"start-date" : "10/08/2019",
"expiry-date" : "12/31/2040",
"key-group-name" : "hpa-key",
"key-group-type" : "Universal",
diff --git a/test/hpa_automation/heat/sample_vfw_hpa_preload.txt b/test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload.txt
index 9e7289e6e..0f40d2548 100644
--- a/test/hpa_automation/heat/sample_vfw_hpa_preload.txt
+++ b/test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload.txt
@@ -159,8 +159,8 @@
"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",
+ "service-type": "9545d48f-03da-467e-8994-ae0716e7372d",
+ "vnf-name": "vfw-sriov-cli",
"vnf-type": "HpaVf0..base_vfw..module-0"
}
diff --git a/test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload_sriov.txt b/test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload_sriov.txt
new file mode 100644
index 000000000..e0d3b031d
--- /dev/null
+++ b/test/hpa_automation/heat/sample_preload_files/sample_vfw_hpa_preload_sriov.txt
@@ -0,0 +1,175 @@
+{
+ "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_11"
+ },
+ {
+ "vnf-parameter-name": "protected_private_net_id",
+ "vnf-parameter-value": "protected_private_net_11"
+ },
+ {
+ "vnf-parameter-name": "onap_private_net_id",
+ "vnf-parameter-value": "oam_onap_vnf_test"
+ },
+ {
+ "vnf-parameter-name": "protected_private_provider_net",
+ "vnf-parameter-value": "a"
+ },
+ {
+ "vnf-parameter-name": "unprotected_private_provider_net",
+ "vnf-parameter-value": "b"
+ },
+
+ {
+ "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.100.11"
+ },
+ {
+ "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.100.12"
+ },
+ {
+ "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.100.13"
+ },
+
+ {
+ "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": "9545d48f-03da-467e-8994-ae0716e7372d",
+ "vnf-name": "vfw-sriov-cli",
+ "vnf-type": "HpaVf0..base_vfw..module-0"
+
+ }
+ }
+ }}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt
deleted file mode 100644
index 24c075be6..000000000
--- a/test/hpa_automation/heat/sample_vfw_policies/optimization_policy.txt
+++ /dev/null
@@ -1 +0,0 @@
-{\"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/DistancePolicy.tx b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/DistancePolicy.tx
index fcea4689b..55b74405f 100644
--- a/test/hpa_automation/heat/sample_vfw_policies/DistancePolicy.tx
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/DistancePolicy.tx
@@ -1 +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\"}
+{\"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_DUBLIN.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/sample_vfw_policies_1/hpa_policy_test1.txt
index e1567dbbb..545fd631b 100644
--- a/test/hpa_automation/heat/sample_vfw_policies/hpa_policy_test1.txt
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/hpa_policy_test1.txt
@@ -1 +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\"}
+{\"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_DUBLIN.hpa_policy_vFWHPA_2\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/optimization_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/optimization_policy.txt
new file mode 100644
index 000000000..5951d2eae
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/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\":\"100\",\"resources\":[\"vFW\",\"resource_name\"]},{\"parameter\":\"hpa_score\",\"operator\":\"product\",\"weight\":\"200\",\"resources\":[\"vFW\",\"resource_name\"]}]},\"identity\":\"optimization\",\"policyScope\":[\"us\",\"international\",\"ip\",\"vfw\"]},\"priority\":\"5\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"3\",\"description\":\"PlacementOptimizationPolicyforvFWHPA\",\"policyName\":\"OSDF_DUBLIN.Placement_Optimization_vfw\",\"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/sample_vfw_policies_1/query_policy.txt
index 39fb11614..96ee0fb08 100644
--- a/test/hpa_automation/heat/sample_vfw_policies/query_policy.txt
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/query_policy.txt
@@ -1 +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\"}
+{\"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_DUBLIN.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/sample_vfw_policies_1/vnf_policy.txt
index 075c7349e..6449ac78f 100644
--- a/test/hpa_automation/heat/sample_vfw_policies/vnf_policy.txt
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_1/vnf_policy.txt
@@ -1 +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\"}
+{\"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_DUBLIN.vnfPolicy_vFWHPA_3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/DistancePolicy.tx b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/DistancePolicy.tx
new file mode 100644
index 000000000..8ed5e8752
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/DistancePolicy.tx
@@ -0,0 +1 @@
+{\"service\":\"distancePolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"distance_to_location\",\"applicableResources\":\"any\",\"identity\":\"distance-vFW-sriov\",\"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_DUBLIN.Distance_vFWHPA_sriov_1\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/hpa_policy_test2.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/hpa_policy_test2.txt
new file mode 100644
index 000000000..f7924cce9
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/hpa_policy_test2.txt
@@ -0,0 +1 @@
+{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"id\":\"vfw\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"firewall_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vfw_private_0_port_vnic_type\",\"attribute_value\":\"direct\"},{\"attribute_name\":\"unprotected_private_provider_net\",\"attribute_value\":\"private-1\"}]},{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vfw_private_1_port_vnic_type\",\"attribute_value\":\"direct\"},{\"attribute_name\":\"protected_private_provider_net\",\"attribute_value\":\"private-1\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"2\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]}]},{\"id\":\"vgenerator\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"packetgen_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vpg_private_0_port_vnic_type\",\"attribute_value\":\"direct\"},{\"attribute_name\":\"unprotected_private_provider_net\",\"attribute_value\":\"private-1\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]}]},{\"id\":\"vsink\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"sink_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vsn_private_0_port_vnic_type\",\"attribute_value\":\"direct\"},{\"attribute_name\":\"unprotected_private_provider_net\",\"attribute_value\":\"private-1\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW-sriov\",\"resources\":[\"vFW\",\"resource_name\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_DUBLIN.hpa_policy_vFWHPA_sriov_1\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/optimization_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/optimization_policy.txt
new file mode 100644
index 000000000..6c825b759
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/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\":\"100\",\"resources\":[\"vFW\",\"resource_name\"]},{\"parameter\":\"hpa_score\",\"operator\":\"product\",\"weight\":\"200\",\"resources\":[\"vFW\",\"resource_name\"]}]},\"identity\":\"optimization_sriov\",\"policyScope\":[\"us\",\"international\",\"ip\",\"vfw\"]},\"priority\":\"5\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"3\",\"description\":\"PlacementOptimizationPolicyforvFWHPA\",\"policyName\":\"OSDF_DUBLIN.Placement_Optimization_vfw_sriov\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/query_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/query_policy.txt
new file mode 100644
index 000000000..dec9632f7
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/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_sriov\",\"serviceName\":\"vFW\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"QuerypolicyforvFW\",\"policyName\":\"OSDF_DUBLIN.QueryPolicy_vFWHPA_sriov_1\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/vnf_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/vnf_policy.txt
new file mode 100644
index 000000000..821fad7fb
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_2/vnf_policy.txt
@@ -0,0 +1 @@
+{\"service\":\"vnfPolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"vnfPolicy\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"vnf_vFW_sriov\",\"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_DUBLIN.vnfPolicy_vFWHPA_sriov\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/DistancePolicy.tx b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/DistancePolicy.tx
new file mode 100644
index 000000000..49e0c7c28
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/DistancePolicy.tx
@@ -0,0 +1 @@
+{\"service\":\"distancePolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"distance_to_location\",\"applicableResources\":\"any\",\"identity\":\"vFW_Distance-new\",\"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_DUBLIN.Distance_vFWHPA_sriov_test3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/hpa_policy_test3.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/hpa_policy_test3.txt
new file mode 100644
index 000000000..b098dcf06
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/hpa_policy_test3.txt
@@ -0,0 +1 @@
+{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"id\":\"vfw\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"firewall_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vfw_private_1_port_vnic_type\",\"attribute_value\":\"direct\"},{\"attribute_name\":\"protected_private_provider_net\",\"attribute_value\":\"private-1\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]},{\"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\"}]},{\"hpa-feature\":\"hugePages\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"memoryPageSize\",\"hpa-attribute-value\":\"2\",\"operator\":\"=\",\"unit\":\"MB\"}]},{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"numVirtualCpu\",\"hpa-attribute-value\":\"2\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"virtualMemSize\",\"hpa-attribute-value\":\"4096\",\"operator\":\"=\",\"unit\":\"MB\"}]}]},{\"id\":\"vgenerator\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"packetgen_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"hugePages\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"False\",\"score\":\"200\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"memoryPageSize\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\",\"unit\":\"GB\"}]},{\"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\"}]},{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"unprotected_private_provider_net\",\"attribute_value\":\"private-0\"}]}],\"hpa-feature-attributes\":[]},{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"numVirtualCpu\",\"hpa-attribute-value\":\"1\",\"operator\":\">=\"},{\"hpa-attribute-key\":\"virtualMemSize\",\"hpa-attribute-value\":\"2\",\"operator\":\">=\",\"unit\":\"GB\"}]}]},{\"id\":\"vsink\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"sink_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[]},{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vsn_private_0_port_vnic_type\",\"attribute_value\":\"direct\"}]}],\"hpa-feature-attributes\":[]}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"vFW_HPA_new\",\"resources\":[\"vFW\",\"resource_name\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_DUBLIN.hpa_policy_vFWHPA_test3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/optimization_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/optimization_policy.txt
new file mode 100644
index 000000000..886a2b868
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/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\":\"100\",\"resources\":[\"vFW\",\"resource_name\"]},{\"parameter\":\"hpa_score\",\"operator\":\"product\",\"weight\":\"200\",\"resources\":[\"vFW\",\"resource_name\"]}]},\"identity\":\"optimization-vfw-new\",\"policyScope\":[\"us\",\"international\",\"ip\",\"vfw\"]},\"priority\":\"5\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"3\",\"description\":\"PlacementOptimizationPolicyforvGMuxInfra\",\"policyName\":\"OSDF_DUBLIN.Placement_Optimization_test3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/query_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/query_policy.txt
new file mode 100644
index 000000000..3dac69353
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/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\":\"Query_vFW_new\",\"serviceName\":\"vFW\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"QuerypolicyforvFW\",\"policyName\":\"OSDF_DUBLIN.QueryPolicy_vFWHPA_test3\",\"version\":\"test1\",\"riskType\":\"test\"}
diff --git a/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/vnf_policy.txt b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/vnf_policy.txt
new file mode 100644
index 000000000..44b885126
--- /dev/null
+++ b/test/hpa_automation/heat/sample_vfw_policies/sample_vfw_policies_3/vnf_policy.txt
@@ -0,0 +1 @@
+{\"service\":\"vnfPolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"vnfPolicy\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"vFW_vnf_new\",\"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_DUBLIN.vnfPolicy_vFWHPA_sriov_test3\",\"version\":\"test1\",\"riskType\":\"test\"}