From 0bf42ba3933be914185f322568c909906a495422 Mon Sep 17 00:00:00 2001 From: akenihan Date: Wed, 23 Jul 2025 22:32:18 +0100 Subject: [PATCH] Change clamp CSIT to use replicas Issue-ID: POLICY-5427 Change-Id: I692569785daa45ac56e284b123fc7d5011a26514 Signed-off-by: akenihan --- compose/start-acm-replica.sh | 16 ++++++++++++++-- csit/run-project-csit.sh | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/compose/start-acm-replica.sh b/compose/start-acm-replica.sh index a9e95b88..656e5abf 100755 --- a/compose/start-acm-replica.sh +++ b/compose/start-acm-replica.sh @@ -1,7 +1,7 @@ #!/bin/bash # # ============LICENSE_START==================================================== -# Copyright (C) 2024 Nordix Foundation. +# Copyright (C) 2025 OpenInfra Foundation Europe. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,6 +41,10 @@ while [[ "$#" -gt 0 ]]; do REPLICAS="${1#*=}" shift ;; + --grafana) + grafana=true + shift + ;; *) echo "Unknown option: $1" exit 1 @@ -69,8 +73,16 @@ fi export database=postgres + if [ "$START" = true ]; then - docker compose -f compose.acm.scale.yml up -d nginx + if [ "$grafana" = true ]; then + echo "Starting policy-clamp-runtime-acm using ${database} + Grafana/Prometheus" + docker compose -f compose.acm.scale.yml up -d nginx grafana --remove-orphans + echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}" + echo "Grafana server: http://localhost:${GRAFANA_PORT}" + else + docker compose -f compose.acm.scale.yml up -d nginx + fi else containers=$(docker compose -f compose.acm.scale.yml ps --all --format '{{.Service}}') diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh index 4f48c49b..2c018bb0 100755 --- a/csit/run-project-csit.sh +++ b/csit/run-project-csit.sh @@ -3,7 +3,7 @@ # Copyright 2016-2017 Huawei Technologies Co., Ltd. # Modification Copyright 2019 © Samsung Electronics Co., Ltd. # Modification Copyright 2021 © AT&T Intellectual Property. -# Modification Copyright 2021-2025 Nordix Foundation. +# Modification Copyright 2021-2025 OpenInfra Foundation Europe. # Modifications Copyright 2024-2025 Deutsche Telekom # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -96,19 +96,11 @@ function check_rest_endpoint() { } function setup_clamp() { - export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot" - source "${DOCKER_COMPOSE_DIR}"/start-compose.sh policy-clamp-runtime-acm --grafana - echo "Waiting 2 minutes acm-runtime and participants to start..." - sleep 120 - check_rest_endpoint "${ACM_PORT}" -} - -function setup_clamp_replica() { export ACM_REPLICA_TEARDOWN=true - export ROBOT_FILES="policy-clamp-test.robot" + export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot" export TEST_ENV="docker" export PROJECT=clamp - source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --start --replicas=2 + source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --start --replicas=2 --grafana echo "Waiting 2 minutes for the replicas to be started..." sleep 120 # checking on apex-pdp status because acm-r replicas only start after apex-pdp is running @@ -118,6 +110,14 @@ function setup_clamp_replica() { check_rest_endpoint "${ACM_PORT}" } +function setup_clamp_simple() { + export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot" + source "${DOCKER_COMPOSE_DIR}"/start-compose.sh policy-clamp-runtime-acm --grafana + echo "Waiting 2 minutes acm-runtime and participants to start..." + sleep 120 + check_rest_endpoint "${ACM_PORT}" +} + function setup_api() { export ROBOT_FILES="api-test.robot api-slas.robot" source "${DOCKER_COMPOSE_DIR}"/start-compose.sh api --grafana @@ -240,9 +240,9 @@ function set_project_config() { setup_clamp ;; - clamp-replica | policy-clamp-replica) - setup_clamp_replica - ;; + clamp-simple | policy-simple) + setup_clamp_simple + ;; api | policy-api) setup_api -- 2.16.6