Skip to content

Commit a67dc6e

Browse files
committed
Merged pull request #685
2 parents 9fa0539 + 15e1450 commit a67dc6e

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed

config.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ if test "$MONGODB" != "no"; then
375375

376376
m4_include(src/libmongoc/build/autotools/m4/ax_prototype.m4)
377377
m4_include(src/libmongoc/build/autotools/CheckCompiler.m4)
378+
379+
dnl We need to convince the libmongoc M4 file to actually run these checks for us
380+
enable_srv=auto
378381
m4_include(src/libmongoc/build/autotools/FindResSearch.m4)
382+
379383
m4_include(src/libmongoc/build/autotools/WeakSymbols.m4)
380384
m4_include(src/libmongoc/build/autotools/m4/ax_pthread.m4)
381385
AX_PTHREAD

scripts/presets/replicaset-dns.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"id": "REPLICASET_DNS",
3+
"name": "mongod",
4+
"members": [
5+
{
6+
"procParams": {
7+
"dbpath": "/tmp/REPLICASET/27017/",
8+
"ipv6": true,
9+
"logappend": true,
10+
"logpath": "/tmp/REPLICASET/27017/mongod.log",
11+
"nohttpinterface": true,
12+
"journal": true,
13+
"noprealloc": true,
14+
"nssize": 1,
15+
"port": 27017,
16+
"smallfiles": true,
17+
"setParameter": {"enableTestCommands": 1}
18+
},
19+
"rsParams": {
20+
"priority": 1
21+
},
22+
"server_id": "DNS-one"
23+
},
24+
{
25+
"procParams": {
26+
"dbpath": "/tmp/REPLICASET/27018/",
27+
"ipv6": true,
28+
"logappend": true,
29+
"logpath": "/tmp/REPLICASET/27018/mongod.log",
30+
"nohttpinterface": true,
31+
"journal": true,
32+
"noprealloc": true,
33+
"nssize": 1,
34+
"port": 27018,
35+
"smallfiles": true,
36+
"setParameter": {"enableTestCommands": 1}
37+
},
38+
"rsParams": {
39+
"priority": 1
40+
},
41+
"server_id": "DNS-two"
42+
},
43+
{
44+
"procParams": {
45+
"dbpath": "/tmp/REPLICASET/27019/",
46+
"ipv6": true,
47+
"logappend": true,
48+
"logpath": "/tmp/REPLICASET/27019/mongod.log",
49+
"nohttpinterface": true,
50+
"journal": true,
51+
"noprealloc": true,
52+
"nssize": 1,
53+
"port": 27019,
54+
"smallfiles": true,
55+
"setParameter": {"enableTestCommands": 1}
56+
},
57+
"rsParams": {
58+
"priority": 1
59+
60+
},
61+
"server_id": "DNS-three"
62+
}
63+
]
64+
}
65+

scripts/start-servers.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function lap() {
3030
"scripts/presets/replicaset.json",
3131
"scripts/presets/replicaset-30.json",
3232
"scripts/presets/replicaset-36.json",
33+
"scripts/presets/replicaset-dns.json",
3334
],
3435
];
3536

tests/connect/bug1015.phpt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--TEST--
2+
PHPC-1015: Initial DNS Seedlist test
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php echo "skip Manual test, as it needs configuration\n"; ?>
6+
<?php NEEDS('REPLICASET_DNS'); ?>
7+
--FILE--
8+
<?php
9+
/**
10+
* This test requires additional configuration, and hence is not enabled by
11+
* default. In order for this test to succeed, you need the following line in
12+
* /etc/hosts:
13+
*
14+
* 192.168.112.10 localhost.test.build.10gen.cc
15+
*
16+
* The IP address needs to match the IP address that your vagrant environment
17+
* has created. The IP address is shown when you run "make start-servers".
18+
*/
19+
require_once __DIR__ . "/../utils/basic.inc";
20+
21+
$m = new MongoDB\Driver\Manager("mongodb+srv://test1.test.build.10gen.cc/");
22+
$s = $m->selectServer( new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_NEAREST ) );
23+
$servers = $m->getServers();
24+
25+
foreach ( $servers as $server )
26+
{
27+
echo $server->getHost(), ':', $server->getPort(), "\n";
28+
}
29+
?>
30+
===DONE===
31+
<?php exit(0); ?>
32+
--EXPECTF--
33+
%d.%d.%d.%d:27017
34+
%d.%d.%d.%d:27018
35+
%d.%d.%d.%d:27019
36+
===DONE===

0 commit comments

Comments
 (0)