From 6c72ec89f54bce0741350d3f299c5b441b4f60cc Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 7 Nov 2018 13:44:21 -0500 Subject: Close timing loop-hole when YAML updated Noticed when YAML updates are pushed close together that some Params objects are deleted that should not be. Fixed that by eliminating the "active" list concept and only deleting a Params object that has an associated cleaner. If it has no cleaner, then it can't be deleted, regardless of timing with rule updates. Added more tests for rule updates, including cases to check for event objects being retracted, as well as Params objects being retracted when rules are deleted. Change-Id: I6b744b29fca228022f43e9322ea149b16d097675 Issue-ID: POLICY-1248 Signed-off-by: Jim Hahn --- .../policy_ControlLoop_EventCleanup-test-B.yaml | 41 ++++++++++++++++++++ .../yaml/policy_ControlLoop_EventCleanup-test.yaml | 41 ++++++++++++++++++++ .../policy_ControlLoop_EventCleanup-test2.yaml | 45 ++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml create mode 100644 controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml create mode 100644 controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml (limited to 'controlloop/templates/template.demo.clc/src/test/resources') diff --git a/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml new file mode 100644 index 000000000..498ef766e --- /dev/null +++ b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml @@ -0,0 +1,41 @@ +# Copyright 2018 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: 2.0.0 + controlLoopName: ControlLoop-Event-Cleanup-Test-B + services: + - serviceInvariantUUID: 5cfe6f4a-41bc-4247-8674-ebd4b98e35cc + serviceUUID: 0f40bba5-986e-4b3c-803f-ddd1b7b25f24 + serviceName: 57e66ea7-0ed6-45c7-970f + trigger_policy: unique-policy-id-1-modifyConfig + timeout: 60 + abatement: true + +policies: + - id: unique-policy-id-1-modifyConfig + name: modify packet gen config + description: + actor: APPC + recipe: ModifyConfig + target: + resourceID: Eace933104d443b496b8.nodes.heat.vpg + type: VNF + 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 + failure_guard: final_failure_guard \ No newline at end of file diff --git a/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml new file mode 100644 index 000000000..a19b0ef6b --- /dev/null +++ b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml @@ -0,0 +1,41 @@ +# Copyright 2018 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: 2.0.0 + controlLoopName: ControlLoop-Event-Cleanup-Test + services: + - serviceInvariantUUID: 5cfe6f4a-41bc-4247-8674-ebd4b98e35cc + serviceUUID: 0f40bba5-986e-4b3c-803f-ddd1b7b25f24 + serviceName: 57e66ea7-0ed6-45c7-970f + trigger_policy: unique-policy-id-1-modifyConfig + timeout: 60 + abatement: true + +policies: + - id: unique-policy-id-1-modifyConfig + name: modify packet gen config + description: + actor: APPC + recipe: ModifyConfig + target: + resourceID: Eace933104d443b496b8.nodes.heat.vpg + type: VNF + 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 + failure_guard: final_failure_guard \ No newline at end of file diff --git a/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml new file mode 100644 index 000000000..57062a47a --- /dev/null +++ b/controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml @@ -0,0 +1,45 @@ +# Copyright 2018 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. + +# +# This YAML must be slightly different from test.yaml. +# +controlLoop: + version: 3.0.0 + controlLoopName: ControlLoop-Event-Cleanup-Test + services: + - serviceInvariantUUID: 5cfe6f4a-41bc-4247-8674-ebd4b98e35cc + serviceUUID: 0f40bba5-986e-4b3c-803f-ddd1b7b25f24 + serviceName: 57e66ea7-0ed6-45c7-970f + trigger_policy: unique-policy-id-1-modifyConfig + timeout: 60 + abatement: true + +policies: + - id: unique-policy-id-1-modifyConfig + name: modify packet gen config + description: + actor: APPC + recipe: ModifyConfig + target: + resourceID: Eace933104d443b496b8.nodes.heat.vpg + type: VNF + 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 + failure_guard: final_failure_guard \ No newline at end of file -- cgit 1.2.3-korg