Add ACM regression test suite
[policy/docker.git] / policy-regression-tests / policy-clamp-regression / src / test / resources / features / acm-migration-workflow.feature
1 Feature: ACM migration workflow
2   # Verifies ACM migration of instance from one AC definition to another
3
4   Scenario: ACM Health check should be up
5     When the acm health check endpoint is invoked "/onap/policy/clamp/acm/health"
6     Then the response status code should be 200
7
8   Scenario Outline: Verify the ACM commissioning works
9     When the ACM commissioning endpoint "/onap/policy/clamp/acm/v2/compositions" is invoked with "<AcDefinitionFile>" "<isMigration>"
10     Then the response status code should be 201
11     Examples:
12       | AcDefinitionFile                                                   | isMigration |
13       | src/test/resources/data/acelement-usecase2.json  | false       |
14
15   Scenario: Make sure the participants are registered with runtime
16     When the register participants endpoint is invoked "/onap/policy/clamp/acm/v2/participants"
17     Then the response status code should be 202
18
19   Scenario Outline: Verify the priming is accepted
20     When the ACM participants are primed "/onap/policy/clamp/acm/v2/compositions/{compositionId}" "<isMigration>"
21     Then the response status code should be 202
22     Examples:
23       | isMigration |
24       | false        |
25
26   Scenario Outline: Wait until all the participants are primed
27     When the ACM composition is fetched "/onap/policy/clamp/acm/v2/compositions/{compositionId}"
28     Then the response status code should be 200
29     Then Wait and retry until the response contains the keyword "PRIMED" "/onap/policy/clamp/acm/v2/compositions/{compositionId}" "<isMigration>"
30     Examples:
31       | isMigration |
32       | false        |
33
34   Scenario Outline: Verify AC Instantiation works
35     When the ACM instance is created "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances" with "<AcInstantiateFile>"
36     Then the response status code should be 201
37     Examples:
38       | AcInstantiateFile                                             |
39       | src/test/resources/data/AcInstantiate.json  |
40
41   Scenario: Verify the AC deployment is accepted
42     When the AC instance is deployed "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances/{instanceId}"
43     Then the response status code should be 202
44
45   Scenario Outline: Wait until all the AC elements are deployed
46     When the AC instance is fetched "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances/{instanceId}" "<isMigration>"
47     Then the response status code should be 200
48     Then Wait and retry until the response contains the keyword "DEPLOYED" "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances/{instanceId}" "<isMigration>"
49     Examples:
50       | isMigration |
51       | false        |
52
53   Scenario Outline: Commission the AC definition file for migration
54     When the ACM commissioning endpoint "/onap/policy/clamp/acm/v2/compositions" is invoked with "<AcDefinitionFile>" "<isMigration>"
55     Then the response status code should be 201
56     Examples:
57       | AcDefinitionFile                                                   | isMigration |
58       | src/test/resources/data/acelement-usecase2.json  | true        |
59
60   Scenario Outline: Prime the second AC definition to the participants
61     When the ACM participants are primed "/onap/policy/clamp/acm/v2/compositions/{compositionId}" "<isMigration>"
62     Then the response status code should be 202
63     Examples:
64       | isMigration |
65       | true        |
66
67   Scenario Outline: Wait until all the participants are primed
68     When the ACM composition is fetched "/onap/policy/clamp/acm/v2/compositions/{compositionId}"
69     Then the response status code should be 200
70     Then Wait and retry until the response contains the keyword "PRIMED" "/onap/policy/clamp/acm/v2/compositions/{compositionId}" "<isMigration>"
71     Examples:
72       | isMigration |
73       | true        |
74
75   Scenario Outline: Migrate the existing instance to the new AC definition
76     When the ACM instance is migrated "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances" with "<AcMigrationFile>"
77     Then the response status code should be 200
78     Examples:
79       | AcMigrationFile                                                   |
80       | src/test/resources/data/AcMigrateInstance.json  |
81
82   Scenario Outline: Wait until all the AC elements are migrated
83     When the AC instance is fetched "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances/{instanceId}" "<isMigration>"
84     Then the response status code should be 200
85     Then Wait and retry until the response contains the keyword "DEPLOYED" "/onap/policy/clamp/acm/v2/compositions/{compositionId}/instances/{instanceId}" "<isMigration>"
86     Examples:
87       | isMigration |
88       | true        |