X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=testsuites%2Frun-s3p-test.sh;h=b3cc0024f77dd78f67f31cba25c6994ca716452d;hb=refs%2Fheads%2Fmaster;hp=1ff941c0ba25cfe898b282677683bedfbe66fa69;hpb=c151a57a325a83be1e6e651b2a7c883a02d93705;p=policy%2Fapi.git diff --git a/testsuites/run-s3p-test.sh b/testsuites/run-s3p-test.sh index 1ff941c0..791b7abd 100755 --- a/testsuites/run-s3p-test.sh +++ b/testsuites/run-s3p-test.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2025 Nordix Foundation. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,28 +22,43 @@ if [ -z "${WORKSPACE}" ]; then export WORKSPACE=$(git rev-parse --show-toplevel) fi +export PROJECT="api" export TESTDIR=${WORKSPACE}/testsuites export API_PERF_TEST_FILE=$TESTDIR/performance/src/main/resources/testplans/policy_api_performance.jmx export API_STAB_TEST_FILE=$TESTDIR/stability/src/main/resources/testplans/policy_api_stability.jmx -if [ $1 == "run" ] -then - - mkdir automate-performance;cd automate-performance; - git clone "https://gerrit.onap.org/r/policy/docker" - cd docker/csit - - if [ $2 == "performance" ] - then - bash start-s3p-tests.sh run $API_PERF_TEST_FILE; - elif [ $2 == "stability" ] - then - bash start-s3p-tests.sh run $API_STAB_TEST_FILE; - else - echo "echo Invalid arguments provided. Usage: $0 [option..] {performance | stability}" - fi - -else - echo "Invalid arguments provided. Usage: $0 [option..] {run | uninstall}" -fi +function run_tests() { + local test_file=$1 + + mkdir -p automate-s3p-test + cd automate-s3p-test || exit 1 + git clone "https://gerrit.onap.org/r/policy/docker" + cd docker/csit || exit 1 + + bash run-s3p-tests.sh test "$test_file" $PROJECT +} + +function clean() { + cd $TESTDIR/automate-s3p-test/docker/csit + bash run-s3p-tests.sh clean +} + +echo "=================================" +echo "Triggering S3P test for: $PROJECT" +echo "=================================" +case $1 in + performance) + run_tests "$API_PERF_TEST_FILE" + ;; + stability) + run_tests "$API_STAB_TEST_FILE" + ;; + clean) + clean + ;; + *) + echo "Invalid arguments provided. Usage: $0 {performance | stability | clean}" + exit 1 + ;; +esac