diff options
author | Jim Hahn <jrh3@att.com> | 2020-03-09 15:15:05 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-03-12 12:12:48 -0400 |
commit | aa8225b5211485b3c1150c21e51fd3e93b7f31d3 (patch) | |
tree | 922b78d2c8a4c657d4c32604a0b73df40d2fb330 /controlloop/common/rules-test/src/main/resources/service123 | |
parent | 0e658768fc0573bf6acf7f849a49c9da98c8e47f (diff) |
Retool rules tests
Extracted common code from various XxxBaseTest classes into:
- Topics class to manage messages for test topics
- HttpClients class to manage HttpClient objects for tests
- Simulators class to manage simulators for tests
- Rules class to manage start up and shutdown of rules
Merged remaining code from XxxBaseTest classes into a single
class. Modified the Frankfurt and Usescases tests to subclass
from this new class and specify just the relevant tests to be
executed.
Issue-ID: POLICY-2385
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Iaf83c9d2b205a4c343e0dde23ec86508f5773693
Diffstat (limited to 'controlloop/common/rules-test/src/main/resources/service123')
5 files changed, 158 insertions, 0 deletions
diff --git a/controlloop/common/rules-test/src/main/resources/service123/service123.appc.migrate.success.json b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.migrate.success.json new file mode 100644 index 000000000..563e2c762 --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.migrate.success.json @@ -0,0 +1,22 @@ +{ + "body": { + "output": { + "common-header": { + "timestamp": "2017-08-25T21:06:23.037Z", + "api-ver": "5.00", + "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "request-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "sub-request-id": "${replaceMe}", + "flags": {} + }, + "status": { + "code": 400, + "message": "Migrate Successful" + } + } + }, + "version": "2.0", + "rpc-name": "migrate", + "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-1", + "type": "response" +} diff --git a/controlloop/common/rules-test/src/main/resources/service123/service123.appc.rebuild.failure.json b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.rebuild.failure.json new file mode 100644 index 000000000..88e70ef7a --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.rebuild.failure.json @@ -0,0 +1,22 @@ +{ + "body": { + "output": { + "common-header": { + "timestamp": "2017-08-25T21:06:23.037Z", + "api-ver": "5.00", + "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "request-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "sub-request-id": "${replaceMe}", + "flags": {} + }, + "status": { + "code": 401, + "message": "Rebuild Failed" + } + } + }, + "version": "2.0", + "rpc-name": "rebuild", + "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-1", + "type": "response" +} diff --git a/controlloop/common/rules-test/src/main/resources/service123/service123.appc.restart.failure.json b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.restart.failure.json new file mode 100644 index 000000000..7376c8ad3 --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/service123/service123.appc.restart.failure.json @@ -0,0 +1,22 @@ +{ + "body": { + "output": { + "common-header": { + "timestamp": "2017-08-25T21:06:23.037Z", + "api-ver": "5.00", + "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "request-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "sub-request-id": "${replaceMe}", + "flags": {} + }, + "status": { + "code": 401, + "message": "Restart Failed" + } + } + }, + "version": "2.0", + "rpc-name": "restart", + "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-1", + "type": "response" +} diff --git a/controlloop/common/rules-test/src/main/resources/service123/service123.onset.json b/controlloop/common/rules-test/src/main/resources/service123/service123.onset.json new file mode 100644 index 000000000..a78cb5337 --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/service123/service123.onset.json @@ -0,0 +1,17 @@ +{ + "closedLoopControlName": "ControlLoop-Service123-cbed919f-2212-4ef7-8051-fe6308da1bda", + "closedLoopAlarmStart": 1463679805324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "664be3d2-6c12-4f4b-a3e7-c349acced200", + "target_type": "VNF", + "target": "generic-vnf.vnf-name", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "vserver.prov-status": "ACTIVE", + "generic-vnf.vnf-name": "fw0002vm002fw002", + "vserver.vserver-name": "OzVServer" + }, + "from": "DCAE", + "version": "1.0.2" +} diff --git a/controlloop/common/rules-test/src/main/resources/service123/tosca-compliant-service123.json b/controlloop/common/rules-test/src/main/resources/service123/tosca-compliant-service123.json new file mode 100644 index 000000000..4eaa9e70a --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/service123/tosca-compliant-service123.json @@ -0,0 +1,75 @@ +{ + "type": "onap.policies.controlloop.operational.common.Drools", + "type_version": "1.0.0", + "version": "1.0.0", + "name": "operational.service123", + "metadata": { + "policy-id": "operational.service123" + }, + "properties": { + "controllerName": "usecases", + "id": "ControlLoop-Service123-cbed919f-2212-4ef7-8051-fe6308da1bda", + "timeout": 60, + "abatement": true, + "trigger": "unique-policy-id-1-restart", + "operations": [ + { + "id": "unique-policy-id-1-restart", + "description": "Restart the VM", + "operation": { + "actor": "APPC", + "operation": "Restart", + "target": { + "targetType": "VM" + } + }, + "timeout": 20, + "retries": 3, + "success": "final_success", + "failure": "unique-policy-id-2-rebuild", + "failure_timeout": "unique-policy-id-2-rebuild", + "failure_retries": "unique-policy-id-2-rebuild", + "failure_guard": "unique-policy-id-2-rebuild", + "failure_exception": "final_failure_exception" + }, + { + "id": "unique-policy-id-2-rebuild", + "name": "Rebuild Policy", + "operation": { + "actor": "APPC", + "operation": "Rebuild", + "target": { + "targetType": "VM" + } + }, + "timeout": 10, + "retries": 0, + "success": "final_success", + "failure": "unique-policy-id-3-migrate", + "failure_timeout": "unique-policy-id-3-migrate", + "failure_retries": "unique-policy-id-3-migrate", + "failure_guard": "unique-policy-id-3-migrate", + "failure_exception": "final_failure_exception" + }, + { + "id": "unique-policy-id-3-migrate", + "name": "Migrate Policy", + "operation": { + "actor": "APPC", + "operation": "Migrate", + "target": { + "targetType": "VM" + } + }, + "timeout": 30, + "retries": 0, + "success": "final_success", + "failure": "final_failure", + "failure_timeout": "final_failure_timeout", + "failure_retries": "final_failure_retries", + "failure_guard": "final_failure_guard", + "failure_exception": "final_failure_exception" + } + ] + } +} |