summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-01-08 10:38:22 -0500
committerRandolph Tan <randolph@10gen.com>2015-01-09 10:32:54 -0500
commitbc274534b82eb2328d417dc5b256fb6d66287f74 (patch)
tree46be88227e0afedb162f9995fb0bde1deacc6fb4 /jstests
parent666b3e19b10b3ac4c3de4c7a90a7070d33154240 (diff)
downloadmongo-bc274534b82eb2328d417dc5b256fb6d66287f74.tar.gz
SERVER-16733 mongos does not fail when different configdb string is used
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/configdb_str.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/sharding/configdb_str.js b/jstests/sharding/configdb_str.js
new file mode 100644
index 00000000000..6ad8b388518
--- /dev/null
+++ b/jstests/sharding/configdb_str.js
@@ -0,0 +1,22 @@
+/**
+ * Test that mongos with the "wrong" configdb string should not be able to write to config.
+ */
+
+(function() {
+"use strict";
+
+var st = new ShardingTest({ shards: 1, config: 3 });
+st.stopBalancer();
+
+var badConfStr = st.c1.name + ',' + st.c0.name + ',' + st.c2.name;
+
+var otherMongos = MongoRunner.runMongos({ port: 30998, configdb: badConfStr });
+var configDB = otherMongos.getDB('config');
+
+var res = configDB.user.insert({ x: 1 });
+assert.writeError(res);
+MongoRunner.stopMongos(30998);
+
+st.stop();
+
+})();