[4.1] 7f77962 Insist that tests start out with the magic string "varnishtest[:whitespace:]"

Lasse Karstensen lkarsten at varnish-software.com
Tue Jun 14 11:42:09 CEST 2016


commit 7f779623e1fb6cca610fd93641707e26582e20c1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed May 4 13:15:34 2016 +0000

    Insist that tests start out with the magic string "varnishtest[:whitespace:]"

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 601f245..1db058c 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -34,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
@@ -529,6 +530,13 @@ main(int argc, char * const *argv)
 				continue;
 			exit(2);
 		}
+		if (strncmp(p, "varnishtest", 11) || !isspace(p[11])) {
+			fprintf(stderr, "File \"%s\" doesn't start with 'varnishtest'\n",
+			    *argv);
+			if (vtc_continue)
+				continue;
+			exit(2);
+		}
 		ALLOC_OBJ(tp, TST_MAGIC);
 		AN(tp);
 		tp->filename = *argv;



More information about the varnish-commit mailing list