Add option to preserve all logs in ssl-opt.sh
Useful to also allow saving of correct logs in order to compare differences with failed logs
This commit is contained in:
parent
e20310a9fc
commit
acaac8510e
1 changed files with 11 additions and 0 deletions
|
@ -36,6 +36,8 @@ EXCLUDE='^$'
|
||||||
SHOW_TEST_NUMBER=0
|
SHOW_TEST_NUMBER=0
|
||||||
RUN_TEST_NUMBER=''
|
RUN_TEST_NUMBER=''
|
||||||
|
|
||||||
|
PRESERVE_LOGS=0
|
||||||
|
|
||||||
print_usage() {
|
print_usage() {
|
||||||
echo "Usage: $0 [options]"
|
echo "Usage: $0 [options]"
|
||||||
printf " -h|--help\tPrint this help.\n"
|
printf " -h|--help\tPrint this help.\n"
|
||||||
|
@ -44,6 +46,7 @@ print_usage() {
|
||||||
printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n"
|
printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n"
|
||||||
printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
|
printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
|
||||||
printf " -s|--show-numbers\tShow test numbers in front of test names\n"
|
printf " -s|--show-numbers\tShow test numbers in front of test names\n"
|
||||||
|
printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_options() {
|
get_options() {
|
||||||
|
@ -64,6 +67,9 @@ get_options() {
|
||||||
-s|--show-numbers)
|
-s|--show-numbers)
|
||||||
SHOW_TEST_NUMBER=1
|
SHOW_TEST_NUMBER=1
|
||||||
;;
|
;;
|
||||||
|
-p|--preserve-logs)
|
||||||
|
PRESERVE_LOGS=1
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
print_usage
|
print_usage
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -485,6 +491,11 @@ run_test() {
|
||||||
|
|
||||||
# if we're here, everything is ok
|
# if we're here, everything is ok
|
||||||
echo "PASS"
|
echo "PASS"
|
||||||
|
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
||||||
|
mv $SRV_OUT o-srv-${TESTS}.log
|
||||||
|
mv $CLI_OUT o-cli-${TESTS}.log
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue