aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authordhebeha <dhebeha.mj71@wipro.com>2020-04-10 06:38:11 -0700
committerdhebeha <dhebeha.mj71@wipro.com>2020-04-17 00:07:46 -0700
commit2754404822b496392717d260681946debecf8648 (patch)
tree92b5930025f4655e67e26b37b728526fac6e9edc /test
parent16dec1253f5380df53ccfef97d618fbe03e7be64 (diff)
add aggregation policy for NSI selection
made changes for other policy updates Issue-ID: OPTFRA-730 Signed-off-by: dhebeha <dhebeha.mj71@wipro.com> Change-Id: I3fb4ae184cdae9181037fb059ac144070228c29f
Diffstat (limited to 'test')
-rw-r--r--test/apps/slice_selection/slice_policies.txt6
-rw-r--r--test/policy-local-files/Affinity_vCPE_1.json2
-rw-r--r--test/policy-local-files/Affinity_vFW_TD.json2
-rw-r--r--test/policy-local-files/Attribute_vNS_1.json2
-rw-r--r--test/policy-local-files/Capacity_vGMuxInfra.json2
-rw-r--r--test/policy-local-files/Capacity_vG_1.json2
-rw-r--r--test/policy-local-files/Distance_vGMuxInfra_1.json2
-rw-r--r--test/policy-local-files/Distance_vG_1.json2
-rw-r--r--test/policy-local-files/Placement_Optimization_1.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vCPE.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vCPE_2.json2
-rw-r--r--test/policy-local-files/QueryPolicy_vFW_TD.json2
-rw-r--r--test/policy-local-files/aggregationPolicy_URLLC_1.json37
-rw-r--r--test/policy-local-files/hpa_policy_vGMuxInfra_1.json2
-rw-r--r--test/policy-local-files/hpa_policy_vG_1.json2
-rw-r--r--test/policy-local-files/queryPolicy_URLLC_.json29
-rw-r--r--test/policy-local-files/subscriber_policy_URLLC_1.json12
-rw-r--r--test/policy-local-files/subscriber_policy_vCPE.json2
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1.json41
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json32
-rw-r--r--test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json32
-rw-r--r--test/policy-local-files/vnfPolicy_URLLC_Core_1.json6
-rw-r--r--test/policy-local-files/vnfPolicy_vFW_TD.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vG.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vGMuxInfra.json2
-rw-r--r--test/policy-local-files/vnfPolicy_vPGN_TD.json2
-rw-r--r--test/test_PolicyCalls.py2
27 files changed, 135 insertions, 98 deletions
diff --git a/test/apps/slice_selection/slice_policies.txt b/test/apps/slice_selection/slice_policies.txt
index e4ccb65..55c934b 100644
--- a/test/apps/slice_selection/slice_policies.txt
+++ b/test/apps/slice_selection/slice_policies.txt
@@ -1,4 +1,4 @@
subscriber_policy_URLLC_1.json
-thresholdPolicy_URLLC_Core_1_latency.json
-thresholdPolicy_URLLC_Core_1_reliability.json
-vnfPolicy_URLLC_Core_1.json \ No newline at end of file
+thresholdPolicy_URLLC_Core_1.json
+vnfPolicy_URLLC_Core_1.json
+aggregationPolicy_URLLC_1.json
diff --git a/test/policy-local-files/Affinity_vCPE_1.json b/test/policy-local-files/Affinity_vCPE_1.json
index 4f111eb..5364d5d 100644
--- a/test/policy-local-files/Affinity_vCPE_1.json
+++ b/test/policy-local-files/Affinity_vCPE_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Affinity_vCPE_1": {
- "type": "onap.policies.optimization.AffinityPolicy",
+ "type": "onap.policies.optimization.resource.AffinityPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Affinity_vFW_TD.json b/test/policy-local-files/Affinity_vFW_TD.json
index 53bb31b..5df3bf4 100644
--- a/test/policy-local-files/Affinity_vFW_TD.json
+++ b/test/policy-local-files/Affinity_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Affinity_vFW_TD": {
- "type": "onap.policies.optimization.AffinityPolicy",
+ "type": "onap.policies.optimization.resource.AffinityPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Attribute_vNS_1.json b/test/policy-local-files/Attribute_vNS_1.json
index 35b3c74..97c967c 100644
--- a/test/policy-local-files/Attribute_vNS_1.json
+++ b/test/policy-local-files/Attribute_vNS_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Attribute_vNS_1": {
- "type": "onap.policies.optimization.AttributePolicy",
+ "type": "onap.policies.optimization.resource.AttributePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Capacity_vGMuxInfra.json b/test/policy-local-files/Capacity_vGMuxInfra.json
index 1d6d26d..7ce02bf 100644
--- a/test/policy-local-files/Capacity_vGMuxInfra.json
+++ b/test/policy-local-files/Capacity_vGMuxInfra.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Capacity_vGMuxInfra": {
- "type": "onap.policies.optimization.Vim_fit",
+ "type": "onap.policies.optimization.resource.Vim_fit",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Capacity_vG_1.json b/test/policy-local-files/Capacity_vG_1.json
index f07e7bc..c897a87 100644
--- a/test/policy-local-files/Capacity_vG_1.json
+++ b/test/policy-local-files/Capacity_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Capacity_vG_1": {
- "type": "onap.policies.optimization.Vim_fit",
+ "type": "onap.policies.optimization.resource.Vim_fit",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Distance_vGMuxInfra_1.json b/test/policy-local-files/Distance_vGMuxInfra_1.json
index 7de102e..163d0df 100644
--- a/test/policy-local-files/Distance_vGMuxInfra_1.json
+++ b/test/policy-local-files/Distance_vGMuxInfra_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Distance_vGMuxInfra": {
- "type": "onap.policies.optimization.DistancePolicy",
+ "type": "onap.policies.optimization.resource.DistancePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Distance_vG_1.json b/test/policy-local-files/Distance_vG_1.json
index dcb45b2..aa6badc 100644
--- a/test/policy-local-files/Distance_vG_1.json
+++ b/test/policy-local-files/Distance_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Distance_vG_1": {
- "type": "onap.policies.optimization.DistancePolicy",
+ "type": "onap.policies.optimization.resource.DistancePolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/Placement_Optimization_1.json b/test/policy-local-files/Placement_Optimization_1.json
index b3efa64..62b024c 100644
--- a/test/policy-local-files/Placement_Optimization_1.json
+++ b/test/policy-local-files/Placement_Optimization_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.Placement_optimization_1": {
- "type": "onap.policies.optimization.OptimizationPolicy",
+ "type": "onap.policies.optimization.resource.OptimizationPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vCPE.json b/test/policy-local-files/QueryPolicy_vCPE.json
index 1a8d205..3bcc67e 100644
--- a/test/policy-local-files/QueryPolicy_vCPE.json
+++ b/test/policy-local-files/QueryPolicy_vCPE.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vCPE": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vCPE_2.json b/test/policy-local-files/QueryPolicy_vCPE_2.json
index 7a4d227..3d9f4ca 100644
--- a/test/policy-local-files/QueryPolicy_vCPE_2.json
+++ b/test/policy-local-files/QueryPolicy_vCPE_2.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vCPE": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/QueryPolicy_vFW_TD.json b/test/policy-local-files/QueryPolicy_vFW_TD.json
index 1a6eb21..ab199ac 100644
--- a/test/policy-local-files/QueryPolicy_vFW_TD.json
+++ b/test/policy-local-files/QueryPolicy_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.queryPolicy_vFW_TD": {
- "type": "onap.policies.optimization.QueryPolicy",
+ "type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/aggregationPolicy_URLLC_1.json b/test/policy-local-files/aggregationPolicy_URLLC_1.json
new file mode 100644
index 0000000..13014c1
--- /dev/null
+++ b/test/policy-local-files/aggregationPolicy_URLLC_1.json
@@ -0,0 +1,37 @@
+{
+ "OSDF_FRANKFURT.Aggregation_URLLC_1":{
+ "type":"onap.policies.optimization.resource.AggregationPolicy",
+ "version":"1.0.0",
+ "type_version":"1.0.0",
+ "metadata":{
+ "policy-id":"OSDF_FRANKFURT.Aggregation_URLLC_1",
+ "policy-version":1
+ },
+ "properties":{
+ "scope":[
+ "OSDF_FRANKFURT",
+ "URLLC_1"
+ ],
+ "geography": [],
+ "resources":[
+ "URLLC_Core_1"
+ ],
+ "services":[
+ "URLLC_1"
+ ],
+ "identity":"Aggregation_URLLC_1",
+ "applicableResources":"any",
+ "aggregationProperties":[
+ {
+ "attribute":"latency",
+ "function":"sum",
+ "operator":"lte",
+ "threshold":{
+ "get_param": "latency"
+ },
+ "unit":"ms"
+ }
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
index c233c5f..b6317f8 100644
--- a/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
+++ b/test/policy-local-files/hpa_policy_vGMuxInfra_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.hpa_policy_vGMuxInfra_1": {
- "type": "onap.policies.optimization.HpaPolicy",
+ "type": "onap.policies.optimization.resource.HpaPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/hpa_policy_vG_1.json b/test/policy-local-files/hpa_policy_vG_1.json
index 4f9a7b4..59ba4b1 100644
--- a/test/policy-local-files/hpa_policy_vG_1.json
+++ b/test/policy-local-files/hpa_policy_vG_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.hpa_policy_vG_1": {
- "type": "onap.policies.optimization.HpaPolicy",
+ "type": "onap.policies.optimization.resource.HpaPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/queryPolicy_URLLC_.json b/test/policy-local-files/queryPolicy_URLLC_.json
new file mode 100644
index 0000000..3114234
--- /dev/null
+++ b/test/policy-local-files/queryPolicy_URLLC_.json
@@ -0,0 +1,29 @@
+{
+ "OSDF_FRANKFURT.queryPolicy_URLLC_1": {
+ "type": "onap.policies.optimization.service.QueryPolicy",
+ "version": "1.0.0",
+ "type_version": "1.0.0",
+ "metadata": {
+ "policy-id": "OSDF_FRANKFURT.queryPolicy_URLLC_1",
+ "policy-version": 1
+ },
+ "properties": {
+ "scope": [
+ "OSDF_FRANKFURT"
+ ],
+ "services": [
+ "URLLC_1"
+ ],
+ "geography": [
+ "US"
+ ],
+ "identity": "queryPolicy_URLLC_1",
+ "queryProperties": [
+ {
+ "attribute": "latency",
+ "attribute_location": "latency"
+ }
+ ]
+ }
+ }
+}
diff --git a/test/policy-local-files/subscriber_policy_URLLC_1.json b/test/policy-local-files/subscriber_policy_URLLC_1.json
index ffa4d79..d147273 100644
--- a/test/policy-local-files/subscriber_policy_URLLC_1.json
+++ b/test/policy-local-files/subscriber_policy_URLLC_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.SubscriberPolicy_URLLC_1": {
- "type": "onap.policies.optimization.SubscriberPolicy",
+ "type": "onap.policies.optimization.service.SubscriberPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
@@ -19,16 +19,8 @@
"properties": {
"subscriberName": [
"URLLC_Core_1"
- ],
- "subscriberRole": [
- {
- "URLLC_Core_1": {
- "modelInvariantId": "21d57d4b-52ad-4d3c-a798-248b5bb9124a",
- "modelVersionId": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22"
- }
- }
]
- }
}
}
}
+}
diff --git a/test/policy-local-files/subscriber_policy_vCPE.json b/test/policy-local-files/subscriber_policy_vCPE.json
index 305ce58..c02d8d6 100644
--- a/test/policy-local-files/subscriber_policy_vCPE.json
+++ b/test/policy-local-files/subscriber_policy_vCPE.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.SubscriberPolicy_v1": {
- "type": "onap.policies.optimization.SubscriberPolicy",
+ "type": "onap.policies.optimization.service.SubscriberPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json
new file mode 100644
index 0000000..6c602ee
--- /dev/null
+++ b/test/policy-local-files/thresholdPolicy_URLLC_Core_1.json
@@ -0,0 +1,41 @@
+{
+ "OSDF_FRANKFURT.Threshold_URLLC_Core_1":{
+ "type":"onap.policies.optimization.resource.ThresholdPolicy",
+ "version":"1.0.0",
+ "type_version":"1.0.0",
+ "metadata":{
+ "policy-id":"OSDF_FRANKFURT.Threshold_URLLC_Core_1",
+ "policy-version":1
+ },
+ "properties":{
+ "scope":[
+ "OSDF_FRANKFURT",
+ "URLLC_1",
+ "URLLC_Core_1"
+ ],
+ "resources":[
+ "URLLC_Core_1"
+ ],
+ "services":[
+ "URLLC_1"
+ ],
+ "geography": [],
+ "identity":"Threshold_URLLC_Core_1",
+ "thresholdProperties":[
+ {
+ "attribute":"latency",
+ "operator":"lte",
+ "threshold":5,
+ "unit":"ms"
+ },
+ {
+ "attribute":"reliability",
+ "operator":"gte",
+ "threshold":99.999,
+ "unit":""
+ }
+
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json
deleted file mode 100644
index 35106f6..0000000
--- a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_latency.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "OSDF_FRANKFURT.Threshold_URLLC_Core_1": {
- "type": "onap.policies.optimization.ThresholdPolicy",
- "version": "1.0.0",
- "type_version": "1.0.0",
- "metadata": {
- "policy-id": "OSDF_FRANKFURT.Threshold_URLLC_Core_1_latency",
- "policy-version": 1
- },
- "properties": {
- "scope": [
- "OSDF_FRANKFURT",
- "URLLC_1",
- "URLLC_Core_1"
- ],
- "resources": [
- "URLLC_Core_1"
- ],
- "services": [
- "URLLC_1"
- ],
- "identity": "Threshold_URLLC_Core_1_latency",
- "applicableResources": "any",
- "thresholdProperty": {
- "attribute": "latency",
- "operator": "lte",
- "threshold": 5,
- "unit": "ms"
- }
- }
- }
-} \ No newline at end of file
diff --git a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json b/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json
deleted file mode 100644
index 56089f0..0000000
--- a/test/policy-local-files/thresholdPolicy_URLLC_Core_1_reliability.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "OSDF_FRANKFURT.Threshold_URLLC_Core_1": {
- "type": "onap.policies.optimization.ThresholdPolicy",
- "version": "1.0.0",
- "type_version": "1.0.0",
- "metadata": {
- "policy-id": "OSDF_FRANKFURT.Threshold_URLLC_Core_1_reliability",
- "policy-version": 1
- },
- "properties": {
- "scope": [
- "OSDF_FRANKFURT",
- "URLLC_1",
- "URLLC_Core_1"
- ],
- "resources": [
- "URLLC_Core_1"
- ],
- "services": [
- "URLLC_1"
- ],
- "identity": "Threshold_URLLC_Core_1_reliability",
- "applicableResources": "any",
- "thresholdProperty": {
- "attribute":"reliability",
- "operator":"gte",
- "threshold":99.999,
- "unit":""
- }
- }
- }
-} \ No newline at end of file
diff --git a/test/policy-local-files/vnfPolicy_URLLC_Core_1.json b/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
index 6582c17..0fa69fa 100644
--- a/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
+++ b/test/policy-local-files/vnfPolicy_URLLC_Core_1.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_URLLC_Core_1": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
@@ -28,7 +28,9 @@
"region": "RegionOne",
"attributes": {
"orchestrationStatus": "active",
- "service-role": "nssi"
+ "service-role": "nssi",
+ "modelInvariantId":"bfbg3636-e39c-iidd-0987-27c28f4oo3",
+ "modelVersionId":"bfbg3636-e39c-iidd-0987-27c28f4d33"
}
}
]
diff --git a/test/policy-local-files/vnfPolicy_vFW_TD.json b/test/policy-local-files/vnfPolicy_vFW_TD.json
index 387ed56..e63e2c2 100644
--- a/test/policy-local-files/vnfPolicy_vFW_TD.json
+++ b/test/policy-local-files/vnfPolicy_vFW_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vFW_TD": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vG.json b/test/policy-local-files/vnfPolicy_vG.json
index 786ffc2..2dea670 100644
--- a/test/policy-local-files/vnfPolicy_vG.json
+++ b/test/policy-local-files/vnfPolicy_vG.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vG": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vGMuxInfra.json b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
index deb34fd..65475a9 100644
--- a/test/policy-local-files/vnfPolicy_vGMuxInfra.json
+++ b/test/policy-local-files/vnfPolicy_vGMuxInfra.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vGMuxInfra": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/policy-local-files/vnfPolicy_vPGN_TD.json b/test/policy-local-files/vnfPolicy_vPGN_TD.json
index c441156..077901a 100644
--- a/test/policy-local-files/vnfPolicy_vPGN_TD.json
+++ b/test/policy-local-files/vnfPolicy_vPGN_TD.json
@@ -1,6 +1,6 @@
{
"OSDF_FRANKFURT.vnfPolicy_vPGN_TD": {
- "type": "onap.policies.optimization.VnfPolicy",
+ "type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
diff --git a/test/test_PolicyCalls.py b/test/test_PolicyCalls.py
index c41c487..d4dc37f 100644
--- a/test/test_PolicyCalls.py
+++ b/test/test_PolicyCalls.py
@@ -101,7 +101,7 @@ class TestPolicyCalls(unittest.TestCase):
req_json = json.loads(open(req_json).read())
# need to run this only on vnf policies
vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] ==
- "onap.policies.optimization.VnfPolicy"]
+ "onap.policies.optimization.resource.VnfPolicy"]
gen_demands = translation.gen_demands(req_json['placementInfo']['placementDemands'], vnf_policies)
for action in req_json['placementInfo']['placementDemands']: