diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-02-17 10:06:02 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-02-17 10:06:02 -0500 |
commit | 1a4ad3f91576e23a00d3f58ed385c0c6416d2263 (patch) | |
tree | 2440b7ff2f394861f63aedce3f240f9b4f2f6c87 /jstests/sharding/diffservers1.js | |
parent | d74b746c310dc7be375ab36e56a808057e5c6ffc (diff) | |
download | mongo-1a4ad3f91576e23a00d3f58ed385c0c6416d2263.tar.gz |
cleaning up test framework and very simple sharding framework sanity test
Diffstat (limited to 'jstests/sharding/diffservers1.js')
-rw-r--r-- | jstests/sharding/diffservers1.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/jstests/sharding/diffservers1.js b/jstests/sharding/diffservers1.js new file mode 100644 index 00000000000..f5fcaa54f1f --- /dev/null +++ b/jstests/sharding/diffservers1.js @@ -0,0 +1,28 @@ + + + +a = startMongod( { port : 30000 , dbpath : "/data/db/diffservers1a" } ) +b = startMongod( { port : 30001 , dbpath : "/data/db/diffservers1b" } ) + +s = startMongos( { port : 30002 , configdb : "localhost:30000" } ); + +config = s.getDB( "config" ); +admin = s.getDB( "admin" ); + +admin.runCommand( { addserver : "localhost:30000" } ) +admin.runCommand( { addserver : "localhost:30001" } ) + +assert.eq( 2 , config.servers.count() , "server count wrong" ); +assert.eq( 2 , a.getDB( "config" ).servers.count() , "where are servers!" ); +assert.eq( 0 , b.getDB( "config" ).servers.count() , "shouldn't be here" ); + +test1 = s.getDB( "test1" ).foo; +test1.save( { a : 1 } ); +test1.save( { a : 2 } ); +test1.save( { a : 3 } ); +assert( 3 , test1.count() ); + +stopMongoProgram( 30002 ); +stopMongod( 30000 ); +stopMongod( 30001 ); + |