diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2018-09-24 15:11:14 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2018-09-24 15:11:14 +0200 |
commit | e0e280b7669435b991b7e457abd8aa450930b3e8 (patch) | |
tree | 3e6084f13b14ad2df104e2ce6e589eb96c5f7ac9 /testing/do-tests | |
parent | 51a71ee15c1bcf0e82f363a16898f571e211f9c3 (diff) | |
download | vyos-strongswan-e0e280b7669435b991b7e457abd8aa450930b3e8.tar.gz vyos-strongswan-e0e280b7669435b991b7e457abd8aa450930b3e8.zip |
New upstream version 5.7.0
Diffstat (limited to 'testing/do-tests')
-rwxr-xr-x | testing/do-tests | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/testing/do-tests b/testing/do-tests index 641529533..52d0d70eb 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -444,20 +444,22 @@ do next } printf("cmd_err=\044(tempfile -p test -s err); ") + printf("cmd_out=\044(tempfile -p test -s out); ") if (command == "tcpdump") { printf("if [ \044TDUP_%s == \"true\" ]; then stop_tcpdump %s; fi; \n", host, host) - printf("cmd_out=\044(ssh \044SSHCONF root@\044ipv4_%s cat /tmp/tcpdump.log | grep \"%s\"); ", host, pattern) + printf("ssh \044SSHCONF root@\044ipv4_%s cat /tmp/tcpdump.log > \044cmd_out; ", host) } else { - printf("cmd_out=\044(ssh \044SSHCONF root@\044ipv4_%s %s 2>\044cmd_err | grep \"%s\"); ", host, command, pattern) + printf("ssh \044SSHCONF root@\044ipv4_%s %s >\044cmd_out 2>\044cmd_err; ", host, command) } + printf("cmd_res=\044(cat \044cmd_out | grep \"%s\"); ", pattern) printf("cmd_exit=\044?; ") printf("cmd_fail=0; ") if (hit ~ /^[0-9]+$/) { - printf("if [ \044(echo \"\044cmd_out\" | wc -l) -ne %d ] ", hit) + printf("if [ \044(echo \"\044cmd_res\" | wc -l) -ne %d ] ", hit) } else { @@ -475,9 +477,14 @@ do { printf("echo \"$(print_time)%s# %s | grep \047%s\047 [%s]\"; ", host, command, pattern, hit) } - printf("if [ -n \"\044cmd_out\" ]; then echo \"\044cmd_out\"; fi; \n") - printf("cat \044cmd_err; rm -f -- \044cmd_err; \n") - printf("if [ \044cmd_fail -ne 0 ]; then echo \"~~~~~~~~~~~~~~~~~~~~\"; fi; \n") + printf("if [ -n \"\044cmd_res\" ]; then echo \"\044cmd_res\"; fi; \n") + printf("cat \044cmd_err; \n") + printf("if [ \044cmd_fail -ne 0 ]; then \n") + printf("if [ -s \044cmd_out ]; then echo \"~~ output ~~~~~~~~~~\"; \n") + printf("if [ \"\044verbose\" == \"YES\" ]; then cat \044cmd_out;\n") + printf("else cat \044cmd_out | head; fi; fi; \n") + printf("echo \"~~~~~~~~~~~~~~~~~~~~\"; fi; \n") + printf("rm -f -- \044cmd_out \044cmd_err; \n") printf("echo; ") }' $TESTDIR/evaltest.dat` >> $CONSOLE_LOG 2>&1 |