blob: 5f77d2145dfaa2e2d36fcf5868e3382065da862b [file] [log] [blame]
rameshiyer27b15eda62024-02-14 10:13:16 +00001#!/bin/bash
2#
3# Copyright 2024 Nordix Foundation.
4
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18# Script to run the ACM regression test suite in cucumber.
19# Deploys ACM-R and participants in two different release versions for testing backward compatibility.
20
21if [ $# -eq 0 ]
22then
23 echo "No release versions provided. Testing ACM-R and participants with the default version"
24 echo "Usage: $0 <acm_release> <compatibility_test_release>"
25 ACM_RELEASE=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
26 "${WORKSPACE}"/.gitreview)
27 PPNT_RELEASE=$ACM_RELEASE
28fi
29
30if [ $1 ]; then
31 ACM_RELEASE=$1
32fi
33
34if [ $2 ]; then
35 PPNT_RELEASE=$2
36fi
37
38if [ -z "${WORKSPACE}" ]; then
39 WORKSPACE=$(git rev-parse --show-toplevel)
40 export WORKSPACE
41fi
42
43
44export SCRIPTS="${WORKSPACE}/csit/resources/scripts"
45
46COMPOSE_FOLDER="${WORKSPACE}"/compose
47REGRESSION_FOLDER="${WORKSPACE}"/policy-regression-tests/policy-clamp-regression/
48export PROJECT='clamp'
49
50# Sign in to nexus3 docker repo
51docker login -u docker -p docker nexus3.onap.org:10001
52
53cd ${COMPOSE_FOLDER}
54
55echo "Configuring docker compose..."
56
57source export-ports.sh > /dev/null 2>&1
58source get-versions-regression.sh $ACM_RELEASE $PPNT_RELEASE > /dev/null 2>&1
59
60docker-compose -f docker-compose.yml up -d "policy-clamp-runtime-acm"
61
62# wait for the app to start up
63"${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
64
65cd ${REGRESSION_FOLDER}
66
67# Invoke the regression test cases
rameshiyer276f8a8fd2024-03-20 12:38:11 +000068mvn clean test -Dtests.skip=false