summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
Diffstat (limited to 'jstests')
-rwxr-xr-xjstests/dur/a_quick.js2
-rw-r--r--jstests/dur/dropdb.js25
-rwxr-xr-xjstests/dur/dur1.js23
-rwxr-xr-xjstests/dur/oplog.js23
4 files changed, 65 insertions, 8 deletions
diff --git a/jstests/dur/a_quick.js b/jstests/dur/a_quick.js
index 50d5ce41411..cf4327fe57a 100755
--- a/jstests/dur/a_quick.js
+++ b/jstests/dur/a_quick.js
@@ -26,7 +26,7 @@ function runDiff(a, b) {
a = reSlash(a);
b = reSlash(b);
print("diff " + a + " " + b);
- return run("diff", a, b);
+ return run("diff", a, b);
}
var step = 1;
diff --git a/jstests/dur/dropdb.js b/jstests/dur/dropdb.js
index 672d41dedfd..26b66754f26 100644
--- a/jstests/dur/dropdb.js
+++ b/jstests/dur/dropdb.js
@@ -5,7 +5,26 @@ durability test dropping a database
var debugging = false;
var testname = "dropdb";
var step = 1;
-var conn = null;
+var conn = null;
+
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
+}
function log(str) {
if (str)
@@ -101,7 +120,7 @@ log("check no journal files");
assert(ls(path2 + "/journal") == null);
log("check data matches ns");
-var diff = run("diff", path1 + "/test.ns", path2 + "/test.ns");
+var diff = runDiff(path1 + "/test.ns", path2 + "/test.ns");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);
@@ -109,7 +128,7 @@ if (diff != "") {
assert(diff == "", "error test.ns files differ");
log("check data matches .0");
-var diff = run("diff", path1 + "/test.0", path2 + "/test.0");
+var diff = runDiff(path1 + "/test.0", path2 + "/test.0");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);
diff --git a/jstests/dur/dur1.js b/jstests/dur/dur1.js
index d8b7726708a..8c350dd0d1a 100755
--- a/jstests/dur/dur1.js
+++ b/jstests/dur/dur1.js
@@ -7,6 +7,25 @@ var testname = "dur1";
var step = 1;
var conn = null;
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
+}
+
function log(str) {
print();
if(str)
@@ -102,7 +121,7 @@ log("check no journal files");
}
log("check data matches ns");
-var diff = run("diff", path1 + "/test.ns", path2 + "/test.ns");
+var diff = runDiff(path1 + "/test.ns", path2 + "/test.ns");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);
@@ -110,7 +129,7 @@ if (diff != "") {
assert(diff == "", "error test.ns files differ");
log("check data matches .0");
-var diff = run("diff", path1 + "/test.0", path2 + "/test.0");
+var diff = runDiff(path1 + "/test.0", path2 + "/test.0");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);
diff --git a/jstests/dur/oplog.js b/jstests/dur/oplog.js
index b80270745be..fd54c560b86 100755
--- a/jstests/dur/oplog.js
+++ b/jstests/dur/oplog.js
@@ -7,6 +7,25 @@ var testname = "oplog";
var step = 1;
var conn = null;
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
+}
+
function log(str) {
print();
if(str)
@@ -106,7 +125,7 @@ log("check no journal files");
assert(ls(path2 + "/journal") == null);
log("check data matches ns");
-var diff = run("diff", path1 + "/test.ns", path2 + "/test.ns");
+var diff = runDiff(path1 + "/test.ns", path2 + "/test.ns");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);
@@ -114,7 +133,7 @@ if (diff != "") {
assert(diff == "", "error test.ns files differ");
log("check data matches .0");
-diff = run("diff", path1 + "/test.0", path2 + "/test.0");
+diff = runDiff(path1 + "/test.0", path2 + "/test.0");
if (diff != "") {
print("\n\n\nDIFFERS\n");
print(diff);