summaryrefslogtreecommitdiffstats
path: root/testsuites/run-s3p-test.sh
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2025-01-20 08:35:50 +0000
committerwaynedunican <wayne.dunican@est.tech>2025-01-22 15:44:33 +0000
commitecdd6e15db78790651eece880c42018f25f91297 (patch)
treed9681e42059af1f44e0fe92de718a65883156e1c /testsuites/run-s3p-test.sh
parent7528c41d3fb2094b6f29cb08168bbab39b7bbadf (diff)
Update S3P trigger script
Issue-ID: POLICY-5148 Change-Id: I634a31b4a1562a11a890ff40156571dcfd923537 Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'testsuites/run-s3p-test.sh')
-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 0598f2fc..5ccbe6ab 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="xacml"
export TESTDIR=${WORKSPACE}/testsuites
export XACML_PERF_TEST_FILE=$TESTDIR/performance/src/main/resources/testplans/perf.jmx
export XACML_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 $XACML_PERF_TEST_FILE xacml-pdp;
- elif [ $2 == "stability" ]
- then
- bash start-s3p-tests.sh run $XACML_STAB_TEST_FILE xacml-pdp;
- 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 "$XACML_PERF_TEST_FILE"
+ ;;
+ stability)
+ run_tests "$XACML_STAB_TEST_FILE"
+ ;;
+ clean)
+ clean
+ ;;
+ *)
+ echo "Invalid arguments provided. Usage: $0 {performance | stability | clean}"
+ exit 1
+ ;;