Files
mongo/jstests/core/dbhash2.js
Max Hirschhorn 9ad8d6335f SERVER-40076 Tag JS tests with reason they're unable to run in Atlas.
There are likely more JavaScript tests which have been added since
r3.6.9 that still need to be tagged.

(cherry picked from commit 05ec08fa62)
2019-03-11 18:17:29 -04:00

26 lines
709 B
JavaScript

// @tags: [
// assumes_superuser_permissions,
// # dbhash command is not available on embedded
// incompatible_with_embedded,
// ]
mydb = db.getSisterDB("config");
t = mydb.foo;
t.drop();
assert.commandWorked(t.insert({x: 1}));
res1 = mydb.runCommand("dbhash");
res2 = mydb.runCommand("dbhash");
assert.commandWorked(res1);
assert.commandWorked(res2);
assert.eq(res1.collections.foo, res2.collections.foo);
assert.commandWorked(t.insert({x: 2}));
res3 = mydb.runCommand("dbhash");
assert.commandWorked(res3);
assert.neq(res1.collections.foo, res3.collections.foo);
// Validate dbHash with an empty database does not trigger an fassert/invariant
assert.commandFailed(db.runCommand({"dbhash": ""}));