Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
44ab9990
Commit
44ab9990
authored
Jan 20, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge, simplify and add more coverage
parent
ff65c2f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
79 deletions
+95
-79
u00001.vtc
bin/varnishtest/tests/u00001.vtc
+0
-43
u00003.vtc
bin/varnishtest/tests/u00003.vtc
+51
-15
u00006.vtc
bin/varnishtest/tests/u00006.vtc
+35
-12
u00007.vtc
bin/varnishtest/tests/u00007.vtc
+9
-9
No files found.
bin/varnishtest/tests/u00001.vtc
deleted
100644 → 0
View file @
ff65c2f4
varnishtest "varnishncsa log file rotation"
server s1 {
rxreq
expect req.url == "/foo"
txresp -status 200
rxreq
expect req.url == "/bar"
txresp -status 404
} -start
varnish v1 -vcl+backend "" -start
shell "varnishncsa -D -P ${tmpdir}/ncsa.pid -n ${v1_name} -w ${tmpdir}/ncsa.log -F %s"
# give varnishncsa enough time to open the VSM
delay 2
client c1 {
txreq -url "/foo"
rxresp
} -run
# give varnishncsa enough time to write
delay 2
# rotate logs
shell "mv ${tmpdir}/ncsa.log ${tmpdir}/ncsa.old.log >/dev/null 2>&1"
shell "kill -HUP `cat ${tmpdir}/ncsa.pid`"
client c1 {
txreq -url "/bar"
rxresp
} -run
# give varnishncsa enough time to write
delay 2
shell "kill `cat ${tmpdir}/ncsa.pid`"
shell "grep 200 ${tmpdir}/ncsa.old.log >/dev/null"
shell "grep 404 ${tmpdir}/ncsa.log >/dev/null"
bin/varnishtest/tests/u00003.vtc
View file @
44ab9990
varnishtest "varnishncsa
error handling
"
varnishtest "varnishncsa
coverage
"
server s1 {
server s1
-repeat 2
{
rxreq
rxreq
txresp
txresp
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
shell "varnishncsa -n ${v1_name} -D -P ${tmpdir}/ncsa.pid -w ${tmpdir}/ncsa.log"
shell -err -expect "Missing -w option" \
shell -err -expect "Missing -w option" \
{varnishncsa -
n ${v1_name} -
D}
{varnishncsa -D}
shell -err -expect "Unknown format specifier at: %{foo}A" \
shell -err -expect "Unknown format specifier at: %{foo}A" \
{varnishncsa -
n ${v1_name} -
F "%{foo}A"}
{varnishncsa -F "%{foo}A"}
shell -err -expect "Unknown format specifier at: %A" \
shell -err -expect "Unknown format specifier at: %A" \
{varnishncsa -n ${v1_name} -F "%A"}
{varnishncsa -F "%A"}
shell -err -expect "Unknown formatting extension: foo" \
{varnishncsa -F "%{foo}x"}
shell -err -expect "Usage: varnishncsa <options>" \
shell -err -expect "Usage: varnishncsa <options>" \
{varnishncsa
-n ${v1_name}
extra}
{varnishncsa extra}
shell -err -expect "Missing tag in VSL:" \
shell -err -expect "Missing tag in VSL:" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:}x"}
{varnishncsa -F "%{VSL:}x"}
shell -err -expect "Unknown log tag: nonexistent" \
shell -err -expect "Unknown log tag: nonexistent" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:nonexistent}x"}
{varnishncsa -F "%{VSL:nonexistent}x"}
shell -err -expect "Tag not unique: Req" \
shell -err -expect "Tag not unique: Req" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Req}x"}
{varnishncsa -F "%{VSL:Req}x"}
shell -err -expect "Unknown log tag: Begin[" \
shell -err -expect "Unknown log tag: Begin[" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Begin[}x"}
{varnishncsa -F "%{VSL:Begin[}x"}
shell -err -expect "Syntax error: VSL:Begin]" \
shell -err -expect "Syntax error: VSL:Begin]" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Begin]}x"}
{varnishncsa -F "%{VSL:Begin]}x"}
shell -err -expect "Unknown log tag: Begin[a" \
shell -err -expect "Unknown log tag: Begin[a" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Begin[a}x"}
{varnishncsa -F "%{VSL:Begin[a}x"}
shell -err -expect "Syntax error: VSL:Begin[a]" \
shell -err -expect "Syntax error: VSL:Begin[a]" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Begin[a]}x"}
{varnishncsa -F "%{VSL:Begin[a]}x"}
shell -err -expect "Syntax error. Field specifier must be positive: Begin[0]" \
shell -err -expect "Syntax error. Field specifier must be positive: Begin[0]" \
{varnishncsa -
n ${v1_name} -
F "%{VSL:Begin[0]}x"}
{varnishncsa -F "%{VSL:Begin[0]}x"}
shell -err -expect "Field specifier 999999999999 for the tag VSL:Begin[999999999999] is probably too high" \
shell -err -expect "Field specifier 999999999999 for the tag VSL:Begin[999999999999] is probably too high" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[999999999999]}x"}
{varnishncsa -F "%{VSL:Begin[999999999999]}x"}
shell -err -expect "Can't open format file (No such file or directory)" \
{varnishncsa -n ${v1_name} -f /nonexistent}
shell -err -expect "Empty format file" \
{varnishncsa -n ${v1_name} -f /dev/null}
delay 1
client c1 {
txreq -url /foo
rxresp
} -run
delay 1
shell "mv ${tmpdir}/ncsa.log ${tmpdir}/ncsa.old.log >/dev/null 2>&1"
shell "kill -HUP `cat ${tmpdir}/ncsa.pid`"
client c1 {
txreq -url /bar
rxresp
} -run
delay 1
shell "kill `cat ${tmpdir}/ncsa.pid`"
shell "grep -q /foo ${tmpdir}/ncsa.old.log"
shell "grep -q /bar ${tmpdir}/ncsa.log"
shell {echo "%{VSL:Begin}x %{Varnish:vxid}x %D %T %{Varnish:handling}x %{%Z}t" >${tmpdir}/format}
shell -expect "0 miss GMT" \
{varnishncsa -n ${v1_name} -d -f ${tmpdir}/format}
bin/varnishtest/tests/u00006.vtc
View file @
44ab9990
varnishtest "varnishlog coverage"
varnishtest "varnishlog coverage"
server s1 {
server s1
-repeat 2
{
rxreq
rxreq
txresp
txresp
} -start
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
process p1 "exec varnishlog -n ${v1_name} -g raw -k 1" -start
process p1 {
process p2 {
exec varnishlog -n ${v1_name} -g raw -k 3 -w ${tmpdir}/vlog -A
exec varnishlog -n ${v1_name} -g raw -k 1 -w ${tmpdir}/p2/output -A
} -start
process p3 {
exec varnishlog -n ${v1_name} -g raw -k 1 -w ${tmpdir}/p3/output.bin
} -start
} -start
shell {
exec varnishlog -n ${v1_name} -D -P ${tmpdir}/vlog.pid \
-w ${tmpdir}/vlog.bin
}
shell -expect "Usage: varnishlog <options>" \
shell -expect "Usage: varnishlog <options>" \
"varnishlog -h"
"varnishlog -h"
shell -expect "Copyright (c) 2006 Verdens Gang AS" \
shell -expect "Copyright (c) 2006 Verdens Gang AS" \
...
@@ -38,9 +39,31 @@ shell -err -expect {-x: Syntax error in "**"} \
...
@@ -38,9 +39,31 @@ shell -err -expect {-x: Syntax error in "**"} \
{varnishlog -x "**"}
{varnishlog -x "**"}
shell -err -expect {-X: Syntax error in "**"} \
shell -err -expect {-X: Syntax error in "**"} \
{varnishlog -X "**:bar"}
{varnishlog -X "**:bar"}
process p1 -wait
process p1 -wait
shell {grep -q "0 CLI" ${p1_out}}
shell {grep -q "0 CLI" ${tmpdir}/vlog}
process p2 -wait
shell -expect "0 CLI" "varnishlog -n ${v1_name} -d -g raw"
shell {grep -q "0 CLI" ${p2_dir}/output}
process p3 -wait
client c1 {
shell -expect "0 CLI" {varnishlog -g raw -r ${p3_dir}/output.bin}
txreq -url /foo
rxresp
} -run
delay 1
shell "mv ${tmpdir}/vlog.bin ${tmpdir}/vlog.bin~ >/dev/null 2>&1"
shell "kill -HUP `cat ${tmpdir}/vlog.pid`"
client c1 {
txreq -url /bar
rxresp
} -run
delay 1
shell "kill `cat ${tmpdir}/vlog.pid`"
shell -expect "/foo" {
varnishlog -r ${tmpdir}/vlog.bin~ -i ReqURL -q "RespStatus == 200"
}
shell -expect "/bar" "varnishlog -r ${tmpdir}/vlog.bin -x ReqURL"
bin/varnishtest/tests/u00007.vtc
View file @
44ab9990
...
@@ -8,20 +8,20 @@ server s1 {
...
@@ -8,20 +8,20 @@ server s1 {
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {} -start
shell -expect "Usage: varnishhist <options>" \
shell -expect "Usage: varnishhist <options>" \
"varnishhist -
n ${v1_name} -
h"
"varnishhist -h"
shell -err -expect "Usage: varnishhist <options>" \
shell -err -expect "Usage: varnishhist <options>" \
"varnishhist
-n ${v1_name}
extra"
"varnishhist extra"
shell -err -expect "-p: invalid '0'" \
shell -err -expect "-p: invalid '0'" \
"varnishhist -
n ${v1_name} -
p 0"
"varnishhist -p 0"
shell -err -expect "-B: being able to bend time does not mean we can stop it" \
shell -err -expect "-B: being able to bend time does not mean we can stop it" \
"varnishhist -
n ${v1_name} -
B 0"
"varnishhist -B 0"
shell -err -expect "-B: being able to bend time does not mean we can make it go backwards" \
shell -err -expect "-B: being able to bend time does not mean we can make it go backwards" \
"varnishhist -
n ${v1_name} -
B -1"
"varnishhist -B -1"
shell -err -expect "Invalid grouping mode: raw" \
shell -err -expect "Invalid grouping mode: raw" \
"varnishhist -
n ${v1_name} -
g raw"
"varnishhist -g raw"
shell -err -expect "-P: No such profile 'foo'" \
shell -err -expect "-P: No such profile 'foo'" \
"varnishhist -
n ${v1_name} -
P foo"
"varnishhist -P foo"
shell -err -expect "-P: 'foo:bar' is not a valid profile name or definition" \
shell -err -expect "-P: 'foo:bar' is not a valid profile name or definition" \
"varnishhist -
n ${v1_name} -
P foo:bar"
"varnishhist -P foo:bar"
shell -err -expect "-P: 'foo:0:0:0' is not a valid tag name" \
shell -err -expect "-P: 'foo:0:0:0' is not a valid tag name" \
"varnishhist -
n ${v1_name} -
P foo:0:0:0"
"varnishhist -P foo:0:0:0"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment