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
109f441c
Commit
109f441c
authored
Sep 26, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move 'delay', 'shell' and 'barrier' to a new category of "global" commands.
parent
bc13919d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
48 deletions
+45
-48
cmds.h
bin/varnishtest/cmds.h
+24
-16
vtc.c
bin/varnishtest/vtc.c
+14
-1
vtc.h
bin/varnishtest/vtc.h
+2
-1
vtc_barrier.c
bin/varnishtest/vtc_barrier.c
+1
-2
vtc_http.c
bin/varnishtest/vtc_http.c
+0
-18
vtc_http2.c
bin/varnishtest/vtc_http2.c
+0
-7
vtc_misc.c
bin/varnishtest/vtc_misc.c
+4
-3
No files found.
bin/varnishtest/cmds.h
View file @
109f441c
...
...
@@ -29,21 +29,29 @@
/*lint -save -e525 -e539 */
CMD
(
barrier
)
CMD
(
client
)
CMD
(
delay
)
CMD
(
err_shell
)
CMD
(
feature
)
CMD
(
haproxy
)
CMD
(
logexpect
)
CMD
(
process
)
CMD
(
server
)
CMD
(
setenv
)
CMD
(
shell
)
CMD
(
syslog
)
CMD
(
varnish
)
CMD
(
varnishtest
)
CMD
(
vtest
)
#undef CMD
#ifndef CMD_GLOBAL
#define CMD_GLOBAL(x)
#endif
CMD_GLOBAL
(
barrier
)
CMD_GLOBAL
(
delay
)
CMD_GLOBAL
(
shell
)
#undef CMD_GLOBAL
#ifndef CMD_TOP
#define CMD_TOP(x)
#endif
CMD_TOP
(
client
)
CMD_TOP
(
err_shell
)
CMD_TOP
(
feature
)
CMD_TOP
(
haproxy
)
CMD_TOP
(
logexpect
)
CMD_TOP
(
process
)
CMD_TOP
(
server
)
CMD_TOP
(
setenv
)
CMD_TOP
(
syslog
)
CMD_TOP
(
varnish
)
CMD_TOP
(
varnishtest
)
CMD_TOP
(
vtest
)
#undef CMD_TOP
/*lint -restore */
bin/varnishtest/vtc.c
View file @
109f441c
...
...
@@ -290,6 +290,13 @@ macro_expand(struct vtclog *vl, const char *text)
* Static checkers like Coverity may bitch about this, but we don't care.
*/
static
const
struct
cmds
global_cmds
[]
=
{
#define CMD_GLOBAL(n) { #n, cmd_##n },
#include "cmds.h"
{
NULL
,
NULL
}
};
void
parse_string
(
const
char
*
spec
,
const
struct
cmds
*
cmd
,
void
*
priv
,
struct
vtclog
*
vl
)
...
...
@@ -410,6 +417,12 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
if
(
!
strcmp
(
token_s
[
0
],
cp
->
name
))
break
;
if
(
cp
->
name
==
NULL
)
{
for
(
cp
=
global_cmds
;
cp
->
name
!=
NULL
;
cp
++
)
if
(
!
strcmp
(
token_s
[
0
],
cp
->
name
))
break
;
}
if
(
cp
->
name
==
NULL
)
vtc_fatal
(
vl
,
"Unknown command:
\"
%s
\"
"
,
token_s
[
0
]);
...
...
@@ -435,7 +448,7 @@ reset_cmds(const struct cmds *cmd)
*/
static
const
struct
cmds
cmds
[]
=
{
#define CMD(n) { #n, cmd_##n },
#define CMD
_TOP
(n) { #n, cmd_##n },
#include "cmds.h"
{
NULL
,
NULL
}
};
...
...
bin/varnishtest/vtc.h
View file @
109f441c
...
...
@@ -69,7 +69,8 @@ void parse_string(const char *spec, const struct cmds *cmd, void *priv,
struct
vtclog
*
vl
);
int
fail_out
(
void
);
#define CMD(n) cmd_f cmd_##n;
#define CMD_GLOBAL(n) cmd_f cmd_##n;
#define CMD_TOP(n) cmd_f cmd_##n;
#include "cmds.h"
extern
volatile
sig_atomic_t
vtc_error
;
/* Error, bail out */
...
...
bin/varnishtest/vtc_barrier.c
View file @
109f441c
...
...
@@ -348,8 +348,7 @@ barrier_sync(struct barrier *b, struct vtclog *vl)
/* SECTION: barrier barrier
*
* NOTE: this can be used from the top-level as well as from client and server
* specifications.
* NOTE: This command is available everywhere commands are given.
*
* Barriers allows you to synchronize different threads to make sure events
* occur in the right order. It's even possible to use them in VCL.
...
...
bin/varnishtest/vtc_http.c
View file @
109f441c
...
...
@@ -1659,17 +1659,6 @@ cmd_http_fatal(CMD_ARGS)
#define cmd_http_non_fatal cmd_http_fatal
/* SECTION: client-server.spec.delay
*
* delay
* Same as for the top-level delay.
*
* SECTION: client-server.spec.barrier
*
* barrier
* Same as for the top-level barrier
*/
static
const
char
PREFACE
[
24
]
=
{
0x50
,
0x52
,
0x49
,
0x20
,
0x2a
,
0x20
,
0x48
,
0x54
,
0x54
,
0x50
,
0x2f
,
0x32
,
0x2e
,
0x30
,
0x0d
,
0x0a
,
...
...
@@ -1815,7 +1804,6 @@ cmd_http_write_body(CMD_ARGS)
*/
const
struct
cmds
http_cmds
[]
=
{
#define CMD(n) { #n, cmd_##n },
#define CMD_HTTP(n) { #n, cmd_http_##n },
/* session */
CMD_HTTP
(
accept
)
...
...
@@ -1864,13 +1852,7 @@ const struct cmds http_cmds[] = {
CMD_HTTP
(
expect
)
CMD_HTTP
(
expect_close
)
CMD_HTTP
(
expect_pattern
)
/* general purpose */
CMD
(
barrier
)
CMD
(
delay
)
CMD
(
shell
)
#undef CMD_HTTP
#undef CMD
{
NULL
,
NULL
}
};
...
...
bin/varnishtest/vtc_http2.c
View file @
109f441c
...
...
@@ -2445,7 +2445,6 @@ cmd_write_body(CMD_ARGS)
* client or a server.
*/
static
const
struct
cmds
stream_cmds
[]
=
{
#define CMD(n) { #n, cmd_##n },
#define CMD_STREAM(n) { #n, cmd_##n },
/* spec */
CMD_STREAM
(
expect
)
...
...
@@ -2475,14 +2474,8 @@ static const struct cmds stream_cmds[] = {
CMD_STREAM
(
txsettings
)
CMD_STREAM
(
txwinup
)
CMD_STREAM
(
write_body
)
/* general purpose */
CMD
(
barrier
)
CMD
(
delay
)
CMD
(
shell
)
{
NULL
,
NULL
}
#undef CMD_STREAM
#undef CMD
};
static
void
*
...
...
bin/varnishtest/vtc_misc.c
View file @
109f441c
...
...
@@ -99,6 +99,8 @@ cmd_varnishtest(CMD_ARGS)
}
/* SECTION: shell shell
*
* NOTE: This command is available everywhere commands are given.
*
* Pass the string given as argument to a shell. If you have multiple
* commands to run, you can use curly brackets to describe a multi-lines
...
...
@@ -311,13 +313,12 @@ cmd_setenv(CMD_ARGS)
}
/* SECTION: delay delay
*
* NOTE: This command is available everywhere commands are given.
*
* Sleep for the number of seconds specified in the argument. The number
* can include a fractional part, e.g. 1.5.
*/
/* SECTION: stream.spec.delay delay
*
* Same as for the top-level delay.
*/
void
cmd_delay
(
CMD_ARGS
)
...
...
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