Add scenario in Migration tests for new participant type 20/142320/1 master
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Fri, 24 Oct 2025 15:10:52 +0000 (16:10 +0100)
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>
Tue, 28 Oct 2025 09:25:31 +0000 (09:25 +0000)
Issue-ID: POLICY-5463
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
Change-Id: Ie936af2f843954b2236ba5717d23022d15705359

compose/compose.acm.scale.yml
compose/compose.common.yml
compose/config/clamp/SimulatorParticipant3Parameters.yaml [new file with mode: 0644]
compose/export-ports.sh
csit/resources/scripts/run-test.sh
csit/resources/tests/clamp-common.robot
csit/resources/tests/clamp-migrate-rollback.robot
csit/resources/tests/data/ac-definition-migration-to.yaml
csit/resources/tests/data/ac-instance-migration-to.yaml
csit/resources/tests/data/ac-instance-precheck-migration.yaml

index 7cea86f..2a868fd 100644 (file)
@@ -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:
index 757bb1c..8836f86 100644 (file)
@@ -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 (file)
index 0000000..80ce735
--- /dev/null
@@ -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
index 20b43ae..09a5a25 100755 (executable)
@@ -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
index e85ea27..eca4769 100755 (executable)
@@ -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}
index af95930..a2db40c 100644 (file)
@@ -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
index ea2188b..df9b7ae 100644 (file)
@@ -236,6 +236,7 @@ AutomationCompositionMigrationTo
     VerifyMigratedElementsRuntime  ${compositionToId}  ${instanceMigrationId}
     VerifyMigratedElementsSim  ${instanceMigrationId}
     VerifyRemovedElementsSim  ${instanceMigrationId}
+    VerifyMigratedElementsSim3  ${instanceMigrationId}
 
 FailAutomationCompositionMigration
     [Documentation]  Fail Migration of an automation composition.
index 905227d..9d9a5f0 100644 (file)
@@ -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
index ec6de18..f3e6ecb 100644 (file)
@@ -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
index 3380c15..2300b9e 100644 (file)
@@ -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