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
5e72440e
Unverified
Commit
5e72440e
authored
Sep 13, 2022
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that VRT_fail from an object constructor works as expected
parent
b30af4dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
m00000.vtc
bin/varnishtest/tests/m00000.vtc
+9
-1
vmod_debug.vcc
vmod/vmod_debug.vcc
+2
-0
vmod_debug_obj.c
vmod/vmod_debug_obj.c
+4
-0
No files found.
bin/varnishtest/tests/m00000.vtc
View file @
5e72440e
...
...
@@ -165,6 +165,14 @@ varnish v1 -errvcl {Failed from VCL} {
}
}
varnish v1 -errvcl {Failed initialization} {
import debug;
backend none none;
sub vcl_init {
new fails = debug.obj("fail");
}
}
varnish v1 -cliok "param.set vcc_feature +allow_inline_c"
varnish v1 -vcl {
import vtc;
...
...
@@ -289,7 +297,7 @@ varnish v1 -cliok "vcl.list"
varnish v1 -expect vmods == 3
varnish v1 -cliok "vcl.discard vcl[1-9]"
varnish v1 -cliok "vcl.discard vcl[1-9]
vcl10
"
varnish v1 -cliok "vcl.list"
varnish v1 -cliok "debug.vmod"
...
...
vmod/vmod_debug.vcc
View file @
5e72440e
...
...
@@ -73,6 +73,8 @@ $Object obj(STRING string="default", ENUM { one, two, three } number=one)
Test object
Fail for string="fail".
.. NOTE: .enum before .foo as part of test r01332.vtc
$Method VOID .enum(ENUM { phk, des, kristian, mithrandir, martin })
...
...
vmod/vmod_debug_obj.c
View file @
5e72440e
...
...
@@ -60,6 +60,10 @@ xyzzy_obj__init(VRT_CTX, struct xyzzy_debug_obj **op,
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
AN
(
op
);
AZ
(
*
op
);
if
(
!
strcmp
(
s
,
"fail"
))
{
VRT_fail
(
ctx
,
"failing as requested"
);
}
ALLOC_OBJ
(
o
,
VMOD_DEBUG_OBJ_MAGIC
);
AN
(
o
);
*
op
=
o
;
...
...
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