#!/bin/sh # set time stamp current_time=`date +%Y_%m_%d_%H_%M_%S` export TIME_STAMP=${current_time} # init file of test list test_list_file=test_list_${current_time}.json mkdir -p /var/run/agl-test/logs/tmp-log/ echo "{ }" > /var/run/agl-test/logs/tmp-log/${test_list_file} # init the dir of log-to-report if [[ -e "/var/run/agl-test/logs/log-to-report/summary-report.html" ]] then rm /var/run/agl-test/logs/log-to-report/* else mkdir -p /var/run/agl-test/logs/log-to-report/ fi cd /usr/AGL/agl-test/ # default stress level is low if [[ ! $STRESS_LEVEL ]] then export STRESS_LEVEL="low" fi echo "STRESS_LEVEL: $STRESS_LEVEL" # default logging mode is slim if [[ ! $LOG_MODE ]] then export LOG_MODE="slim" fi case $LOG_MODE in "origin") ;; "slim") ;; "clear") ;; *) echo "Unrecognized LOG_MODE, setting to default mode 'slim'..." export LOG_MODE="slim" ;; esac echo "LOG_MODE: $LOG_MODE" # default test without dangerous marker moption="-m " if [[ $* =~ ${moption} ]] then pytest "$@" else pytest "$@" -m "not dangerous" fi python3 -c "import plugins.agl_test_report as report; report.generate_total_summary_files('${current_time}')" python3 -c "import plugins.agl_test_utils as utils; utils.rm_all_tmp()"