138 lines
6 KiB
Bash
138 lines
6 KiB
Bash
#!/bin/sh
|
|
|
|
CLEARING_HOME=/opt/clearing/
|
|
cd $CLEARING_HOME/
|
|
|
|
date
|
|
|
|
echo Start CLEARING system
|
|
sh ./launch_all.sh
|
|
sleep 30
|
|
|
|
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
|
|
|
|
TESTER_EXIT_CODE=$?
|
|
|
|
if [ -n "$CLR_TEST_NAME" ]
|
|
then
|
|
echo "Copying logs to ./bin/log_artifacts/${CLR_TEST_NAME}"
|
|
|
|
if [ -d "./bin/log" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/clearing_logs"
|
|
cp -a ./bin/log/. "./bin/tmp_log_artifact/clearing_logs/"
|
|
rm -r ./bin/log/* || echo "Can't delete content of folder ./bin/log/"
|
|
else
|
|
echo "./bin/log does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./clearing_testing_utils/store/results" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/results"
|
|
cp -a ./clearing_testing_utils/store/results/. "./bin/tmp_log_artifact/results/"
|
|
rm -r ./clearing_testing_utils/store/results/* || echo "Can't delete content of folder ./clearing_testing_utils/store/results/"
|
|
else
|
|
echo "./clearing_testing_utils/store/results does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./clearing_testing_utils/clearing-tester/logs" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/tester_logs"
|
|
cp -a ./clearing_testing_utils/clearing-tester/logs/. "./bin/tmp_log_artifact/tester_logs/"
|
|
rm -r ./clearing_testing_utils/clearing-tester/logs/* || echo "Can't delete content of folder ./clearing_testing_utils/clearing-tester/logs/"
|
|
else
|
|
echo "./clearing_testing_utils/clearing-tester/logs does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./clearing_testing_utils/clearing-converter/logs" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/converter_logs"
|
|
cp -a ./clearing_testing_utils/clearing-converter/logs/. "./bin/tmp_log_artifact/converter_logs/"
|
|
rm -r ./clearing_testing_utils/clearing-converter/logs/* || echo "Can't delete content of folder ./clearing_testing_utils/clearing-converter/logs/"
|
|
else
|
|
echo "./clearing_testing_utils/clearing-converter/logs does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./clearing_testing_utils/clearing-checker/logs" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/checker_logs"
|
|
cp -a ./clearing_testing_utils/clearing-checker/logs/. "./bin/tmp_log_artifact/checker_logs/"
|
|
rm -r ./clearing_testing_utils/clearing-checker/logs/* || echo "Can't delete content of folder ./clearing_testing_utils/clearing-checker/logs/"
|
|
else
|
|
echo "./clearing_testing_utils/clearing-checker/logs does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./files/swt/importer/out" ] && [ -d "./files/swt/importer/error" ] && [ -d "./files/swt/exporter" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/swt/importer/out"
|
|
mkdir -p "./bin/tmp_log_artifact/swt/importer/error"
|
|
mkdir -p "./bin/tmp_log_artifact/swt/exporter"
|
|
cp -a ./files/swt/importer/out/. "./bin/tmp_log_artifact/swt/importer/out/"
|
|
cp -a ./files/swt/importer/error/. "./bin/tmp_log_artifact/swt/importer/error/"
|
|
cp -a ./files/swt/exporter/. "./bin/tmp_log_artifact/swt/exporter/"
|
|
rm -r ./files/swt/importer/out/* || echo "Can't delete content of folder ./files/swt/importer/out/"
|
|
rm -r ./files/swt/importer/error/* || echo "Can't delete content of folder ./files/swt/importer/error/"
|
|
rm -r ./files/swt/exporter/* || echo "Can't delete content of folder ./files/swt/exporter/"
|
|
else
|
|
echo "./files/swt/importer/out or ./files/swt/importer/error or ./files/swt/exporter does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
# if [ -d "./files/dbf/importer/out" ] && [ -d "./files/dbf/importer/error" ] && [ -d "./files/dbf/exporter" ]
|
|
# then
|
|
# mkdir -p "./bin/tmp_log_artifact/dbf/importer/out"
|
|
# mkdir -p "./bin/tmp_log_artifact/dbf/importer/error"
|
|
# mkdir -p "./bin/tmp_log_artifact/dbf/exporter"
|
|
# cp -a ./files/dbf/importer/out/. "./bin/tmp_log_artifact/dbf/importer/out/"
|
|
# cp -a ./files/dbf/importer/error/. "./bin/tmp_log_artifact/dbf/importer/error/"
|
|
# cp -a ./files/dbf/exporter/. "./bin/tmp_log_artifact/dbf/exporter/"
|
|
# rm -r ./files/dbf/importer/out/* || echo "Can't delete content of folder ./files/dbf/importer/out/"
|
|
# rm -r ./files/dbf/importer/error/* || echo "Can't delete content of folder ./files/dbf/importer/error/"
|
|
# rm -r ./files/dbf/exporter/* || echo "Can't delete content of folder ./files/dbf/exporter/"
|
|
# else
|
|
# echo "./files/dbf/importer/out or ./files/dbf/importer/error or ./files/dbf/exporter does not exists, skipping folder log copy"
|
|
# fi
|
|
|
|
if [ -d "./files/xml/importer/out" ] && [ -d "./files/xml/importer/error" ] && [ -d "./files/xml/exporter" ]
|
|
then
|
|
mkdir -p "./bin/tmp_log_artifact/xml/importer/out"
|
|
mkdir -p "./bin/tmp_log_artifact/xml/importer/error"
|
|
mkdir -p "./bin/tmp_log_artifact/xml/exporter"
|
|
cp -a ./files/xml/importer/out/. "./bin/tmp_log_artifact/xml/importer/out/"
|
|
cp -a ./files/xml/importer/error/. "./bin/tmp_log_artifact/xml/importer/error/"
|
|
cp -a ./files/xml/exporter/. "./bin/tmp_log_artifact/xml/exporter/"
|
|
rm -r ./files/xml/importer/out/* || echo "Can't delete content of folder ./files/xml/importer/out/"
|
|
rm -r ./files/xml/importer/error/* || echo "Can't delete content of folder ./files/xml/importer/error/"
|
|
rm -r ./files/xml/exporter/* || echo "Can't delete content of folder ./files/xml/exporter/"
|
|
else
|
|
echo "./files/xml/importer/out or ./files/xml/importer/error or ./files/xml/exporter does not exists, skipping folder log copy"
|
|
fi
|
|
|
|
if [ -d "./bin/log_artifacts/${CLR_TEST_NAME}" ]
|
|
then
|
|
echo "./bin/log_artifacts/${CLR_TEST_NAME} already exists, removing content"
|
|
rm -rf "./bin/log_artifacts/${CLR_TEST_NAME}/*"
|
|
else
|
|
echo "Creating folder ./bin/log_artifacts/${CLR_TEST_NAME}"
|
|
mkdir -p "./bin/log_artifacts/${CLR_TEST_NAME}"
|
|
fi
|
|
|
|
# Move the copied logs into the artifact location
|
|
cp -r ./bin/tmp_log_artifact/* "./bin/log_artifacts/${CLR_TEST_NAME}/"
|
|
rm -rf ./bin/tmp_log_artifact/*
|
|
else
|
|
echo "CLR_TEST_NAME is not set. Skipping log copy."
|
|
fi
|
|
|
|
if [ "$TESTER_EXIT_CODE" -eq "0" ]
|
|
then
|
|
echo "Test case ${CLR_TEST_NAME} passed successfully"
|
|
exit 0
|
|
else
|
|
echo "Test case ${CLR_TEST_NAME} failed"
|
|
exit 1
|
|
fi
|