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
d602c967
Commit
d602c967
authored
Sep 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail tests which ask for features we have not heard about.
parent
dc8177b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
32 deletions
+44
-32
vtc.c
bin/varnishtest/vtc.c
+44
-32
No files found.
bin/varnishtest/vtc.c
View file @
d602c967
...
...
@@ -567,6 +567,7 @@ static void
cmd_feature
(
CMD_ARGS
)
{
int
r
;
int
good
;
(
void
)
priv
;
(
void
)
cmd
;
...
...
@@ -574,54 +575,65 @@ cmd_feature(CMD_ARGS)
if
(
av
==
NULL
)
return
;
#define FEATURE(nm, tst) \
do { \
if (!strcmp(*av, nm)) { \
if (tst) { \
good = 1; \
} else { \
vtc_stop = 1; \
} \
} \
} while (0)
for
(
av
++
;
*
av
!=
NULL
;
av
++
)
{
good
=
0
;
if
(
!
strcmp
(
*
av
,
"SO_RCVTIMEO_WORKS"
))
{
#ifdef SO_RCVTIMEO_WORKS
if
(
!
strcmp
(
*
av
,
"SO_RCVTIMEO_WORKS"
))
continue
;
good
=
1
;
#else
vtc_stop
=
1
;
#endif
if
(
sizeof
(
void
*
)
==
8
&&
!
strcmp
(
*
av
,
"64bit"
))
continue
;
if
(
!
strcmp
(
*
av
,
"pcre_jit"
)
&&
VRE_has_jit
)
continue
;
}
if
(
!
strcmp
(
*
av
,
"!OSX"
))
{
#if !defined(__APPLE__) || !defined(__MACH__)
continue
;
good
=
1
;
#else
vtc_stop
=
1
;
#endif
}
if
(
!
strcmp
(
*
av
,
"dns"
)
&&
feature_dns
)
continue
;
if
(
!
strcmp
(
*
av
,
"topbuild"
)
&&
iflg
)
continue
;
if
(
!
strcmp
(
*
av
,
"root"
)
&&
!
geteuid
())
continue
;
if
(
!
strcmp
(
*
av
,
"user_varnish"
)
&&
getpwnam
(
"varnish"
)
!=
NULL
)
continue
;
if
(
!
strcmp
(
*
av
,
"user_vcache"
)
&&
getpwnam
(
"vcache"
)
!=
NULL
)
continue
;
if
(
!
strcmp
(
*
av
,
"group_varnish"
)
&&
getgrnam
(
"varnish"
)
!=
NULL
)
continue
;
FEATURE
(
"pcre_jit"
,
VRE_has_jit
);
FEATURE
(
"64bit"
,
sizeof
(
void
*
)
==
8
);
FEATURE
(
"dns"
,
feature_dns
);
FEATURE
(
"topbuild"
,
iflg
);
FEATURE
(
"root"
,
!
geteuid
());
FEATURE
(
"user_varnish"
,
getpwnam
(
"varnish"
)
!=
NULL
);
FEATURE
(
"user_vcache"
,
getpwnam
(
"vcache"
)
!=
NULL
);
FEATURE
(
"group_varnish"
,
getgrnam
(
"varnish"
)
!=
NULL
);
if
(
!
strcmp
(
*
av
,
"cmd"
))
{
av
++
;
if
(
*
av
==
NULL
)
if
(
*
av
==
NULL
)
{
vtc_log
(
vl
,
0
,
"Missing the command-line"
);
return
;
}
r
=
system
(
*
av
);
if
(
WEXITSTATUS
(
r
)
==
0
)
continue
;
good
=
1
;
else
vtc_stop
=
1
;
}
if
(
good
)
continue
;
vtc_log
(
vl
,
1
,
"SKIPPING test, missing feature: %s"
,
*
av
);
vtc_stop
=
1
;
if
(
!
vtc_stop
)
{
vtc_log
(
vl
,
0
,
"FAIL test, unknown feature: %s"
,
*
av
);
}
else
{
vtc_log
(
vl
,
1
,
"SKIPPING test, lacking feature: %s"
,
*
av
);
}
return
;
}
}
...
...
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