0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

MINOR cleaner directory check in diskfull.js test, validate dir in listFiles

This commit is contained in:
Aaron 2010-01-19 17:07:30 -08:00
parent f89d78e1ac
commit 15a31df5e9
2 changed files with 4 additions and 4 deletions

View File

@ -1,13 +1,12 @@
port = allocatePorts( 1 )[ 0 ];
doIt = true;
try {
m = startMongoProgram( "mongod", "--port", port, "--dbpath", "/data/db/diskfulltest", "--nohttpinterface", "--bind_ip", "127.0.0.1" );
} catch ( e ) {
if ( !( "diskfulltest" in listFiles( "/data/db" ) ) ) {
print( "path /data/db/diskfulltest/ missing, skipping diskfull test" );
doIt = false;
}
if ( doIt ) {
port = allocatePorts( 1 )[ 0 ];
m = startMongoProgram( "mongod", "--port", port, "--dbpath", "/data/db/diskfulltest", "--nohttpinterface", "--bind_ip", "127.0.0.1" );
m.getDB( "diskfulltest" ).getCollection( "diskfulltest" ).save( { a: 6 } );
assert.soon( function() { return rawMongoProgramOutput().match( /dbexit: really exiting now/ ); }, "didn't see 'really exiting now'" );
assert( !rawMongoProgramOutput().match( /Got signal/ ), "saw 'Got signal', not expected. Output: " + rawMongoProgramOutput() );

View File

@ -80,6 +80,7 @@ namespace mongo {
string rootname = args.firstElement().valuestrsafe();
path root( rootname );
uassert( 12581, "listFiles: no such directory", boost::filesystem::exists( root ) );
directory_iterator end;
directory_iterator i( root);