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
78ab22c1
Commit
78ab22c1
authored
Aug 25, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a feature check for not-totally-demented-DNS service
parent
12159331
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
m00011.vtc
bin/varnishtest/tests/m00011.vtc
+0
-1
vtc.c
bin/varnishtest/vtc.c
+3
-0
vtc.h
bin/varnishtest/vtc.h
+1
-0
vtc_main.c
bin/varnishtest/vtc_main.c
+42
-0
No files found.
bin/varnishtest/tests/m00011.vtc
View file @
78ab22c1
varnishtest "Test std.ip"
server s1 {
rxreq
txresp -body "1"
...
...
bin/varnishtest/vtc.c
View file @
78ab22c1
...
...
@@ -583,6 +583,9 @@ cmd_feature(CMD_ARGS)
continue
;
#endif
}
if
(
!
strcmp
(
av
[
i
],
"dns"
)
&&
feature_dns
)
continue
;
if
(
!
strcmp
(
av
[
i
],
"topbuild"
)
&&
iflg
)
continue
;
...
...
bin/varnishtest/vtc.h
View file @
78ab22c1
...
...
@@ -71,6 +71,7 @@ extern pthread_t vtc_thread;
extern
int
iflg
;
extern
unsigned
vtc_maxdur
;
extern
int
vtc_witness
;
extern
int
feature_dns
;
void
init_sema
(
void
);
void
init_server
(
void
);
...
...
bin/varnishtest/vtc_main.c
View file @
78ab22c1
...
...
@@ -30,6 +30,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
...
...
@@ -47,6 +48,9 @@
#include "vfil.h"
#include "vqueue.h"
#include "vrnd.h"
#include "vsa.h"
#include "vss.h"
#include "vtcp.h"
#include "vtim.h"
#define MAX_FILESIZE (1024 * 1024)
...
...
@@ -89,6 +93,7 @@ static char *tmppath;
static
char
*
cwd
=
NULL
;
int
leave_temp
;
int
vtc_witness
=
0
;
int
feature_dns
;
/**********************************************************************
* Parse a -D option argument into a name/val pair, and insert
...
...
@@ -383,6 +388,41 @@ i_mode(void)
VSB_delete
(
vsb
);
}
/**********************************************************************
* Most test-cases use only numeric IP#'s but a few requires non-demented
* DNS services. This is a basic sanity check for those.
*/
static
int
__match_proto__
(
vss_resolved_f
)
dns_cb
(
void
*
priv
,
const
struct
suckaddr
*
sa
)
{
char
abuf
[
VTCP_ADDRBUFSIZE
];
char
pbuf
[
VTCP_PORTBUFSIZE
];
int
*
ret
=
priv
;
VTCP_name
(
sa
,
abuf
,
sizeof
abuf
,
pbuf
,
sizeof
pbuf
);
if
(
strcmp
(
abuf
,
"130.225.244.222"
))
{
fprintf
(
stderr
,
"DNS-test: Wrong response: %s
\n
"
,
abuf
);
*
ret
=
-
1
;
}
else
if
(
*
ret
==
0
)
*
ret
=
1
;
return
(
0
);
}
static
int
dns_works
(
void
)
{
int
ret
=
0
,
error
;
const
char
*
msg
;
error
=
VSS_resolver
(
"phk.freebsd.dk"
,
NULL
,
dns_cb
,
&
ret
,
&
msg
);
if
(
error
||
msg
!=
NULL
||
ret
!=
1
)
{
fprintf
(
stderr
,
"DNS-test fails
\n
"
);
return
(
0
);
}
return
(
1
);
}
/**********************************************************************
* Main
*/
...
...
@@ -480,6 +520,8 @@ main(int argc, char * const *argv)
VTAILQ_INSERT_TAIL
(
&
tst_head
,
tp
,
list
);
}
feature_dns
=
dns_works
();
if
(
iflg
)
i_mode
();
...
...
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