From 12841887094196e6568b4932074d3e134854d7ec Mon Sep 17 00:00:00 2001 From: Hiroo Kitamura Date: Wed, 31 Mar 2021 14:34:39 +0900 Subject: [PATCH] Fix UT and FT VNFD yaml because lack of properties Since validation of VNFD is more strict, `target` attribute should be under `properties` for `tosca.policies.tacker.Scaling`, or failed to run unit and functional tests. This update is to correct VNFDs. This patch also updates version of heat-translator to the latest `2.3.0` in `requirements.txt` and `lower-constraints.txt` to ensure it uses the version for the change. Co-Authored-By: Yasufumi Ogawa Change-Id: Iae2b25abe53eda483e811171306d3d375a7e1687 Closes-Bug: #1921996 --- lower-constraints.txt | 2 +- requirements.txt | 2 +- samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml | 2 +- samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml | 2 +- tacker/tests/etc/samples/sample-tosca-alarm-scale.yaml | 2 +- tacker/tests/etc/samples/sample-tosca-scale-all.yaml | 2 +- .../etc/samples/sample-tosca-vnfd-instance-reservation.yaml | 2 +- tacker/tests/etc/samples/sample-tosca-vnfd-maintenance.yaml | 4 ++-- .../openstack/data/test_tosca_vnfd_alarm_scale.yaml | 2 +- .../infra_drivers/openstack/data/tosca_alarm_scale.yaml | 2 +- .../unit/vnfm/infra_drivers/openstack/data/tosca_scale.yaml | 2 +- tacker/tosca/lib/tacker_defs.yaml | 6 ++++++ 12 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 06f7a176f..dfedd5f83 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -160,5 +160,5 @@ wrapt==1.10.11 # but the latest revision from git repo for development. # If you install packages, comment out two lines of `install_package_gitrepo` in # `devstack/plugin.sh` in addition to activate following lines. -heat-translator==2.2.0 # Apache-2.0 +heat-translator==2.3.0 # Apache-2.0 tosca-parser==2.3.0 # Apache-2.0 diff --git a/requirements.txt b/requirements.txt index 7727198d3..b72a45715 100644 --- a/requirements.txt +++ b/requirements.txt @@ -60,5 +60,5 @@ glance-store>=2.4.0 # Apache-2.0 # but the latest revision from git repo for development. # If you install packages, comment out two lines of `install_package_gitrepo` in # `devstack/plugin.sh` in addition to activate following lines. -heat-translator>=2.2.0 # Apache-2.0 +heat-translator>=2.3.0 # Apache-2.0 tosca-parser>=2.3.0 # Apache-2.0 diff --git a/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml b/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml index 81f3a8a89..a7ba4133d 100644 --- a/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml +++ b/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml @@ -40,8 +40,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1] properties: + targets: [VDU1] increment: 1 cooldown: 120 min_instances: 1 diff --git a/samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml b/samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml index 10881f523..c749d9efa 100644 --- a/samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml +++ b/samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml @@ -56,8 +56,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1, VDU2] properties: + targets: [VDU1, VDU2] increment: 1 cooldown: 120 min_instances: 1 diff --git a/tacker/tests/etc/samples/sample-tosca-alarm-scale.yaml b/tacker/tests/etc/samples/sample-tosca-alarm-scale.yaml index 841e55984..513d243fb 100644 --- a/tacker/tests/etc/samples/sample-tosca-alarm-scale.yaml +++ b/tacker/tests/etc/samples/sample-tosca-alarm-scale.yaml @@ -40,8 +40,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1] properties: + targets: [VDU1] increment: 1 cooldown: 60 min_instances: 1 diff --git a/tacker/tests/etc/samples/sample-tosca-scale-all.yaml b/tacker/tests/etc/samples/sample-tosca-scale-all.yaml index f0f7bbfe9..86551de0c 100644 --- a/tacker/tests/etc/samples/sample-tosca-scale-all.yaml +++ b/tacker/tests/etc/samples/sample-tosca-scale-all.yaml @@ -41,8 +41,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1] properties: + targets: [VDU1] increment: 1 cooldown: 60 min_instances: 1 diff --git a/tacker/tests/etc/samples/sample-tosca-vnfd-instance-reservation.yaml b/tacker/tests/etc/samples/sample-tosca-vnfd-instance-reservation.yaml index 4c1de3c73..a35e4c264 100644 --- a/tacker/tests/etc/samples/sample-tosca-vnfd-instance-reservation.yaml +++ b/tacker/tests/etc/samples/sample-tosca-vnfd-instance-reservation.yaml @@ -87,4 +87,4 @@ topology_template: min_instances: 0 max_instances: 2 default_instances: 0 - targets: [VDU1] + targets: [VDU1] diff --git a/tacker/tests/etc/samples/sample-tosca-vnfd-maintenance.yaml b/tacker/tests/etc/samples/sample-tosca-vnfd-maintenance.yaml index e27a6dbc5..043185785 100644 --- a/tacker/tests/etc/samples/sample-tosca-vnfd-maintenance.yaml +++ b/tacker/tests/etc/samples/sample-tosca-vnfd-maintenance.yaml @@ -46,6 +46,6 @@ topology_template: increment: 1 max_instances: 3 min_instances: 1 - targets: - - VDU1 + targets: + - VDU1 type: tosca.policies.tacker.Scaling diff --git a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/test_tosca_vnfd_alarm_scale.yaml b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/test_tosca_vnfd_alarm_scale.yaml index ca628623a..2f02635c7 100644 --- a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/test_tosca_vnfd_alarm_scale.yaml +++ b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/test_tosca_vnfd_alarm_scale.yaml @@ -46,7 +46,7 @@ topology_template: min_instances: 1 max_instances: 3 default_instances: 2 - targets: [ VDU1 ] + targets: [ VDU1 ] - vdu1_cpu_usage_monitoring_policy: type: tosca.policies.tacker.Alarming diff --git a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_alarm_scale.yaml b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_alarm_scale.yaml index 0d61a751c..96dcb2b74 100644 --- a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_alarm_scale.yaml +++ b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_alarm_scale.yaml @@ -36,8 +36,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1] properties: + targets: [VDU1] increment: 1 cooldown: 60 min_instances: 1 diff --git a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_scale.yaml b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_scale.yaml index b89b7b5cb..e8318fd2f 100644 --- a/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_scale.yaml +++ b/tacker/tests/unit/vnfm/infra_drivers/openstack/data/tosca_scale.yaml @@ -35,8 +35,8 @@ topology_template: policies: - SP1: type: tosca.policies.tacker.Scaling - targets: [VDU1] properties: + targets: [VDU1] increment: 1 cooldown: 60 min_instances: 1 diff --git a/tacker/tosca/lib/tacker_defs.yaml b/tacker/tosca/lib/tacker_defs.yaml index 2d69c9769..d1a94fac6 100644 --- a/tacker/tosca/lib/tacker_defs.yaml +++ b/tacker/tosca/lib/tacker_defs.yaml @@ -330,6 +330,12 @@ policy_types: type: integer required: true description: Number of nodes to add or remove during the scale out/in. + targets: + type: list + entry_schema: + type: string + required: true + description: List of Scaling nodes. target_cpu_utilization_percentage: type: integer required: false