summaryrefslogtreecommitdiff
path: root/jstests/multiVersion/libs/verify_versions.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/multiVersion/libs/verify_versions.js')
-rw-r--r--jstests/multiVersion/libs/verify_versions.js59
1 files changed, 29 insertions, 30 deletions
diff --git a/jstests/multiVersion/libs/verify_versions.js b/jstests/multiVersion/libs/verify_versions.js
index f20da90de80..fcc9345e276 100644
--- a/jstests/multiVersion/libs/verify_versions.js
+++ b/jstests/multiVersion/libs/verify_versions.js
@@ -4,39 +4,38 @@
var Mongo, assert;
(function() {
- "use strict";
- Mongo.prototype.getBinVersion = function() {
- var result = this.getDB("admin").runCommand({serverStatus: 1});
- return result.version;
- };
+"use strict";
+Mongo.prototype.getBinVersion = function() {
+ var result = this.getDB("admin").runCommand({serverStatus: 1});
+ return result.version;
+};
- // Checks that our mongodb process is of a certain version
- assert.binVersion = function(mongo, version) {
- var currVersion = mongo.getBinVersion();
- assert(MongoRunner.areBinVersionsTheSame(MongoRunner.getBinVersionFor(currVersion),
- MongoRunner.getBinVersionFor(version)),
- "version " + version + " (" + MongoRunner.getBinVersionFor(version) + ")" +
- " is not the same as " + MongoRunner.getBinVersionFor(currVersion));
- };
+// Checks that our mongodb process is of a certain version
+assert.binVersion = function(mongo, version) {
+ var currVersion = mongo.getBinVersion();
+ assert(MongoRunner.areBinVersionsTheSame(MongoRunner.getBinVersionFor(currVersion),
+ MongoRunner.getBinVersionFor(version)),
+ "version " + version + " (" + MongoRunner.getBinVersionFor(version) + ")" +
+ " is not the same as " + MongoRunner.getBinVersionFor(currVersion));
+};
- // Compares an array of desired versions and an array of found versions,
- // looking for versions not found
- assert.allBinVersions = function(versionsWanted, versionsFound) {
-
- for (var i = 0; i < versionsWanted.length; i++) {
- var version = versionsWanted[i];
- var found = false;
- for (var j = 0; j < versionsFound.length; j++) {
- if (MongoRunner.areBinVersionsTheSame(version, versionsFound[j])) {
- found = true;
- break;
- }
+// Compares an array of desired versions and an array of found versions,
+// looking for versions not found
+assert.allBinVersions = function(versionsWanted, versionsFound) {
+ for (var i = 0; i < versionsWanted.length; i++) {
+ var version = versionsWanted[i];
+ var found = false;
+ for (var j = 0; j < versionsFound.length; j++) {
+ if (MongoRunner.areBinVersionsTheSame(version, versionsFound[j])) {
+ found = true;
+ break;
}
-
- assert(found,
- "could not find version " + version + " (" +
- MongoRunner.getBinVersionFor(version) + ")" + " in " + versionsFound);
}
- };
+ assert(found,
+ "could not find version " + version + " (" + MongoRunner.getBinVersionFor(version) +
+ ")" +
+ " in " + versionsFound);
+ }
+};
}());