[master] ab72ccd It's more useful to emit the shell's stdout/stderr before failing the exit code test, than not doing so afterwards.

Poul-Henning Kamp phk at FreeBSD.org
Fri Jan 20 20:59:04 CET 2017


commit ab72ccd7eade8f9c178fe397cee63d8b24679a04
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Jan 20 19:57:19 2017 +0000

    It's more useful to emit the shell's stdout/stderr before failing
    the exit code test, than not doing so afterwards.

diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 8f29889..a5d51ac 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -485,6 +485,8 @@ cmd_shell_engine(struct vtclog *vl, int ok,
 			VSB_putc(vsb, c);
 	} while (c != EOF);
 	r = pclose(fp);
+	AZ(VSB_finish(vsb));
+	vtc_dump(vl, 4, "shell_out", VSB_data(vsb), VSB_len(vsb));
 	vtc_log(vl, 4, "shell_status = 0x%04x", WEXITSTATUS(r));
 	if (WIFSIGNALED(r))
 		vtc_log(vl, 4, "shell_signal = %d", WTERMSIG(r));
@@ -495,8 +497,6 @@ cmd_shell_engine(struct vtclog *vl, int ok,
 		    "shell_exit not as expected: got 0x%04x wanted 0x%04x",
 			WEXITSTATUS(r), ok);
 	}
-	AZ(VSB_finish(vsb));
-	vtc_dump(vl, 4, "shell_out", VSB_data(vsb), VSB_len(vsb));
 	if (expect != NULL) {
 		if (strstr(VSB_data(vsb), expect) == NULL)
 			vtc_fatal(vl,



More information about the varnish-commit mailing list