#!/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.
REPLICAS="${1#*=}"
shift
;;
+ --grafana)
+ grafana=true
+ shift
+ ;;
*)
echo "Unknown option: $1"
exit 1
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}}')
# 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");
}
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
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
setup_clamp
;;
- clamp-replica | policy-clamp-replica)
- setup_clamp_replica
- ;;
+ clamp-simple | policy-simple)
+ setup_clamp_simple
+ ;;
api | policy-api)
setup_api