From 1bf858e215f8d0b8cf074bffc81d1c3d1a03fd52 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 20 Jun 2019 10:09:21 -0400 Subject: Set timeout to CL timeout if zero Modified the rules to set the operational timeout to the overall CL timeout if the operational timeout is zero. Added code to check for zero timeout for the overall CL, too. Change-Id: I28d41632f59e9bc2fce953267883d567abc92a49 Issue-ID: POLICY-1859 Signed-off-by: Jim Hahn --- .../src/test/resources/test-null-timeout.yaml | 37 +++++++++++++++++++++ .../src/test/resources/test-zero-timeout.yaml | 38 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 controlloop/common/eventmanager/src/test/resources/test-null-timeout.yaml create mode 100644 controlloop/common/eventmanager/src/test/resources/test-zero-timeout.yaml (limited to 'controlloop/common/eventmanager/src/test/resources') diff --git a/controlloop/common/eventmanager/src/test/resources/test-null-timeout.yaml b/controlloop/common/eventmanager/src/test/resources/test-null-timeout.yaml new file mode 100644 index 000000000..dae704536 --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/test-null-timeout.yaml @@ -0,0 +1,37 @@ +# Copyright 2019 AT&T Intellectual Property. All rights reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +controlLoop: + version: 1.0.0 + controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda + services: + - serviceName: service1 + resources: + - resourceName: resource1 + resourceType: VF + trigger_policy: unique-policy-id-3-migrate + +policies: + - id: unique-policy-id-3-migrate + name: Migrate Policy + description: + actor: APPC + recipe: Migrate + target: VM + retry: 0 + timeout: 30 + success: final_success + failure: final_failure + failure_timeout: final_failure_timeout + failure_retries: final_failure_retries + failure_exception: final_failure_exception diff --git a/controlloop/common/eventmanager/src/test/resources/test-zero-timeout.yaml b/controlloop/common/eventmanager/src/test/resources/test-zero-timeout.yaml new file mode 100644 index 000000000..b85dee672 --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/test-zero-timeout.yaml @@ -0,0 +1,38 @@ +# Copyright 2019 AT&T Intellectual Property. All rights reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +controlLoop: + version: 1.0.0 + controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda + services: + - serviceName: service1 + resources: + - resourceName: resource1 + resourceType: VF + trigger_policy: unique-policy-id-3-migrate + timeout: 0 + +policies: + - id: unique-policy-id-3-migrate + name: Migrate Policy + description: + actor: APPC + recipe: Migrate + target: VM + retry: 0 + timeout: 30 + success: final_success + failure: final_failure + failure_timeout: final_failure_timeout + failure_retries: final_failure_retries + failure_exception: final_failure_exception -- cgit 1.2.3-korg