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
d2d9a685
Commit
d2d9a685
authored
Mar 10, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to expect that a VSC counter is not there by:
varnish ${id} -expect !${vsc-identifier}
parent
51c8c256
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+23
-7
No files found.
bin/varnishtest/vtc_varnish.c
View file @
d2d9a685
...
...
@@ -762,18 +762,24 @@ static void
varnish_expect
(
const
struct
varnish
*
v
,
char
*
const
*
av
)
{
uint64_t
ref
;
int
good
;
char
*
r
;
char
*
p
;
char
*
q
;
int
i
;
int
i
,
not
=
0
;
struct
stat_priv
sp
;
p
=
strchr
(
av
[
0
],
'.'
);
r
=
av
[
0
];
if
(
r
[
0
]
==
'!'
)
{
not
=
1
;
r
++
;
}
p
=
strchr
(
r
,
'.'
);
if
(
p
==
NULL
)
{
strcpy
(
sp
.
target_type
,
"MAIN"
);
sp
.
target_ident
[
0
]
=
'\0'
;
bprintf
(
sp
.
target_name
,
"%s"
,
av
[
0
]
);
bprintf
(
sp
.
target_name
,
"%s"
,
r
);
}
else
{
bprintf
(
sp
.
target_type
,
"%.*s"
,
(
int
)(
p
-
av
[
0
]),
av
[
0
]
);
bprintf
(
sp
.
target_type
,
"%.*s"
,
(
int
)(
p
-
r
),
r
);
p
++
;
q
=
strrchr
(
p
,
'.'
);
bprintf
(
sp
.
target_name
,
"%s"
,
q
+
1
);
...
...
@@ -801,6 +807,9 @@ varnish_expect(const struct varnish *v, char * const *av) {
continue
;
}
if
(
not
)
vtc_log
(
v
->
vl
,
0
,
"Found (not expected): %s"
,
av
[
0
]
+
1
);
good
=
0
;
ref
=
strtoumax
(
av
[
2
],
&
p
,
0
);
if
(
ref
==
UINTMAX_MAX
||
*
p
)
...
...
@@ -819,10 +828,17 @@ varnish_expect(const struct varnish *v, char * const *av) {
}
if
(
good
==
-
1
)
{
vtc_log
(
v
->
vl
,
0
,
"VSM error: %s"
,
VSM_Error
(
v
->
vd
));
VSM_ResetError
(
v
->
vd
);
}
else
if
(
good
==
-
2
)
{
}
if
(
good
==
-
2
)
{
if
(
not
)
{
vtc_log
(
v
->
vl
,
2
,
"not found (as expected): %s"
,
av
[
0
]
+
1
);
return
;
}
vtc_log
(
v
->
vl
,
0
,
"stats field %s unknown"
,
av
[
0
]);
}
else
if
(
good
)
{
}
if
(
good
==
1
)
{
vtc_log
(
v
->
vl
,
2
,
"as expected: %s (%ju) %s %s"
,
av
[
0
],
sp
.
val
,
av
[
1
],
av
[
2
]);
}
else
{
...
...
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