diff options
author | Greg Studer <greg@10gen.com> | 2014-02-06 10:48:25 -0500 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2014-02-06 16:13:23 -0500 |
commit | 0d111ff5e5b1c38123149e4e4f69c92725981bb8 (patch) | |
tree | dec9fc6191707f28cb519503e97e028d465f42a0 /jstests/gle | |
parent | 4ef1fec8348328429c11830c8789fb7376916f00 (diff) | |
download | mongo-0d111ff5e5b1c38123149e4e4f69c92725981bb8.tar.gz |
SERVER-12127 new legacy write suites for tests using GLE
Diffstat (limited to 'jstests/gle')
-rw-r--r-- | jstests/gle/0_gle_basics_passthrough.js | 28 | ||||
-rw-r--r-- | jstests/gle/1_sharding_gle_basics_passthrough.js | 31 | ||||
-rw-r--r-- | jstests/gle/core/gle_example.js | 9 |
3 files changed, 68 insertions, 0 deletions
diff --git a/jstests/gle/0_gle_basics_passthrough.js b/jstests/gle/0_gle_basics_passthrough.js new file mode 100644 index 00000000000..40b69267b92 --- /dev/null +++ b/jstests/gle/0_gle_basics_passthrough.js @@ -0,0 +1,28 @@ +// +// Tests the core GLE behavior +// + +var conn = MongoRunner.runMongod({}); + +// Remember the global 'db' var +var lastDB = db; + +var coreTests = listFiles("jstests/gle/core"); + +coreTests.forEach( function(file) { + + // Reset global 'db' var + db = conn.getDB("testBasicGLE"); + + print(" *******************************************"); + print(" Test : " + file.name + " ..."); + + var testTime = Date.timeFunc( function() { load(file.name); }, 1); + print(" " + testTime + "ms"); +}); + +print("Tests completed."); + +// Restore 'db' var +db = lastDB; +MongoRunner.stopMongod(conn);
\ No newline at end of file diff --git a/jstests/gle/1_sharding_gle_basics_passthrough.js b/jstests/gle/1_sharding_gle_basics_passthrough.js new file mode 100644 index 00000000000..f318e2f1619 --- /dev/null +++ b/jstests/gle/1_sharding_gle_basics_passthrough.js @@ -0,0 +1,31 @@ +// +// Tests basic mongos GLE behavior +// + +var passST = new ShardingTest({ name : "passST", shards : 2, mongos : 1 }); +var passMongos = passST.s0; +assert.commandWorked(passMongos.getDB("admin").runCommand({ enableSharding : "testSharded" })); + +// Remember the global 'db' var +var lastDB = db; + +var coreTests = listFiles("jstests/gle/core"); + +coreTests.forEach( function(file) { + + // Reset global 'db' var + db = passMongos.getDB("testBasicMongosGLE"); + + print(" *******************************************"); + print(" Test : " + file.name + " ..."); + + + var testTime = Date.timeFunc( function() { load(file.name); }, 1); + print(" " + testTime + "ms"); +}); + +print("Tests completed."); + +// Restore 'db' var +db = lastDB; +passST.stop(); diff --git a/jstests/gle/core/gle_example.js b/jstests/gle/core/gle_example.js new file mode 100644 index 00000000000..6df17cec751 --- /dev/null +++ b/jstests/gle/core/gle_example.js @@ -0,0 +1,9 @@ +// +// Example test for the gle core suite (used in passthroughs) +// + +var coll = db.getCollection("gle_example"); +coll.drop(); + +coll.insert({ hello : "world" }); +assert.eq( null, coll.getDB().getLastError() );
\ No newline at end of file |