From: rameshiyer27 Date: Fri, 24 Oct 2025 15:10:52 +0000 (+0100) Subject: Add scenario in Migration tests for new participant type X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F142320%2F1;p=policy%2Fdocker.git Add scenario in Migration tests for new participant type Issue-ID: POLICY-5463 Signed-off-by: rameshiyer27 Change-Id: Ie936af2f843954b2236ba5717d23022d15705359 --- diff --git a/compose/compose.acm.scale.yml b/compose/compose.acm.scale.yml index 7cea86fa..2a868fde 100644 --- a/compose/compose.acm.scale.yml +++ b/compose/compose.acm.scale.yml @@ -32,6 +32,7 @@ services: - policy-clamp-ac-pf-ppnt - policy-clamp-ac-sim-ppnt-1 - policy-clamp-ac-sim-ppnt-2 + - policy-clamp-ac-sim-ppnt-3 expose: - 6969 deploy: diff --git a/compose/compose.common.yml b/compose/compose.common.yml index 757bb1c2..8836f86f 100644 --- a/compose/compose.common.yml +++ b/compose/compose.common.yml @@ -99,6 +99,35 @@ services: 'kafka', '9092' ] + policy-clamp-ac-sim-ppnt-3: + image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-sim-ppnt:${POLICY_CLAMP_PPNT_VERSION} + container_name: policy-clamp-ac-sim-ppnt-3 + hostname: policy-clamp-ac-sim-ppnt-3 + depends_on: + - kafka + - jaeger + environment: + OTEL_SERVICE_NAME: sim-ppnt-3 + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf + OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318 + SPRING_PROFILES_ACTIVE: ${PPNT_PROFILE:-default} + JAVA_TOOL_OPTIONS: >- + -Dlogging.config="/opt/app/policy/clamp/etc/logback.xml" + -Dotel.java.global-autoconfigure.enabled=true + spring.config.location: /opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml + ports: + - ${SIM_PARTICIPANT3_PORT}:6969 + volumes: + - ./config/clamp/SimulatorParticipant3Parameters.yaml:/opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml:ro + - ./config/clamp/logback-ppnt.xml:/opt/app/policy/clamp/etc/logback.xml:ro + - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro + entrypoint: /opt/app/policy/bin/wait_for_port.sh + command: [ + '-c', 'java -jar /app/app.jar', + 'kafka', '9092' + ] + # metrics services: prometheus: image: nexus3.onap.org:10001/prom/prometheus:latest diff --git a/compose/config/clamp/SimulatorParticipant3Parameters.yaml b/compose/config/clamp/SimulatorParticipant3Parameters.yaml new file mode 100644 index 00000000..80ce7357 --- /dev/null +++ b/compose/config/clamp/SimulatorParticipant3Parameters.yaml @@ -0,0 +1,106 @@ +spring: + application: + name: sim-ppnt-3 + security: + user: + name: participantUser + password: zb!XztG34 + autoconfigure: + exclude: + - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration + - org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration + - org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration + +security: + enable-csrf: false +participant: + intermediaryParameters: + reportingTimeIntervalMs: 120000 + description: Participant Description + participantId: ${participantId:101c62b3-8918-41b9-a747-d21eb79c6c92} + topics: + operationTopic: policy-acruntime-participant + syncTopic: acm-ppnt-sync + clampAutomationCompositionTopics: + topicSources: + - topic: ${participant.intermediaryParameters.topics.operationTopic} + servers: + - ${topicServer:kafka:9092} + topicCommInfrastructure: kafka + fetchTimeout: 15000 + useHttps: false + allowTracing: true + additionalProps: + group.id: policy-clamp-ac-sim-ppnt-3 + - topic: ${participant.intermediaryParameters.topics.syncTopic} + servers: + - ${topicServer:kafka:9092} + topicCommInfrastructure: kafka + fetchTimeout: 15000 + useHttps: false + allowTracing: true + topicSinks: + - topic: ${participant.intermediaryParameters.topics.operationTopic} + servers: + - ${topicServer:kafka:9092} + topicCommInfrastructure: kafka + useHttps: false + allowTracing: true + participantSupportedElementTypes: + - + typeName: ${supportedElementTypeName:org.onap.policy.clamp.acm.SimAutomationCompositionElement3} + typeVersion: ${supportedElementTypeVersion:1.0.0} + +management: + tracing: + propagation: + produce: B3 + sampling: + probability: 1.0 + endpoints: + web: + base-path: / + exposure: + include: health, metrics, prometheus +server: + port: 6969 + ssl: + enabled: false + servlet: + context-path: /onap/policy/simparticipant + +tracing: + enabled: true + exporter: + endpoint: http://jaeger:4318/v1/traces + protocol: http + sampler: + jaeger-remote: + endpoint: http://jaeger:14250 + +# legacy config +--- + +spring: + config: + activate: + on-profile: legacy +participant: + intermediaryParameters: + reportingTimeIntervalMs: 120000 + participantId: ${participantId:101c62b3-8918-41b9-a747-d21eb79c6c91} + clampAutomationCompositionTopics: + topicSources: + - topic: policy-acruntime-participant + servers: + - ${topicServer:kafka:9092} + topicCommInfrastructure: kafka + fetchTimeout: 15000 + useHttps: false + topicSinks: + - topic: policy-acruntime-participant + servers: + - ${topicServer:kafka:9092} + topicCommInfrastructure: kafka + useHttps: false diff --git a/compose/export-ports.sh b/compose/export-ports.sh index 20b43ae4..09a5a250 100755 --- a/compose/export-ports.sh +++ b/compose/export-ports.sh @@ -32,6 +32,7 @@ export ACM_PORT=30007 export POLICY_PARTICIPANT_PORT=30008 export SIM_PARTICIPANT1_PORT=30011 export SIM_PARTICIPANT2_PORT=30013 +export SIM_PARTICIPANT3_PORT=30014 export DROOLS_APPS_PORT=30009 export DROOLS_APPS_TELEMETRY_PORT=30219 export SIMULATOR_PORT=30904 diff --git a/csit/resources/scripts/run-test.sh b/csit/resources/scripts/run-test.sh index e85ea27a..eca47696 100755 --- a/csit/resources/scripts/run-test.sh +++ b/csit/resources/scripts/run-test.sh @@ -44,6 +44,7 @@ DISTRIBUTION_IP=policy-distribution:${DEFAULT_PORT} POLICY_RUNTIME_ACM_IP=policy-clamp-runtime-acm:${DEFAULT_PORT} HTTP_PARTICIPANT_SIM1_IP=policy-clamp-ac-sim-ppnt-1:${DEFAULT_PORT} HTTP_PARTICIPANT_SIM2_IP=policy-clamp-ac-sim-ppnt-2:${DEFAULT_PORT} +HTTP_PARTICIPANT_SIM3_IP=policy-clamp-ac-sim-ppnt-3:${DEFAULT_PORT} JAEGER_IP=jaeger:16686 KAFKA_IP=kafka:9092 @@ -57,6 +58,7 @@ ROBOT_VARIABLES="-v DATA:${DATA} -v POLICY_RUNTIME_ACM_IP:${POLICY_RUNTIME_ACM_IP} -v HTTP_PARTICIPANT_SIM1_IP:$HTTP_PARTICIPANT_SIM1_IP -v HTTP_PARTICIPANT_SIM2_IP:$HTTP_PARTICIPANT_SIM2_IP +-v HTTP_PARTICIPANT_SIM3_IP:$HTTP_PARTICIPANT_SIM3_IP -v POLICY_PAP_IP:${POLICY_PAP_IP} -v APEX_IP:${APEX_IP} -v APEX_EVENTS_IP:${APEX_EVENTS_IP} diff --git a/csit/resources/tests/clamp-common.robot b/csit/resources/tests/clamp-common.robot index af95930a..a2db40cb 100644 --- a/csit/resources/tests/clamp-common.robot +++ b/csit/resources/tests/clamp-common.robot @@ -92,6 +92,7 @@ VerifyMigratedElementsRuntime Should Be Equal As Strings ${resp.status_code} 200 ${respstring} Convert To String ${resp.json()} Should Match Regexp ${respstring} Sim_NewAutomationCompositionElement + Should Match Regexp ${respstring} Sim_NewAutomationCompositionElement2 Should Not Match Regexp ${respstring} Sim_SinkAutomationCompositionElement ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c34']['outProperties']['stage']} Should Be Equal As Strings ${respstring} [1, 2] @@ -99,6 +100,8 @@ VerifyMigratedElementsRuntime Should Be Equal As Strings ${respstring} [0, 1] ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c37']['outProperties']['stage']} Should Be Equal As Strings ${respstring} [0, 2] + ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c40']['outProperties']['stage']} + Should Be Equal As Strings ${respstring} [1, 2] VerifyPrepareElementsRuntime [Arguments] ${theCompositionId} ${theInstanceId} @@ -139,6 +142,16 @@ VerifyMigratedElementsSim Should Match Regexp ${respstring} Sim_NewAutomationCompositionElement Should Not Match Regexp ${respstring} Sim_SinkAutomationCompositionElement +VerifyMigratedElementsSim3 + [Arguments] ${theInstanceId} + [Documentation] Query on Participant Simulator 3 + ${auth}= ParticipantAuth + ${resp}= MakeGetRequest participant ${HTTP_PARTICIPANT_SIM3_IP} /onap/policy/simparticipant/v2/instances/${theInstanceId} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + ${respstring} Convert To String ${resp.json()} + Should Match Regexp ${respstring} Sim_NewAutomationCompositionElement2 + Should Not Match Regexp ${respstring} Sim_SinkAutomationCompositionElement + VerifyRemovedElementsSim [Arguments] ${theInstanceId} [Documentation] Query on Participant Simulator 2 diff --git a/csit/resources/tests/clamp-migrate-rollback.robot b/csit/resources/tests/clamp-migrate-rollback.robot index ea2188ba..df9b7aef 100644 --- a/csit/resources/tests/clamp-migrate-rollback.robot +++ b/csit/resources/tests/clamp-migrate-rollback.robot @@ -236,6 +236,7 @@ AutomationCompositionMigrationTo VerifyMigratedElementsRuntime ${compositionToId} ${instanceMigrationId} VerifyMigratedElementsSim ${instanceMigrationId} VerifyRemovedElementsSim ${instanceMigrationId} + VerifyMigratedElementsSim3 ${instanceMigrationId} FailAutomationCompositionMigration [Documentation] Fail Migration of an automation composition. diff --git a/csit/resources/tests/data/ac-definition-migration-to.yaml b/csit/resources/tests/data/ac-definition-migration-to.yaml index 905227d0..9d9a5f0c 100644 --- a/csit/resources/tests/data/ac-definition-migration-to.yaml +++ b/csit/resources/tests/data/ac-definition-migration-to.yaml @@ -105,6 +105,30 @@ node_types: type: map description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests + org.onap.policy.clamp.acm.SimAutomationCompositionElement3: + version: 1.0.0 + derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement + properties: + baseUrl: + type: string + required: true + description: The base URL to be prepended to each path, identifies the host for the REST endpoints. + metadata: + sensitive: true + httpHeaders: + type: map + required: false + entry_schema: + type: string + description: HTTP headers to send on REST requests + configurationEntities: + type: map + required: true + entry_schema: + type: map + description: The configuration entities the Automation Composition Element is managing and their associated REST requests + + topology_template: node_templates: @@ -153,6 +177,18 @@ topology_template: prepare: [0,2] migrate: [0,2] + onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement2: + version: 1.2.4 + type: org.onap.policy.clamp.acm.SimAutomationCompositionElement3 + type_version: 1.0.0 + description: Automation composition element for the http requests of AC Element Sink microservice + properties: + provider: ONAP + startPhase: 0 + stage: + prepare: [ 1,2 ] + migrate: [ 1,2 ] + onap.policy.clamp.ac.element.AutomationCompositionDefinition: version: 1.2.4 type: org.onap.policy.clamp.acm.AutomationComposition @@ -167,3 +203,5 @@ topology_template: version: 1.2.4 - name: onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement version: 1.2.4 + - name: onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement2 + version: 1.2.4 diff --git a/csit/resources/tests/data/ac-instance-migration-to.yaml b/csit/resources/tests/data/ac-instance-migration-to.yaml index ec6de189..f3e6ecbf 100644 --- a/csit/resources/tests/data/ac-instance-migration-to.yaml +++ b/csit/resources/tests/data/ac-instance-migration-to.yaml @@ -62,7 +62,23 @@ elements: definition: name: onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement version: 1.2.4 - description: Sink Automation Composition Element for the Demo + description: New element for an existing participant + properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 + configurationEntities: + - configurationEntityId: + myParameterToUpdate: text updated for migration + + 709c62b3-8918-41b9-a747-d21eb79c6c40: + id: 709c62b3-8918-41b9-a747-d21eb79c6c40 + definition: + name: onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement2 + version: 1.2.4 + description: New element with a new participant properties: deployTimeoutMs: 200000 undeployTimeoutMs: 150000 diff --git a/csit/resources/tests/data/ac-instance-precheck-migration.yaml b/csit/resources/tests/data/ac-instance-precheck-migration.yaml index 3380c157..2300b9e2 100644 --- a/csit/resources/tests/data/ac-instance-precheck-migration.yaml +++ b/csit/resources/tests/data/ac-instance-precheck-migration.yaml @@ -58,3 +58,19 @@ elements: configurationEntities: - configurationEntityId: myParameterToUpdate: text updated for migration + + 709c62b3-8918-41b9-a747-d21eb79c6c40: + id: 709c62b3-8918-41b9-a747-d21eb79c6c40 + definition: + name: onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement2 + version: 1.2.4 + description: New element with a new participant + properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 + configurationEntities: + - configurationEntityId: + myParameterToUpdate: text updated for migration