3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
5 # Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
6 # ========================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=================================================
21 TEST_DIRECTORY="test/auto-test"
22 TEST_SCRIPT="./Suite-Verify-jobs.sh"
23 DOCKER_COMPOSE_VERSION="v2.21.0"
24 PULL_IMAGE_TYPE="remote-remove"
26 IMAGE_VERSION="release"
28 ENV_FILE="../common/test_env-oran-h-release.sh"
30 # Check if jq is installed, and install it if not
31 if ! command -v jq &> /dev/null; then
32 echo "Installing jq..."
34 sudo apt-get install -y jq
37 # Function to install Docker Compose version 2
38 install_docker_compose() {
39 echo "Installing Docker Compose version 2..."
40 sudo curl -L "https://github.com/docker/compose/releases/download/"$DOCKER_COMPOSE_VERSION"/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
41 sudo chmod +x /usr/local/bin/docker-compose
42 sudo ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugins/docker-compose
45 # Function to remove Docker Compose
46 remove_docker_compose() {
47 echo "Removing Docker Compose..."
48 sudo rm /usr/local/bin/docker-compose
51 # Check if docker-compose is installed, and install it if not
52 if ! command -v docker-compose &> /dev/null; then
53 install_docker_compose
57 sudo chmod 775 "$TEST_SCRIPT"
58 "$TEST_SCRIPT" $PULL_IMAGE_TYPE $RUN_MODE $IMAGE_VERSION $ENV_FLAG $ENV_FILE
61 # Remove docker-compose after tests are done
62 if command -v docker-compose &> /dev/null; then
66 # Remove jq after tests are done
67 if command -v jq &> /dev/null; then
69 sudo apt-get remove -y jq