[master] 88d648f81 Test more distant corners of varnishhist
Poul-Henning Kamp
phk at FreeBSD.org
Sun Sep 9 14:55:15 UTC 2018
commit 88d648f81d898f66d14fadefb6dfa2257853f9bb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sun Sep 9 14:54:03 2018 +0000
Test more distant corners of varnishhist
diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 1ef81f15f..48bfce265 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -657,8 +657,7 @@ main(int argc, char **argv)
ident = VSM_Dup(vut->vsm, "Arg", "-i");
else
ident = strdup("");
- if (pthread_create(&thr, NULL, do_curses, NULL) != 0)
- VUT_Error(vut, 1, "pthread_create(): %s", strerror(errno));
+ AZ(pthread_create(&thr, NULL, do_curses, NULL));
vut->dispatch_f = accumulate;
vut->dispatch_priv = NULL;
vut->sighup_f = sighup;
diff --git a/bin/varnishtest/tests/u00007.vtc b/bin/varnishtest/tests/u00007.vtc
index 64e9dc7c5..fb3a81a26 100644
--- a/bin/varnishtest/tests/u00007.vtc
+++ b/bin/varnishtest/tests/u00007.vtc
@@ -11,12 +11,14 @@ shell -match "Usage: .*varnishhist <options>" \
"varnishhist -h"
shell -expect "Copyright (c) 2006 Verdens Gang AS" \
"varnishhist -V"
+shell -err -match "Usage: .*varnishhist <options>" \
+ "varnishhist -K"
shell -err -match "Usage: .*varnishhist <options>" \
"varnishhist extra"
shell -err -expect "-p: invalid '0'" \
"varnishhist -p 0"
shell -err -expect "-B: being able to bend time does not mean we can stop it" \
- "varnishhist -B 0"
+ "varnishhist -p 2.0 -B 0"
shell -err -expect "-B: being able to bend time does not mean we can make it go backwards" \
"varnishhist -B -1"
shell -err -expect "Invalid grouping mode: raw" \
@@ -25,5 +27,13 @@ shell -err -expect "-P: No such profile 'foo'" \
"varnishhist -P foo"
shell -err -expect "-P: 'Timestamp:' is not a valid profile name or definition" \
"varnishhist -P Timestamp::"
-shell -err -expect "-P: 'foo::0:0:0' is not a valid tag name" \
- "varnishhist -P foo::0:0:0"
+shell -err -expect "-P: 'b:' is not a valid profile name or definition" \
+ "varnishhist -P b:"
+shell -err -expect "-P: 'foo:' is not a valid tag name" \
+ "varnishhist -P foo:"
+shell -err -expect "-P: 'b:Debug:' is an unsafe or binary record" \
+ "varnishhist -P b:Debug:"
+shell -err -expect "-P: 'b:BereqAcct:x' is not a valid profile name or definition" \
+ "varnishhist -P b:BereqAcct:x"
+shell -err -expect "-P: 'b:BereqAcct:x' is not a valid profile name or definition" \
+ "varnishhist -P b:BereqAcct:x:"
diff --git a/bin/varnishtest/tests/u00009.vtc b/bin/varnishtest/tests/u00009.vtc
index 8b962a63d..df3551cef 100644
--- a/bin/varnishtest/tests/u00009.vtc
+++ b/bin/varnishtest/tests/u00009.vtc
@@ -9,7 +9,7 @@ varnish v1 -vcl+backend {} -start
process p1 -dump {varnishhist -n ${v1_name}} -start
process p2 -dump {varnishhist -n ${v1_name} -P b:BereqAcct::5:1:8} -start
-process p3 -dump {varnishhist -n ${v1_name} -P BerespBodytime} -start
+process p3 -dump {varnishhist -n ${v1_name} -P BerespBodytime -B 2} -start
process p1 -expect-text 24 0 {1e2}
process p2 -expect-text 24 0 {1e2}
@@ -39,6 +39,8 @@ process p1 -winsz 23 80 -need-bytes +10
process p1 -write {0>+-<} -need-bytes +10
+process p3 -write {0>+-<x} -need-bytes +10
+
process p1 -expect-text 2 1 {20_}
process p1 -writehex 0c -need-bytes +10
More information about the varnish-commit
mailing list