aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2025-01-20 08:35:20 +0000
committerwaynedunican <wayne.dunican@est.tech>2025-01-23 10:57:19 +0000
commit90466c5d39ff4295ea3a8ba7c3a14d946ef93fb4 (patch)
tree3fba8437c1503191951f738809adb082db02d3b6
parent513561b7a9ff3e33ea008e7bdc6cf822dbcfe1c9 (diff)
Update S3P trigger script
Issue-ID: POLICY-5148 Change-Id: I6de0ff8e83ee8101696cec8e5f7db72505e60e95 Signed-off-by: waynedunican <wayne.dunican@est.tech>
-rwxr-xr-xtestsuites/run-s3p-test.sh57
1 files changed, 36 insertions, 21 deletions
diff --git a/testsuites/run-s3p-test.sh b/testsuites/run-s3p-test.sh
index c0b4b8ed..842a01bb 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,43 @@ if [ -z "${WORKSPACE}" ]; then
export WORKSPACE=$(git rev-parse --show-toplevel)
fi
+export PROJECT="pap"
export TESTDIR=${WORKSPACE}/testsuites
export PAP_PERF_TEST_FILE=$TESTDIR/performance/src/main/resources/testplans/performance.jmx
export PAP_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 $PAP_PERF_TEST_FILE pap;
- elif [ $2 == "stability" ]
- then
- bash start-s3p-tests.sh run $PAP_STAB_TEST_FILE pap;
- 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 "$PAP_PERF_TEST_FILE"
+ ;;
+ stability)
+ run_tests "$PAP_STAB_TEST_FILE"
+ ;;
+ clean)
+ clean
+ ;;
+ *)
+ echo "Invalid arguments provided. Usage: $0 {performance | stability | clean}"
+ exit 1
+ ;;
+esac