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
2dfb0dee
Commit
2dfb0dee
authored
Sep 10, 2021
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vtc: Fail unattended logs with logexpect
parent
9091a9ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
m00022.vtc
bin/varnishtest/tests/m00022.vtc
+5
-5
m00027.vtc
bin/varnishtest/tests/m00027.vtc
+13
-1
No files found.
bin/varnishtest/tests/m00022.vtc
View file @
2dfb0dee
...
...
@@ -8,9 +8,10 @@ server s1 {
varnish v1 -vcl+backend { } -start
logexpect l1 -v v1 -g raw {
expect * 0 VCL_Log "Should happen first"
expect 0 0 VCL_Log "Should happen second"
fail add * VCL_Log "Should not happen"
expect * 0 VCL_Log "Should happen first"
expect 0 0 VCL_Log "Should happen second"
fail clear
} -start
varnish v1 -errvcl "Forced failure" {
...
...
@@ -27,6 +28,7 @@ varnish v1 -errvcl "Forced failure" {
debug.fail();
std.log("Should not happen");
}
sub vcl_fini {
std.log("Should happen second");
}
...
...
@@ -34,8 +36,6 @@ varnish v1 -errvcl "Forced failure" {
logexpect l1 -wait
shell -match "^$" {varnishlog -n ${v1_name} -d -g raw -I "Should not happen"}
varnish v1 -cliok "param.set nuke_limit 42"
varnish v1 -errvcl "nuke_limit is not the answer." {
...
...
bin/varnishtest/tests/m00027.vtc
View file @
2dfb0dee
...
...
@@ -4,6 +4,13 @@ server s1 { } -start
varnish v1 -vcl+backend { } -start
logexpect l1 -v v1 -g raw {
fail add * VCL_Log "Should not happen"
expect * 0 VCL_Log "Should happen first"
expect 0 0 VCL_Log "Should happen second"
fail clear
} -start
varnish v1 -errvcl "Missing dynamic backend address or port" {
import debug;
import std;
...
...
@@ -13,9 +20,14 @@ varnish v1 -errvcl "Missing dynamic backend address or port" {
}
sub vcl_init {
std.log("Should happen first");
new objx = debug.dyn("", "");
std.log("Should not happen");
}
sub vcl_fini {
std.log("Should happen second");
}
}
shell -match "^$" {varnishlog -n ${v1_name} -d -g raw -I "Should not happen"}
logexpect l1 -wait
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