From: Tobias Brunner Date: Wed, 2 Jun 2021 12:29:55 +0000 (+0200) Subject: testing: Copy comments to test log X-Git-Tag: 5.9.6rc1~3^2~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=994d9d37d475820d3468cfe9656ab8efe314fb73;p=thirdparty%2Fstrongswan.git testing: Copy comments to test log --- diff --git a/testing/do-tests b/testing/do-tests index ace12b86bd..1e6a83a370 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -406,12 +406,16 @@ do echo -e "\nPRE-TEST\n" >> $CONSOLE_LOG 2>&1 eval `awk -F "::" '{ - if ($1 !~ /^#.*/ && $2 != "") - { - printf("echo \"$(print_time)%s# %s\"; ", $1, $2) - printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2) - printf("echo;\n") - } + if ($0 ~ /^#.*/) + { + printf("echo \"%s\"; ", $0); + } + else if ($2 != "") + { + printf("echo \"$(print_time)%s# %s\"; ", $1, $2) + printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2) + printf("echo;\n") + } }' $TESTDIR/pretest.dat` >> $CONSOLE_LOG 2>&1 @@ -443,7 +447,12 @@ do command=$2 pattern=$3 hit=$4 - if (host ~ /^#.*/ || command == "") + if ($0 ~ /^#.*/) + { + printf("echo \"%s\"; ", $0); + next + } + else if (command == "") { next } @@ -766,12 +775,16 @@ do echo -e "\nPOST-TEST\n" >> $CONSOLE_LOG 2>&1 eval `awk -F "::" '{ - if ($1 !~ /^#.*/ && $2 != "") - { - printf("echo \"$(print_time)%s# %s\"; ", $1, $2) - printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2) - printf("echo;\n") - } + if ($0 ~ /^#.*/) + { + printf("echo \"%s\"; ", $0); + } + else if ($2 != "") + { + printf("echo \"$(print_time)%s# %s\"; ", $1, $2) + printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2) + printf("echo;\n") + } }' $TESTDIR/posttest.dat` >> $CONSOLE_LOG 2>&1 ##########################################################################