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
45190d60
Commit
45190d60
authored
Feb 04, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style polish mostly around vtc_fatal
parent
412961ab
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
110 deletions
+84
-110
vtc.c
bin/varnishtest/vtc.c
+10
-15
vtc_http.c
bin/varnishtest/vtc_http.c
+5
-8
vtc_http2.c
bin/varnishtest/vtc_http2.c
+66
-81
vtc_log.c
bin/varnishtest/vtc_log.c
+1
-2
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+2
-4
No files found.
bin/varnishtest/vtc.c
View file @
45190d60
...
...
@@ -379,10 +379,9 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
for
(
cp
=
cmd
;
cp
->
name
!=
NULL
;
cp
++
)
if
(
!
strcmp
(
token_s
[
0
],
cp
->
name
))
break
;
if
(
cp
->
name
==
NULL
)
{
if
(
cp
->
name
==
NULL
)
vtc_fatal
(
vl
,
"Unknown command:
\"
%s
\"
"
,
token_s
[
0
]);
NEEDLESS
(
return
);
}
assert
(
cp
->
cmd
!=
NULL
);
cp
->
cmd
(
token_s
,
priv
,
cmd
,
vl
);
...
...
@@ -506,11 +505,10 @@ cmd_shell_engine(struct vtclog *vl, int ok, const char *cmd,
if
(
ok
<
0
&&
!
WEXITSTATUS
(
r
)
&&
!
WIFSIGNALED
(
r
))
vtc_fatal
(
vl
,
"shell did not fail as expected"
);
else
if
(
ok
>=
0
&&
WEXITSTATUS
(
r
)
!=
ok
)
{
vtc_fatal
(
vl
,
"shell_exit not as expected: got 0x%04x wanted 0x%04x"
,
WEXITSTATUS
(
r
),
ok
);
}
else
if
(
ok
>=
0
&&
WEXITSTATUS
(
r
)
!=
ok
)
vtc_fatal
(
vl
,
"shell_exit not as expected: "
"got 0x%04x wanted 0x%04x"
,
WEXITSTATUS
(
r
),
ok
);
if
(
expect
!=
NULL
)
{
if
(
strstr
(
VSB_data
(
vsb
),
expect
)
==
NULL
)
vtc_fatal
(
vl
,
...
...
@@ -709,9 +707,8 @@ cmd_feature(CMD_ARGS)
#endif
}
else
if
(
!
strcmp
(
*
av
,
"cmd"
))
{
av
++
;
if
(
*
av
==
NULL
)
{
if
(
*
av
==
NULL
)
vtc_fatal
(
vl
,
"Missing the command-line"
);
}
r
=
system
(
*
av
);
if
(
WEXITSTATUS
(
r
)
==
0
)
good
=
1
;
...
...
@@ -721,13 +718,11 @@ cmd_feature(CMD_ARGS)
if
(
good
)
continue
;
if
(
!
vtc_stop
)
{
vtc_fatal
(
vl
,
"FAIL test, unknown feature: %s"
,
*
av
);
}
else
{
if
(
!
vtc_stop
)
vtc_fatal
(
vl
,
"FAIL test, unknown feature: %s"
,
*
av
);
else
vtc_log
(
vl
,
1
,
"SKIPPING test, lacking feature: %s"
,
*
av
);
}
return
;
}
}
...
...
bin/varnishtest/vtc_http.c
View file @
45190d60
...
...
@@ -1114,8 +1114,7 @@ cmd_http_rxreq(CMD_ARGS)
http_rxhdr
(
hp
);
http_splitheader
(
hp
,
1
);
if
(
http_count_header
(
hp
->
req
,
"Content-Length"
)
>
1
)
vtc_fatal
(
vl
,
"Multiple Content-Length headers.
\n
"
);
vtc_fatal
(
vl
,
"Multiple Content-Length headers.
\n
"
);
http_swallow_body
(
hp
,
hp
->
req
,
0
);
vtc_log
(
vl
,
4
,
"bodylen = %s"
,
hp
->
bodylen
);
}
...
...
@@ -1142,8 +1141,7 @@ cmd_http_rxreqhdrs(CMD_ARGS)
http_rxhdr
(
hp
);
http_splitheader
(
hp
,
1
);
if
(
http_count_header
(
hp
->
req
,
"Content-Length"
)
>
1
)
vtc_fatal
(
hp
->
vl
,
"Multiple Content-Length headers.
\n
"
);
vtc_fatal
(
hp
->
vl
,
"Multiple Content-Length headers.
\n
"
);
}
/* SECTION: client-server.spec.rxreqbody
...
...
@@ -1666,9 +1664,8 @@ cmd_http_fatal(CMD_ARGS)
hp
->
fatal
=
0
;
else
if
(
!
strcmp
(
av
[
0
],
"non_fatal"
))
hp
->
fatal
=
-
1
;
else
{
else
vtc_fatal
(
vl
,
"XXX: fatal %s"
,
cmd
->
name
);
}
}
#define cmd_http_non_fatal cmd_http_fatal
...
...
@@ -1764,8 +1761,8 @@ cmd_http_settings(CMD_ARGS)
if
(
!
strcmp
(
*
av
,
"-dectbl"
))
{
n
=
strtoul
(
av
[
1
],
&
p
,
0
);
if
(
*
p
!=
'\0'
)
vtc_fatal
(
hp
->
vl
,
"-dectbl takes an integer as"
"
argument (found %s)"
,
av
[
1
]);
vtc_fatal
(
hp
->
vl
,
"-dectbl takes an integer as
"
"
argument (found %s)"
,
av
[
1
]);
HPK_ResizeTbl
(
hp
->
decctx
,
n
);
av
++
;
}
else
...
...
bin/varnishtest/vtc_http2.c
View file @
45190d60
This diff is collapsed.
Click to expand it.
bin/varnishtest/vtc_log.c
View file @
45190d60
...
...
@@ -281,10 +281,9 @@ vtc_log_VAS_Fail(const char *func, const char *file, int line,
"Assert error in %s(), %s line %d:
\n
"
" Condition(%s) not true.
\n
"
,
func
,
file
,
line
,
cond
);
}
else
{
}
else
vtc_fatal
(
vl
,
"Assert error in %s(), %s line %d:"
" Condition(%s) not true.
\n
"
,
func
,
file
,
line
,
cond
);
}
abort
();
}
...
...
bin/varnishtest/vtc_varnish.c
View file @
45190d60
...
...
@@ -744,9 +744,8 @@ varnish_vcl(struct varnish *v, const char *vcl, int fail, char **resp)
}
else
if
(
u
!=
CLIS_OK
&&
!
fail
)
{
VSB_destroy
(
&
vsb
);
vtc_fatal
(
v
->
vl
,
"VCL compilation failed expected success"
);
}
else
if
(
fail
)
{
}
else
if
(
fail
)
vtc_log
(
v
->
vl
,
2
,
"VCL compilation failed (as expected)"
);
}
VSB_destroy
(
&
vsb
);
}
...
...
@@ -957,9 +956,8 @@ varnish_expect(const struct varnish *v, char * const *av)
else
if
(
!
strcmp
(
av
[
1
],
"<"
))
{
if
(
sp
.
val
<
ref
)
good
=
1
;
}
else
if
(
!
strcmp
(
av
[
1
],
">="
))
{
if
(
sp
.
val
>=
ref
)
good
=
1
;
}
else
if
(
!
strcmp
(
av
[
1
],
"<="
))
{
if
(
sp
.
val
<=
ref
)
good
=
1
;
}
else
{
else
vtc_fatal
(
v
->
vl
,
"comparison %s unknown"
,
av
[
1
]);
}
if
(
good
)
break
;
}
...
...
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