0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00
mongodb/jstests/noPassthrough/database_name/hyphenated_database_name.js
Stephanie fd05a7c3b3 SERVER-95806: Break up storage_execution directory in jstests/noPassthrough (#28100)
GitOrigin-RevId: f7d2485163e820162f33c4d600cf18c4bf89b6d0
2024-10-17 17:22:38 +00:00

21 lines
649 B
JavaScript

/**
* Test that hyphenated database name can work with dbStats when directoryperdb is turned on.
*
* @tags: [requires_persistence]
*/
var isDirectoryPerDBSupported =
jsTest.options().storageEngine == "wiredTiger" || !jsTest.options().storageEngine;
if (!isDirectoryPerDBSupported)
quit();
const dbName = "test-hyphen";
let conn = MongoRunner.runMongod({directoryperdb: ''});
conn.getDB(dbName).a.insert({x: 1});
let res = conn.getDB(dbName).runCommand({dbStats: 1, scale: 1});
jsTestLog("dbStats: " + tojson(res));
assert(res.db == "test-hyphen");
assert(res.fsUsedSize > 0);
assert(res.fsTotalSize > 0);
MongoRunner.stopMongod(conn);