summaryrefslogtreecommitdiffstats
path: root/test/policy-local-files
diff options
context:
space:
mode:
authorSastry Isukapalli <sastry@research.att.com>2018-03-17 02:40:15 -0400
committerSastry Isukapalli <sastry@research.att.com>2018-03-17 07:07:32 +0000
commit1a9638f5d5fc78f7e8be700e71b506fed3cc9d2d (patch)
treea5c38fbddd08beeead83c943ab2c744d448944f8 /test/policy-local-files
parent7c70d5ba1469b9ea3220bc61be1d1973e5e3e98a (diff)
New policies and required code changes
Issue-ID: OPTFRA-146 Change-Id: I2261ae69f52b184cd7dcb7b86d5905538666a411 Signed-off-by: Sastry Isukapalli <sastry@research.att.com>
Diffstat (limited to 'test/policy-local-files')
-rw-r--r--test/policy-local-files/Affinity_vCPE_1.json21
-rw-r--r--test/policy-local-files/Capacity_vGMuxInfra.json21
-rw-r--r--test/policy-local-files/Capacity_vG_1.json21
-rw-r--r--test/policy-local-files/CloudAttributePolicy_vGMuxInfra_1.json34
-rw-r--r--test/policy-local-files/CloudAttributePolicy_vG_1.json34
-rw-r--r--test/policy-local-files/DistanceToLocationPolicy_vGMuxInfra_1.json30
-rw-r--r--test/policy-local-files/DistanceToLocationPolicy_vG_1.json30
-rw-r--r--test/policy-local-files/Distance_vGMuxInfra_1.json21
-rw-r--r--test/policy-local-files/Distance_vG_1.json21
-rw-r--r--test/policy-local-files/INVALID-policies/INVALID-Affinity_vCPE_1.json21
-rw-r--r--test/policy-local-files/InventoryGroup_vGMuxInfra_1.json22
-rw-r--r--test/policy-local-files/InventoryGroup_vG_1.json22
-rw-r--r--test/policy-local-files/Min_Guarantee_vGMuxInfra_1.json21
-rw-r--r--test/policy-local-files/Placement_Optimization_1.json (renamed from test/policy-local-files/PlacementOptimizationPolicy.json)17
-rw-r--r--test/policy-local-files/QueryPolicy_vCPE.json20
-rw-r--r--test/policy-local-files/ResourceInstancePolicy_vG_1.json26
-rw-r--r--test/policy-local-files/VNFPolicy_vGMuxInfra_1.json36
-rw-r--r--test/policy-local-files/VNFPolicy_vG_1.json36
-rw-r--r--test/policy-local-files/ZonePolicy_vGMuxInfra_1.json26
-rw-r--r--test/policy-local-files/ZonePolicy_vG_1.json26
-rw-r--r--test/policy-local-files/hpa_policy_vGMuxInfra_1.json144
-rw-r--r--test/policy-local-files/hpa_policy_vG_1.json144
-rw-r--r--test/policy-local-files/meta-invalid-policies.txt4
-rw-r--r--test/policy-local-files/meta-valid-policies.txt12
-rw-r--r--test/policy-local-files/vnfPolicy_vG.json31
-rw-r--r--test/policy-local-files/vnfPolicy_vGMuxInfra.json31
26 files changed, 539 insertions, 333 deletions
diff --git a/test/policy-local-files/Affinity_vCPE_1.json b/test/policy-local-files/Affinity_vCPE_1.json
new file mode 100644
index 0000000..c42e9d8
--- /dev/null
+++ b/test/policy-local-files/Affinity_vCPE_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "affinityPolicy",
+ "policyName": "oofBeijing.affinityPolicy_vcpe",
+ "description": "Affinity policy for vCPE",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "affinity_vCPE",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
+ "affinityProperty": {
+ "qualifier": "different",
+ "category": "complex"
+ },
+ "policyType": "affinityPolicy",
+ "resources": ["vGMuxInfra", "vG"]
+ }
+}
diff --git a/test/policy-local-files/Capacity_vGMuxInfra.json b/test/policy-local-files/Capacity_vGMuxInfra.json
new file mode 100644
index 0000000..9eec54d
--- /dev/null
+++ b/test/policy-local-files/Capacity_vGMuxInfra.json
@@ -0,0 +1,21 @@
+{
+ "service": "capacityPolicy",
+ "policyName": "oofBeijing.capacityPolicy_vGMuxInfra",
+ "description": "Capacity policy for vGMuxInfra",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "capacity_vGMuxInfra",
+ "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
+ "resources": ["vGMuxInfra"],
+ "capacityProperty": {
+ "cpu": {"value": 2, "operator": ">"},
+ "memory": {"value": 4, "operator": ">", "unit": "Gb"}
+ },
+ "policyType": "capacityPolicy"
+ }
+}
diff --git a/test/policy-local-files/Capacity_vG_1.json b/test/policy-local-files/Capacity_vG_1.json
new file mode 100644
index 0000000..d5644a8
--- /dev/null
+++ b/test/policy-local-files/Capacity_vG_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "capacityPolicy",
+ "policyName": "oofBeijing.capacityPolicy_vGMuxInfra",
+ "description": "Capacity policy for vGMuxInfra",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "capacity_vGMuxInfra",
+ "policyScope": ["VCPE", "US", "INTERNATIONAL", "ip", "vG"],
+ "resources": ["vG"],
+ "capacityProperty": {
+ "cpu": {"value": 2, "operator": ">"},
+ "memory": {"value": 4, "operator": ">", "unit": "Gb"}
+ },
+ "policyType": "capacityPolicy"
+ }
+}
diff --git a/test/policy-local-files/CloudAttributePolicy_vGMuxInfra_1.json b/test/policy-local-files/CloudAttributePolicy_vGMuxInfra_1.json
deleted file mode 100644
index 57c0039..0000000
--- a/test/policy-local-files/CloudAttributePolicy_vGMuxInfra_1.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "service": "CloudAttributePolicy",
- "policyName": "CloudAttributePolicy_vGMuxInfra",
- "description": "Attribute policy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "3",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vGMuxInfra_cloud_attributes",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra"]
- },
- "cloudAttributeProperty": {
- "networkRoles": {
- "all": [
- "vGMuxInfra.OAM",
- "vGMuxInfra.SR_IOV_Provider2_1",
- "vGMuxInfra.SR_IOV_Provider2_2"
- ]
- },
- "complex": {
- "any": [ ]
- }
- },
- "type": "attribute",
- "resourceInstanceType": ["vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/CloudAttributePolicy_vG_1.json b/test/policy-local-files/CloudAttributePolicy_vG_1.json
deleted file mode 100644
index cbe2a88..0000000
--- a/test/policy-local-files/CloudAttributePolicy_vG_1.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "service": "CloudAttributePolicy",
- "policyName": "cloud AttributePolicy_vG",
- "description": "Attribute policy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "10",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vG_cloud_attributes",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG"]
- },
- "cloudAttributeProperty": {
- "networkRoles": {
- "all": [
- "vG.OAM",
- "vG.SR_IOV_Provider2_1",
- "vG.SR_IOV_Provider2_2"
- ]
- },
- "complex": {
- "any": [ ]
- }
- },
- "type": "attribute",
- "resourceInstanceType": ["vG"]
- }
-}
diff --git a/test/policy-local-files/DistanceToLocationPolicy_vGMuxInfra_1.json b/test/policy-local-files/DistanceToLocationPolicy_vGMuxInfra_1.json
deleted file mode 100644
index 414c167..0000000
--- a/test/policy-local-files/DistanceToLocationPolicy_vGMuxInfra_1.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "service": "DistanceToLocationPolicy",
- "policyName": "DistanceToLocationPolicy_vGMuxInfra",
- "description": "DistanceToLocationPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "3",
- "riskType": "test",
- "riskLevel": "2",
- "guard": "False",
- "content": {
- "distanceToLocationProperty": {
- "locationInfo": "customer_loc",
- "distanceCondition": {
- "parameter": "distance",
- "value": "50000 km",
- "operator": "less"
- }
- },
- "identity": "distance-vGMuxInfra",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra"]
- },
- "type": "distance_to_location",
- "resourceInstanceType": ["vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/DistanceToLocationPolicy_vG_1.json b/test/policy-local-files/DistanceToLocationPolicy_vG_1.json
deleted file mode 100644
index 737ee19..0000000
--- a/test/policy-local-files/DistanceToLocationPolicy_vG_1.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "service": "DistanceToLocationPolicy",
- "policyName": "DistanceToLocationPolicy_vG",
- "description": "DistanceToLocationPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "3",
- "riskType": "test",
- "riskLevel": "2",
- "guard": "False",
- "content": {
- "distanceToLocationProperty": {
- "locationInfo": "customer_loc",
- "distanceCondition": {
- "parameter": "distance",
- "value": "50000 km",
- "operator": "less"
- }
- },
- "identity": "distance-vG",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG"]
- },
- "type": "distance_to_location",
- "resourceInstanceType": ["vG"]
- }
-}
diff --git a/test/policy-local-files/Distance_vGMuxInfra_1.json b/test/policy-local-files/Distance_vGMuxInfra_1.json
new file mode 100644
index 0000000..a835ef1
--- /dev/null
+++ b/test/policy-local-files/Distance_vGMuxInfra_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "distancePolicy",
+ "policyName": "oofBeijing.distancePolicy_vGMuxInfra",
+ "description": "Distance Policy for vGMuxInfra",
+ "templateVersion": "0.0.1",
+ "version": "oofBeijing",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "distanceProperties": {
+ "locationInfo": "customer_location",
+ "distance": { "value": "500", "operator": "<", "unit": "km" }
+ },
+ "identity": "distance-vGMuxInfra",
+ "resources": ["vGMuxInfra"],
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
+ "policyType": "distancePolicy"
+ }
+}
diff --git a/test/policy-local-files/Distance_vG_1.json b/test/policy-local-files/Distance_vG_1.json
new file mode 100644
index 0000000..1af021a
--- /dev/null
+++ b/test/policy-local-files/Distance_vG_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "distancePolicy",
+ "policyName": "oofBeijing.distancePolicy_vG",
+ "description": "Distance Policy for vG",
+ "templateVersion": "0.0.1",
+ "version": "oofBeijing",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "distanceProperties": {
+ "locationInfo": "customer_location",
+ "distance": { "value": "1500", "operator": "<", "unit": "km" }
+ },
+ "identity": "distance-vG",
+ "resources": ["vG"],
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
+ "policyType": "distancePolicy"
+ }
+}
diff --git a/test/policy-local-files/INVALID-policies/INVALID-Affinity_vCPE_1.json b/test/policy-local-files/INVALID-policies/INVALID-Affinity_vCPE_1.json
new file mode 100644
index 0000000..86670c3
--- /dev/null
+++ b/test/policy-local-files/INVALID-policies/INVALID-Affinity_vCPE_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "affinityPolicy",
+ "MISSINGpolicyName": "oofBeijing.affinityPolicy_vcpe",
+ "description": "Affinity policy for vCPE",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "affinity_vCPE",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
+ "affinityProperty": {
+ "qualifier": "different",
+ "category": "complex"
+ },
+ "policyType": "affinityPolicy",
+ "resources": ["vGMuxInfra", "vG"]
+ }
+}
diff --git a/test/policy-local-files/InventoryGroup_vGMuxInfra_1.json b/test/policy-local-files/InventoryGroup_vGMuxInfra_1.json
deleted file mode 100644
index 20ff7f7..0000000
--- a/test/policy-local-files/InventoryGroup_vGMuxInfra_1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "service": "InventoryGroupPolicy",
- "policyName": "InventoryGroupPolicy_vGMuxInfra",
- "description": "InventoryGroupPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "6",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vGMuxInfra-pri-sec-2",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra"]
- },
- "type": "inventory_group",
- "resourceInstanceType": ["vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/InventoryGroup_vG_1.json b/test/policy-local-files/InventoryGroup_vG_1.json
deleted file mode 100644
index 99ae309..0000000
--- a/test/policy-local-files/InventoryGroup_vG_1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "service": "InventoryGroupPolicy",
- "policyName": "InventoryGroupPolicy_vG",
- "description": "InventoryGroupPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "6",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vG-pri-sec-1",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG"]
- },
- "type": "inventory_group",
- "resourceInstanceType": ["vG"]
- }
-}
diff --git a/test/policy-local-files/Min_Guarantee_vGMuxInfra_1.json b/test/policy-local-files/Min_Guarantee_vGMuxInfra_1.json
new file mode 100644
index 0000000..654c548
--- /dev/null
+++ b/test/policy-local-files/Min_Guarantee_vGMuxInfra_1.json
@@ -0,0 +1,21 @@
+{
+ "service": "minGuaranteePolicy",
+ "policyName": "oofBeijing.minGuaranee_vGMuxInfra",
+ "description": "Min guarantee policy for vGMuxInfra",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "minGuarantee_vGMuxInfra",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
+ "minGuaranteeProperty": {
+ "cpu": {"value": "true", "operator": "="},
+ "memory": {"value": "false", "operator": "="}
+ },
+ "policyType": "minGuaraneePolicy",
+ "resourceInstanceType": ["vGMuxInfra"]
+ }
+}
diff --git a/test/policy-local-files/PlacementOptimizationPolicy.json b/test/policy-local-files/Placement_Optimization_1.json
index 7c43435..5748c99 100644
--- a/test/policy-local-files/PlacementOptimizationPolicy.json
+++ b/test/policy-local-files/Placement_Optimization_1.json
@@ -1,9 +1,9 @@
{
"service": "PlacementOptimizationPolicy",
- "policyName": "PlacementOptimizationPolicy",
- "description": "PlacementOptimizationPolicy",
+ "policyName": "oofBeijing.PlacementOptimizationPolicy_vGMuxInfra",
+ "description": "Placement Optimization Policy for vGMuxInfra",
"templateVersion": "1702.03",
- "version": "1707",
+ "version": "oofBeijing",
"priority": "5",
"riskType": "test",
"riskLevel": "3",
@@ -15,7 +15,7 @@
"resource": ["vGMuxInfra"],
"customerLocationInfo": "customer_loc",
"parameter": "distance",
- "weight": "2",
+ "weight": "1",
"operator": "product"
},
{
@@ -29,13 +29,8 @@
"operator": "sum"
},
"identity": "optimization",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra","vG"]
- },
- "type": "placementOptimization",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
+ "policyType": "placementOptimization",
"objective": "minimize"
}
}
diff --git a/test/policy-local-files/QueryPolicy_vCPE.json b/test/policy-local-files/QueryPolicy_vCPE.json
new file mode 100644
index 0000000..4ed83f9
--- /dev/null
+++ b/test/policy-local-files/QueryPolicy_vCPE.json
@@ -0,0 +1,20 @@
+{
+ "service": "optimizationQueryPolicy",
+ "policyName": "oofBeijing.queryPolicy_vCPE",
+ "description": "Optimization query policy for vCPE",
+ "templateVersion": "0.0.1",
+ "version": "oofBeijing",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "queryProperties": [
+ {"attribute":"locationId", "value": "orderInfo.customerLocation"},
+ {"attribute":"id", "value": "orderInfo.vpnInfo"},
+ {"attribute":"upstreamBW", "value": "orderInfo.vpnInfo"}
+ ],
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
+ "type": "optimizationQueryPolicy"
+ }
+}
diff --git a/test/policy-local-files/ResourceInstancePolicy_vG_1.json b/test/policy-local-files/ResourceInstancePolicy_vG_1.json
deleted file mode 100644
index 21ae0e4..0000000
--- a/test/policy-local-files/ResourceInstancePolicy_vG_1.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "service": "ResourceInstancePolicy",
- "policyName": "ResourceInstancePolicy_vG",
- "description": "ResourceInstancePolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "5",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vG-resourceInstance",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG", "vGMuxInfra"]
- },
- "resourceInstanceProperty": {
- "request": "{\"test\": \"123\"}",
- "controller": "SDN-C"
- },
- "type": "instance_fit",
- "resourceInstanceType": ["vG", "vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/VNFPolicy_vGMuxInfra_1.json b/test/policy-local-files/VNFPolicy_vGMuxInfra_1.json
deleted file mode 100644
index b0963d6..0000000
--- a/test/policy-local-files/VNFPolicy_vGMuxInfra_1.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "service": "VNFPolicy",
- "policyName": "VNFPolicy_vGMuxInfra",
- "description": "VNFPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "6",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vGMuxInfra-pri-sec-1",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra"]
- },
- "property": [
- {
- "inventoryProvider": "aai",
- "serviceType": "",
- "inventoryType": "cloud",
- "customerId": ""
- },
- {
- "inventoryProvider": "aai",
- "serviceType": "vGMuxInfraaaS",
- "inventoryType": "service",
- "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77"
- }
- ],
- "type": "vnfPolicy",
- "resourceInstanceType": ["vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/VNFPolicy_vG_1.json b/test/policy-local-files/VNFPolicy_vG_1.json
deleted file mode 100644
index de0a158..0000000
--- a/test/policy-local-files/VNFPolicy_vG_1.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "service": "VNFPolicy",
- "policyName": "VNFPolicy_vG",
- "description": "VNFPolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "6",
- "riskType": "test",
- "riskLevel": "3",
- "guard": "False",
- "content": {
- "identity": "vG-pri-sec-1",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG"]
- },
- "property": [
- {
- "inventoryProvider": "aai",
- "serviceType": "",
- "inventoryType": "cloud",
- "customerId": " "
- },
- {
- "inventoryProvider": "aai",
- "serviceType": "vGaaS",
- "inventoryType": "service",
- "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77"
- }
- ],
- "type": "vnfPolicy",
- "resourceInstanceType": ["vG"]
- }
-}
diff --git a/test/policy-local-files/ZonePolicy_vGMuxInfra_1.json b/test/policy-local-files/ZonePolicy_vGMuxInfra_1.json
deleted file mode 100644
index 9f941e4..0000000
--- a/test/policy-local-files/ZonePolicy_vGMuxInfra_1.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "service": "ZonePolicy",
- "policyName": "ZonePolicy_vGMuxInfra",
- "description": "ZonePolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "5",
- "riskType": "test",
- "riskLevel": "2",
- "guard": "False",
- "content": {
- "identity": "zone-vGMuxInfra",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vGMuxInfra"]
- },
- "zoneProperty": {
- "qualifier": "different",
- "category": "complex"
- },
- "type": "zone",
- "resourceInstanceType": ["vGMuxInfra"]
- }
-}
diff --git a/test/policy-local-files/ZonePolicy_vG_1.json b/test/policy-local-files/ZonePolicy_vG_1.json
deleted file mode 100644
index 8104f6b..0000000
--- a/test/policy-local-files/ZonePolicy_vG_1.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "service": "ZonePolicy",
- "policyName": "ZonePolicy_vG",
- "description": "ZonePolicy",
- "templateVersion": "1702.03",
- "version": "1707",
- "priority": "5",
- "riskType": "test",
- "riskLevel": "2",
- "guard": "False",
- "content": {
- "identity": "zone-vG",
- "policyScope": {
- "serviceType": ["vCPE"],
- "geoRegion": ["US", "INTERNATIONAL"],
- "networkType": ["ip"],
- "resourceInstanceType": ["vG"]
- },
- "zoneProperty": {
- "qualifier": "different",
- "category": "complex"
- },
- "type": "zone",
- "resourceInstanceType": ["vG"]
- }
-}
diff --git a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
new file mode 100644
index 0000000..bf09532
--- /dev/null
+++ b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
@@ -0,0 +1,144 @@
+{
+ "service": "hpaPolicy",
+ "policyName": "oofBeijing.hpaPolicy_vGMuxInfra",
+ "description": "HPA policy for vGMuxInfra",
+ "templateVersion": "0.0.1",
+ "version": "1.0",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "resources": "vGMuxInfra",
+ "identity": "hpaPolicy_vGMuxInfra",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
+ "policyType": "hpaPolicy",
+ "flavorFeatures": [
+ {
+ "flavorLabel": "flavor_label_vm_01",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "cpuTopology",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"numCpuSockets", "values": "2","operator": ">=", "unit": ""},
+ {"attribute":"numCpuSockets", "values": "4","operator": "<=", "unit": ""},
+ {"attribute":"numCpuCores", "value": "2", "operator":">=", "unit": ""},
+ {"attribute":"numCpuCores", "value": "4", "operator":"<=", "unit": ""},
+ {"attribute":"numCpuThreads", "value": "4", "operator":">=", "unit": ""},
+ {"attribute":"numCpuThreads", "value": "8", "operator":"<=", "unit": ""}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "ovsDpdk",
+ "mandatory" : "False",
+ "score" : "3",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"dataProcessingAccelerationLibrary", "value":"ovsDpdk_version", "operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa_feature" : "cpuInstructionSetExtensions",
+ "mandatory" : "True",
+ "architecture": "INTEL-64",
+ "featureAttributes": [
+ {"attribute":"instructionSetExtensions", "value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
+ ]
+ }
+ ]
+ },
+ {
+ "flavorLabel": "flavor_label_vm_02",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "cpuPinningy",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"logicalCpuThreadPinningPolicy", "value":"<CPUTHREADPOLICY>", "operator": "=", "unit":""},
+ {"attribute":"logicalCpuPinningPolicy", "value": "<CPUPOLICY>","operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "localStorage",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "diskSize", "value": "2", "operator": "=", "unit": "GB"},
+ {"attribute": "ephemeralDiskSize", "value": "2", "operator": "=", "unit": "GB"},
+ {"attribute": "swapMemSize", "value":"16", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa_feature" : "pcie",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "pciCount", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "pciVendorId", "value":"8086", "operator": "=", "unit": ""},
+ {"attribute": "pciDeviceId", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "functionType", "value": "<PCITYPEVALUE>","operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ },
+ {
+ "flavorLabel": "flavor_label_vm_03",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "numa",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numaNodes", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "numaCpu-0", "values":"2", "operator": "=", "unit": ""},
+ {"attribute": "numaMem-0", "value": "2048", "operator": "=", "unit": "MB"},
+ {"attribute": "numaCpu-1", "values":"4", "operator": "=", "unit": ""},
+ {"attribute": "numaMem-1", "value": "4096", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "hugePages",
+ "mandatory" : "False",
+ "score" : "7",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "memoryPageSize", "value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/test/policy-local-files/hpa_policy_vG_1.json b/test/policy-local-files/hpa_policy_vG_1.json
new file mode 100644
index 0000000..98d8cea
--- /dev/null
+++ b/test/policy-local-files/hpa_policy_vG_1.json
@@ -0,0 +1,144 @@
+{
+ "service": "hpaPolicy",
+ "policyName": "oofBeijing.hpaPolicy_vG",
+ "description": "HPA policy for vG",
+ "templateVersion": "0.0.1",
+ "version": "1.0",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "resources": "vG",
+ "identity": "hpaPolicy_vG",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
+ "policyType": "hpaPolicy",
+ "flavorFeatures": [
+ {
+ "flavorLabel": "flavor_label_vm_01",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "cpuTopology",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"numCpuSockets", "values": "2","operator": ">=", "unit": ""},
+ {"attribute":"numCpuSockets", "values": "4","operator": "<=", "unit": ""},
+ {"attribute":"numCpuCores", "value": "2", "operator":">=", "unit": ""},
+ {"attribute":"numCpuCores", "value": "4", "operator":"<=", "unit": ""},
+ {"attribute":"numCpuThreads", "value": "4", "operator":">=", "unit": ""},
+ {"attribute":"numCpuThreads", "value": "8", "operator":"<=", "unit": ""}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "ovsDpdk",
+ "mandatory" : "False",
+ "score" : "3",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"dataProcessingAccelerationLibrary", "value":"ovsDpdk_version", "operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa_feature" : "cpuInstructionSetExtensions",
+ "mandatory" : "True",
+ "architecture": "INTEL-64",
+ "featureAttributes": [
+ {"attribute":"instructionSetExtensions", "value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
+ ]
+ }
+ ]
+ },
+ {
+ "flavorLabel": "flavor_label_vm_02",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "cpuPinningy",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute":"logicalCpuThreadPinningPolicy", "value":"<CPUTHREADPOLICY>", "operator": "=", "unit":""},
+ {"attribute":"logicalCpuPinningPolicy", "value": "<CPUPOLICY>","operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "localStorage",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "diskSize", "value": "2", "operator": "=", "unit": "GB"},
+ {"attribute": "ephemeralDiskSize", "value": "2", "operator": "=", "unit": "GB"},
+ {"attribute": "swapMemSize", "value":"16", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa_feature" : "pcie",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "pciCount", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "pciVendorId", "value":"8086", "operator": "=", "unit": ""},
+ {"attribute": "pciDeviceId", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "functionType", "value": "<PCITYPEVALUE>","operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ },
+ {
+ "flavorLabel": "flavor_label_vm_03",
+ "flavorProperties":[
+ {
+ "hpa_feature" : "numa",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numaNodes", "value": "2", "operator": "=", "unit": ""},
+ {"attribute": "numaCpu-0", "values":"2", "operator": "=", "unit": ""},
+ {"attribute": "numaMem-0", "value": "2048", "operator": "=", "unit": "MB"},
+ {"attribute": "numaCpu-1", "values":"4", "operator": "=", "unit": ""},
+ {"attribute": "numaMem-1", "value": "4096", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa_feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "numVirtualCpu", "value": "6", "operator": "=", "unit": ""},
+ {"attribute": "virtualMemSize", "value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa_feature" : "hugePages",
+ "mandatory" : "False",
+ "score" : "7",
+ "architecture": "generic",
+ "featureAttributes": [
+ {"attribute": "memoryPageSize", "value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/test/policy-local-files/meta-invalid-policies.txt b/test/policy-local-files/meta-invalid-policies.txt
new file mode 100644
index 0000000..9d9ed9b
--- /dev/null
+++ b/test/policy-local-files/meta-invalid-policies.txt
@@ -0,0 +1,4 @@
+INVALID-policies/NO-FILE-EXISTS.json # non-existent policy file
+
+# missing policy name
+INVALID-policies/INVALID-Affinity_vCPE_1.json
diff --git a/test/policy-local-files/meta-valid-policies.txt b/test/policy-local-files/meta-valid-policies.txt
new file mode 100644
index 0000000..a0ce3fe
--- /dev/null
+++ b/test/policy-local-files/meta-valid-policies.txt
@@ -0,0 +1,12 @@
+Affinity_vCPE_1.json
+Capacity_vGMuxInfra.json
+Capacity_vG_1.json
+Distance_vGMuxInfra_1.json
+Distance_vG_1.json
+Min_Guarantee_vGMuxInfra_1.json
+Placement_Optimization_1.json
+QueryPolicy_vCPE.json
+hpa_policy_vGMuxInfra_1.json
+hpa_policy_vG_1.json
+vnfPolicy_vG.json
+vnfPolicy_vGMuxInfra.json
diff --git a/test/policy-local-files/vnfPolicy_vG.json b/test/policy-local-files/vnfPolicy_vG.json
new file mode 100644
index 0000000..ead038c
--- /dev/null
+++ b/test/policy-local-files/vnfPolicy_vG.json
@@ -0,0 +1,31 @@
+{
+ "service": "VnfPolicy",
+ "policyName": "oofBeijing.vnfPolicy_vG",
+ "description": "vnfPolicy",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "6",
+ "riskType": "test",
+ "riskLevel": "3",
+ "guard": "False",
+ "content": {
+ "identity": "vnf_vG",
+ "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vG"],
+ "policyType": "vnf_policy",
+ "resources": ["vG"],
+ "vnfProperties": [
+ {
+ "inventoryProvider": "aai",
+ "serviceType": "",
+ "inventoryType": "cloud",
+ "customerId": ""
+ },
+ {
+ "inventoryProvider": "multicloud",
+ "serviceType": "HNGATEWAY",
+ "inventoryType": "service",
+ "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77"
+ }
+ ]
+ }
+}
diff --git a/test/policy-local-files/vnfPolicy_vGMuxInfra.json b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
new file mode 100644
index 0000000..787563b
--- /dev/null
+++ b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
@@ -0,0 +1,31 @@
+{
+ "service": "VnfPolicy",
+ "policyName": "oofBeijing.vnfPolicy_vGMuxInfra",
+ "description": "vnfPolicy",
+ "templateVersion": "1702.03",
+ "version": "oofBeijing",
+ "priority": "6",
+ "riskType": "test",
+ "riskLevel": "3",
+ "guard": "False",
+ "content": {
+ "identity": "vnf_vGMuxInfra",
+ "policyScope": ["vCPE", "INTERNATIONAL", "ip", "vGMuxInfra"],
+ "policyType": "vnf_policy",
+ "resources": ["vGMuxInfra"],
+ "vnfProperties": [
+ {
+ "inventoryProvider": "aai",
+ "serviceType": "",
+ "inventoryType": "cloud",
+ "customerId": ""
+ },
+ {
+ "inventoryProvider": "multicloud",
+ "serviceType": "HNGATEWAY",
+ "inventoryType": "service",
+ "customerId": "21014aa2-526b-11e6-beb8-9e71128cae77"
+ }
+ ]
+ }
+}