clearing/clr_test/clearing-all/launch_and_test.sh
2024-12-10 19:12:35 +03:00

38 lines
No EOL
914 B
Bash

#!/bin/sh
CLEARING_HOME=/opt/clearing/
cd $CLEARING_HOME/
date
echo Start CLEARING system
sh ./launch_all.sh
sleep 180
echo Run test case
sh ./clearing_testing_utils/run_test_env.sh
sleep 30
echo Run clearing-tester
sh ./clearing_testing_utils/clearing-tester/clearing-tester.sh
if [ -n "$CLR_TEST_NAME" ] && [ -d "./bin/log" ]; then
echo "Copying logs to ./bin/log_artifacts/${CLR_TEST_NAME}"
# Copy all contents from ./bin/log to tmp dir
mkdir -p "./bin/tmp_log_artifact"
cp -a ./bin/log/. "./bin/tmp_log_artifact/"
# Move the copied logs into the artifact location
mkdir -p "./bin/log_artifacts/${CLR_TEST_NAME}"
mv ./bin/tmp_log_artifact/* "./bin/log_artifacts/${CLR_TEST_NAME}"
else
echo "CLR_TEST_NAME is not set or ./bin/log does not exist. Skipping log copy."
fi
if [ $? -eq 0 ]
then
echo "Tests passed successfully"
exit 0
else
echo "Tests failed"
exit 1
fi