summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mongo-c-driver-pr314.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/mongo-c-driver-pr314.patch b/mongo-c-driver-pr314.patch
new file mode 100644
index 0000000..16c467d
--- /dev/null
+++ b/mongo-c-driver-pr314.patch
@@ -0,0 +1,61 @@
+From 077c04640ce1f199a6f91052291d622ca6825995 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Mon, 29 Feb 2016 16:56:54 +0100
+Subject: [PATCH] allow to skip online tests
+
+---
+ tests/test-libmongoc.c | 6 ++++++
+ tests/test-libmongoc.h | 1 +
+ tests/test-mongoc-topology.c | 4 ++--
+ 3 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-libmongoc.c b/tests/test-libmongoc.c
+index 6a36e05..a06f60f 100644
+--- a/tests/test-libmongoc.c
++++ b/tests/test-libmongoc.c
+@@ -1209,6 +1209,12 @@ int test_framework_skip_if_max_version_version_less_than_4 (void)
+ }
+
+
++int test_framework_skip_if_offline (void)
++{
++ return getenv("MONGOC_TEST_OFFLINE") ? 0 : 1;
++}
++
++
+ int
+ main (int argc,
+ char *argv[])
+diff --git a/tests/test-libmongoc.h b/tests/test-libmongoc.h
+index 5ccf2d1..9d2bba3 100644
+--- a/tests/test-libmongoc.h
++++ b/tests/test-libmongoc.h
+@@ -61,6 +61,7 @@ int test_framework_skip_if_windows (void);
+ int test_framework_skip_if_not_mongos (void);
+ int test_framework_skip_if_not_replset (void);
+ int test_framework_skip_if_not_single (void);
++int test_framework_skip_if_offline (void);
+
+ typedef struct _debug_stream_stats_t {
+ mongoc_client_t *client;
+diff --git a/tests/test-mongoc-topology.c b/tests/test-mongoc-topology.c
+index fa225df..86fba9a 100644
+--- a/tests/test-mongoc-topology.c
++++ b/tests/test-mongoc-topology.c
+@@ -750,7 +750,7 @@ test_connect_timeout_try_once_false(void)
+
+
+ static void
+-test_multiple_selection_errors (void)
++test_multiple_selection_errors (void *context)
+ {
+ const char *uri = "mongodb://doesntexist,example.com:2/?replicaSet=rs"
+ "&connectTimeoutMS=100";
+@@ -811,6 +811,6 @@ test_topology_install (TestSuite *suite)
+ TestSuite_Add (suite, "/Topology/connect_timeout/pooled", test_connect_timeout_pooled);
+ TestSuite_Add (suite, "/Topology/connect_timeout/single/try_once", test_connect_timeout_single);
+ TestSuite_Add (suite, "/Topology/connect_timeout/single/try_once_false", test_connect_timeout_try_once_false);
+- TestSuite_Add (suite, "/Topology/multiple_selection_errors", test_multiple_selection_errors);
++ TestSuite_AddFull (suite, "/Topology/multiple_selection_errors", test_multiple_selection_errors, NULL, NULL, test_framework_skip_if_offline);
+ TestSuite_Add (suite, "/Topology/invalid_server_id", test_invalid_server_id);
+ }