aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2025-01-20 08:33:19 +0000
committerwaynedunican <wayne.dunican@est.tech>2025-01-23 10:58:42 +0000
commitd067300ced35d2dfb3d84059600e0f5209de2538 (patch)
tree24e6684a2f25a6a70ad9ed8d74ca96e1af70c3e2
parent03eaface60f2e7c82bb149a988fdeb94457ce431 (diff)
Update S3P trigger script
Issue-ID: POLICY-5148 Change-Id: I141757ba14429d62526a75134006e367d07a52ed Signed-off-by: waynedunican <wayne.dunican@est.tech>
-rwxr-xr-xtestsuites/run-s3p-test.sh56
1 files changed, 35 insertions, 21 deletions
diff --git a/testsuites/run-s3p-test.sh b/testsuites/run-s3p-test.sh
index e030c7094..9e9e86547 100755
--- a/testsuites/run-s3p-test.sh
+++ b/testsuites/run-s3p-test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (C) 2023-2024 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,42 @@ if [ -z "${WORKSPACE}" ]; then
export WORKSPACE=$(git rev-parse --show-toplevel)
fi
+export PROJECT="clamp"
export TESTDIR=${WORKSPACE}/testsuites
export ACM_PERF_TEST_FILE=$TESTDIR/performance/src/main/resources/testplans/performance.jmx
export ACM_STAB_TEST_FILE=$TESTDIR/stability/src/main/resources/testplans/stability.jmx
-if [ $1 == "run" ]
-then
-
- mkdir automate-s3p-test;cd automate-s3p-test;
- git clone "https://gerrit.onap.org/r/policy/docker"
- cd docker/csit
-
- if [ $2 == "performance" ]
- then
- bash start-s3p-tests.sh run $ACM_PERF_TEST_FILE;
- elif [ $2 == "stability" ]
- then
- bash start-s3p-tests.sh run $ACM_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 "$ACM_PERF_TEST_FILE"
+ ;;
+ stability)
+ run_tests "$ACM_STAB_TEST_FILE"
+ ;;
+ clean)
+ clean
+ ;;
+ *)
+ echo "Invalid arguments provided. Usage: $0 {performance | stability | clean}"
+ exit 1
+ ;;