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
eb34cf52
Commit
eb34cf52
authored
Jan 15, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace with shell command and simplify some cases
parent
a96bfb0a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
67 deletions
+60
-67
r02148.vtc
bin/varnishtest/tests/r02148.vtc
+4
-4
u00000.vtc
bin/varnishtest/tests/u00000.vtc
+3
-3
u00002.vtc
bin/varnishtest/tests/u00002.vtc
+1
-3
u00003.vtc
bin/varnishtest/tests/u00003.vtc
+13
-25
u00005.vtc
bin/varnishtest/tests/u00005.vtc
+16
-14
u00006.vtc
bin/varnishtest/tests/u00006.vtc
+11
-8
u00007.vtc
bin/varnishtest/tests/u00007.vtc
+12
-10
No files found.
bin/varnishtest/tests/r02148.vtc
View file @
eb34cf52
...
...
@@ -14,7 +14,7 @@ client c1 {
delay 1
process p1 {varnishncsa -d -n ${v1_name} -F "%u %{Host}i"} -run
shell {grep -q "foo qux" ${tmpdir}/p1/stdout
}
process p2 {varnishncsa -d -n ${v1_name} -F "%r"} -run
shell {grep -q "GET http://qux/ HTTP/1.1" ${tmpdir}/p2/stdout
}
shell -expect "foo qux" \
{varnishncsa -d -n ${v1_name} -F "%u %{Host}i"
}
shell -expect "GET http://qux/ HTTP/1.1" \
{varnishncsa -d -n ${v1_name} -F "%r"
}
bin/varnishtest/tests/u00000.vtc
View file @
eb34cf52
...
...
@@ -24,9 +24,9 @@ process p2 -wait
process p3 -wait
# check stdout
shell "grep
foo ${tmpdir}/p1/stdout >/dev/null 2>&1
"
shell "grep
bar ${tmpdir}/p2/stdout >/dev/null 2>&1
"
shell "grep
baz ${tmpdir}/p3/stdout >/dev/null 2>&1
"
shell "grep
-q foo ${tmpdir}/p1/stdout
"
shell "grep
-q bar ${tmpdir}/p2/stdout
"
shell "grep
-q baz ${tmpdir}/p3/stdout
"
# check stderr
shell "test -f ${tmpdir}/p1/stderr -a ! -s ${tmpdir}/p1/stderr"
...
...
bin/varnishtest/tests/u00002.vtc
View file @
eb34cf52
...
...
@@ -28,6 +28,4 @@ shell -err "grep -q LCK.vbe.destroy ${tmpdir}/p2/stdout"
shell "cmp -s ${tmpdir}/p1/stdout ${tmpdir}/p2/stdout"
process p3 {varnishstat -1 -n ${v1_name} -f MAIN.cache_hit} -run
shell "grep -q cache_hit ${tmpdir}/p3/stdout"
shell -expect "cache_hit" "varnishstat -1 -n ${v1_name} -f MAIN.cache_hit"
bin/varnishtest/tests/u00003.vtc
View file @
eb34cf52
...
...
@@ -8,40 +8,28 @@ server s1 {
varnish v1 -vcl+backend {} -start
shell -err -expect "Missing -w option" \
{varnishncsa -n ${v1_name} -D 2>&1}
{varnishncsa -n ${v1_name} -D}
shell -err -expect "Unknown format specifier at: %{foo}A" \
{varnishncsa -n ${v1_name} -F "%{foo}A" 2>&1}
{varnishncsa -n ${v1_name} -F "%{foo}A"}
shell -err -expect "Unknown format specifier at: %A" \
{varnishncsa -n ${v1_name} -F "%A" 2>&1}
{varnishncsa -n ${v1_name} -F "%A"}
shell -err -expect "Usage: varnishncsa <options>" \
{varnishncsa -n ${v1_name} extra 2>&1}
{varnishncsa -n ${v1_name} extra}
shell -err -expect "Missing tag in VSL:" \
{varnishncsa -n ${v1_name} -F "%{VSL:}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:}x"}
shell -err -expect "Unknown log tag: nonexistent" \
{varnishncsa -n ${v1_name} -F "%{VSL:nonexistent}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:nonexistent}x"}
shell -err -expect "Tag not unique: Req" \
{varnishncsa -n ${v1_name} -F "%{VSL:Req}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Req}x"}
shell -err -expect "Unknown log tag: Begin[" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[}x"}
shell -err -expect "Syntax error: VSL:Begin]" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin]}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin]}x"}
shell -err -expect "Unknown log tag: Begin[a" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[a}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[a}x"}
shell -err -expect "Syntax error: VSL:Begin[a]" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[a]}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[a]}x"}
shell -err -expect "Syntax error. Field specifier must be positive: Begin[0]" \
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[0]}x" 2>&1}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[0]}x"}
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"
2>&1
}
{varnishncsa -n ${v1_name} -F "%{VSL:Begin[999999999999]}x"}
bin/varnishtest/tests/u00005.vtc
View file @
eb34cf52
...
...
@@ -7,17 +7,19 @@ server s1 {
varnish v1 -vcl+backend {} -start
process p1 "exec varnishstat -n ${v1_name} -h" -run
shell {grep -q "Usage: varnishstat <options>" ${tmpdir}/p1/stderr}
process p2 "exec varnishstat -n ${v1_name} -l" -run
shell {grep -q "Varnishstat -f option fields:" ${tmpdir}/p2/stdout}
process p3 "exec varnishstat -n ${v1_name} -V" -run
shell {grep -q "Copyright (c) 2006 Verdens Gang AS" ${tmpdir}/p3/stderr}
process p4 "exec varnishstat -n ${v1_name} -1" -run
shell {grep -q "MAIN.uptime" ${tmpdir}/p4/stdout}
process p5 "exec varnishstat -n ${v1_name} -x" -run
shell {grep -q "<type>MAIN</type>" ${tmpdir}/p5/stdout}
process p6 "exec varnishstat -n ${v1_name} -j" -run
shell {grep -q "MAIN.uptime\":" ${tmpdir}/p6/stdout}
shell -err -expect "Usage: varnishstat <options>" "varnishstat -n ${v1_name} extra 2>&1"
shell -err -expect "Cannot open /nonexistent/_.vsm" "varnishstat -n /nonexistent 2>&1"
shell -expect "Usage: varnishstat <options>" \
"varnishstat -n ${v1_name} -h"
shell -expect "Varnishstat -f option fields:" \
"varnishstat -n ${v1_name} -l"
shell -expect "Copyright (c) 2006 Verdens Gang AS" \
"varnishstat -n ${v1_name} -V"
shell -expect "MAIN.uptime" \
"varnishstat -n ${v1_name} -1"
shell -expect "<type>MAIN</type>" \
"varnishstat -n ${v1_name} -x"
shell -expect "MAIN.uptime\":" \
"varnishstat -n ${v1_name} -j"
shell -err -expect "Usage: varnishstat <options>" \
"varnishstat -n ${v1_name} extra"
shell -err -expect "Cannot open /nonexistent/_.vsm" \
"varnishstat -n /nonexistent"
bin/varnishtest/tests/u00006.vtc
View file @
eb34cf52
...
...
@@ -14,16 +14,19 @@ process p2 {
process p3 {
exec varnishlog -n ${v1_name} -g raw -k 1 -w ${tmpdir}/p3/output.bin
} -start
process p4 "exec varnishlog -n ${v1_name} -h" -run
shell {grep -q "Usage: varnishlog <options>" ${tmpdir}/p4/stderr}
process p5 "exec varnishlog -n ${v1_name} -V" -run
shell {grep -q "Copyright (c) 2006 Verdens Gang AS" ${tmpdir}/p5/stderr}
shell -err -expect "Usage: varnishlog <options>" "varnishlog -n ${v1_name} extra 2>&1"
shell -err -expect "Missing -w option" "varnishlog -n ${v1_name} -D 2>&1"
shell -err -expect "-L: Range error" "varnishlog -n ${v1_name} -L 0 2>&1"
shell -expect "Usage: varnishlog <options>" \
"varnishlog -n ${v1_name} -h"
shell -expect "Copyright (c) 2006 Verdens Gang AS" \
"varnishlog -n ${v1_name} -V"
shell -err -expect "Usage: varnishlog <options>" \
"varnishlog -n ${v1_name} extra"
shell -err -expect "Missing -w option" \
"varnishlog -n ${v1_name} -D"
shell -err -expect "-L: Range error" \
"varnishlog -n ${v1_name} -L 0"
process p1 -wait
shell {grep -q "0 CLI" ${tmpdir}/p1/stdout}
process p2 -wait
shell {grep -q "0 CLI" ${tmpdir}/p2/output}
process p3 -wait
shell
{varnishlog -g raw -r ${tmpdir}/p3/output.bin | grep -q "0 CLI"
}
shell
-expect "0 CLI" {varnishlog -g raw -r ${tmpdir}/p3/output.bin
}
bin/varnishtest/tests/u00007.vtc
View file @
eb34cf52
...
...
@@ -7,19 +7,21 @@ server s1 {
varnish v1 -vcl+backend {} -start
process p1 "exec varnishhist -n ${v1_name} -h" -run
shell {grep -q "Usage: varnishhist <options>" ${tmpdir}/p1/stderr}
shell -expect "Usage: varnishhist <options>" \
"varnishhist -n ${v1_name} -h"
shell -err -expect "Usage: varnishhist <options>" \
"varnishhist -n ${v1_name} extra 2>&1"
shell -err -expect "-p: invalid '0'" "varnishhist -n ${v1_name} -p 0 2>&1"
"varnishhist -n ${v1_name} extra"
shell -err -expect "-p: invalid '0'" \
"varnishhist -n ${v1_name} -p 0"
shell -err -expect "-B: being able to bend time does not mean we can stop it" \
"varnishhist -n ${v1_name} -B 0 2>&1"
shell -err -expect "-B: being able to bend time does not mean we can make it go backwards" "varnishhist -n ${v1_name} -B -1 2>&1"
"varnishhist -n ${v1_name} -B 0"
shell -err -expect "-B: being able to bend time does not mean we can make it go backwards" \
"varnishhist -n ${v1_name} -B -1"
shell -err -expect "Invalid grouping mode: raw" \
"varnishhist -n ${v1_name} -g raw 2>&1
"
"varnishhist -n ${v1_name} -g raw
"
shell -err -expect "-P: No such profile 'foo'" \
"varnishhist -n ${v1_name} -P foo 2>&1
"
"varnishhist -n ${v1_name} -P foo
"
shell -err -expect "-P: 'foo:bar' is not a valid profile name or definition" \
"varnishhist -n ${v1_name} -P foo:bar 2>&1
"
"varnishhist -n ${v1_name} -P foo:bar
"
shell -err -expect "-P: 'foo:0:0:0' is not a valid tag name" \
"varnishhist -n ${v1_name} -P foo:0:0:0 2>&1
"
"varnishhist -n ${v1_name} -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