summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTad Marshall <tad@10gen.com>2012-10-15 18:00:10 -0400
committerTad Marshall <tad@10gen.com>2012-10-16 11:24:48 -0400
commit309cf5f83fa75357a89844e42923a0c907f52edc (patch)
treeb8eee4665183127808c5d6a4cb8b43e36e11cc48
parentc35bd13c828582d8f79247a72b76b260f7b1f45b (diff)
downloadmongo-309cf5f83fa75357a89844e42923a0c907f52edc.tar.gz
SERVER-7017 split rename2.js into two tests for multiVersion
Revert jstests/rename2.js to the way it was before, add rename6.js for the new tests, make multi_version_sharding_passthrough.js skip rename6.js since it is new functionality.
-rw-r--r--jstests/multiVersion/multi_version_sharding_passthrough.js1
-rw-r--r--jstests/rename2.js25
-rw-r--r--jstests/rename6.js24
3 files changed, 25 insertions, 25 deletions
diff --git a/jstests/multiVersion/multi_version_sharding_passthrough.js b/jstests/multiVersion/multi_version_sharding_passthrough.js
index 359f261a8f7..eecb5e07ef3 100644
--- a/jstests/multiVersion/multi_version_sharding_passthrough.js
+++ b/jstests/multiVersion/multi_version_sharding_passthrough.js
@@ -10,6 +10,7 @@ var testsToIgnore = [ /dbadmin/,
/geo.*/,
/indexh/,
/remove5/,
+ /rename6/,
/update4/,
/loglong/,
/logpath/,
diff --git a/jstests/rename2.js b/jstests/rename2.js
index bde87431daf..a06268f1bfb 100644
--- a/jstests/rename2.js
+++ b/jstests/rename2.js
@@ -17,28 +17,3 @@ assert( a.renameCollection( "rename2b" ) , "the command" );
assert.eq( 0 , a.count() , "C" )
assert.eq( 3 , b.count() , "D" )
-
-// Test for SERVER-7017
-// We shouldn't rename a collection when one of its indexes will generate a namespace
-// that is greater than 120 chars. To do this we create a long index name and try
-// and rename the collection to one with a much longer name. We use the test database
-// by default and we add this here to ensure we are using it
-testDB = db.getSiblingDB("test")
-c = "rename2c";
-dbc = testDB.getCollection(c);
-d = "dest4567890123456789012345678901234567890123456789012345678901234567890"
-dbd = testDB.getCollection(d);
-dbc.ensureIndex({ "name" : 1,
- "date" : 1,
- "time" : 1,
- "renameCollection" : 1,
- "mongodb" : 1,
- "testing" : 1,
- "data" : 1});
-//Checking for the newly created index and the _id index in original collection
-assert.eq(2, testDB.system.indexes.find( { "ns" : "test." + c } ).count(), "Long Rename Init");
-//Should fail to rename collection as the index namespace is too long
-assert.commandFailed( dbc.renameCollection( dbd ) , "Long Rename Exec" );
-//Since we failed we should have the 2 indexes unmoved and no indexes under the new collection name
-assert.eq(2, testDB.system.indexes.find( { "ns" : "test." + c } ).count(), "Long Rename Result 1");
-assert.eq(0, testDB.system.indexes.find( { "ns" : "test." + d } ).count(), "Long Rename Result 2");
diff --git a/jstests/rename6.js b/jstests/rename6.js
new file mode 100644
index 00000000000..17cbf4b80b1
--- /dev/null
+++ b/jstests/rename6.js
@@ -0,0 +1,24 @@
+// Test for SERVER-7017
+// We shouldn't rename a collection when one of its indexes will generate a namespace
+// that is greater than 120 chars. To do this we create a long index name and try
+// and rename the collection to one with a much longer name. We use the test database
+// by default and we add this here to ensure we are using it
+testDB = db.getSiblingDB("test")
+c = "rename2c";
+dbc = testDB.getCollection(c);
+d = "dest4567890123456789012345678901234567890123456789012345678901234567890"
+dbd = testDB.getCollection(d);
+dbc.ensureIndex({ "name" : 1,
+ "date" : 1,
+ "time" : 1,
+ "renameCollection" : 1,
+ "mongodb" : 1,
+ "testing" : 1,
+ "data" : 1});
+//Checking for the newly created index and the _id index in original collection
+assert.eq(2, testDB.system.indexes.find( { "ns" : "test." + c } ).count(), "Long Rename Init");
+//Should fail to rename collection as the index namespace is too long
+assert.commandFailed( dbc.renameCollection( dbd ) , "Long Rename Exec" );
+//Since we failed we should have the 2 indexes unmoved and no indexes under the new collection name
+assert.eq(2, testDB.system.indexes.find( { "ns" : "test." + c } ).count(), "Long Rename Result 1");
+assert.eq(0, testDB.system.indexes.find( { "ns" : "test." + d } ).count(), "Long Rename Result 2");