2
* Helpers for verifying versions of started MongoDB processes
5
Mongo.prototype.getBinVersion = function() {
6
var result = this.getDB( "admin" ).runCommand({ serverStatus : 1 })
10
// Checks that our mongodb process is of a certain version
11
assert.binVersion = function(mongo, version) {
12
var currVersion = mongo.getBinVersion();
13
assert(MongoRunner.areBinVersionsTheSame(MongoRunner.getBinVersionFor(currVersion),
14
MongoRunner.getBinVersionFor(version)),
15
"version " + version + " (" + MongoRunner.getBinVersionFor(version) + ")" +
16
" is not the same as " + currVersion);
20
// Compares an array of desired versions and an array of found versions,
21
// looking for versions not found
22
assert.allBinVersions = function(versionsWanted, versionsFound) {
24
for (var i = 0; i < versionsWanted.length; i++) {
27
for (var j = 0; j < versionsFound.length; j++) {
28
if (MongoRunner.areBinVersionsTheSame(versionsWanted[i],
36
assert(found, "could not find version " +
37
version + " (" + MongoRunner.getBinVersionFor(version) + ")" +
38
" in " + versionsFound);