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
diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh
index f62466f..0d52226 100755
--- a/tests/ssl-opt.sh
+++ b/tests/ssl-opt.sh
@@ -36,6 +36,8 @@
SHOW_TEST_NUMBER=0
RUN_TEST_NUMBER=''
+PRESERVE_LOGS=0
+
print_usage() {
echo "Usage: $0 [options]"
printf " -h|--help\tPrint this help.\n"
@@ -44,6 +46,7 @@
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 " -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() {
@@ -64,6 +67,9 @@
-s|--show-numbers)
SHOW_TEST_NUMBER=1
;;
+ -p|--preserve-logs)
+ PRESERVE_LOGS=1
+ ;;
-h|--help)
print_usage
exit 0
@@ -485,6 +491,11 @@
# if we're here, everything is ok
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
}