summaryrefslogtreecommitdiff
path: root/jstests/mmap_v1/indexi.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-07-30 16:31:41 -0400
committerEliot Horowitz <eliot@10gen.com>2014-08-01 10:44:29 -0400
commit661ae0ba0831eff124a456275a53e9f761a3940a (patch)
treedd9e842cbef3eca23e6792ad0b98a6cb91c98d96 /jstests/mmap_v1/indexi.js
parent02948ba65855df43bfbdee5c4e0f834c678532b7 (diff)
downloadmongo-661ae0ba0831eff124a456275a53e9f761a3940a.tar.gz
SERVER-13635: making more js tests work for generic storage engine
Diffstat (limited to 'jstests/mmap_v1/indexi.js')
-rw-r--r--jstests/mmap_v1/indexi.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/jstests/mmap_v1/indexi.js b/jstests/mmap_v1/indexi.js
new file mode 100644
index 00000000000..06f185fb689
--- /dev/null
+++ b/jstests/mmap_v1/indexi.js
@@ -0,0 +1,25 @@
+// Test that client cannot access index namespaces SERVER-4276.
+
+t = db.jstests_indexi;
+t.drop();
+
+idx = db.jstests_indexi.$_id_;
+
+// Test that accessing the index namespace fails.
+function checkFailingOperations() {
+ assert.throws(function() { idx.find().itcount(); });
+ assert.writeError( idx.insert({ x: 1 }) );
+ assert.writeError( idx.update({ x: 1 }, { x: 2 }) );
+ assert.writeError( idx.remove({ x: 1 }) );
+ assert.commandFailed( idx.runCommand( 'compact' ) );
+ assert.commandFailed( idx.ensureIndex({ x: 1 }));
+}
+
+// Check with base collection not present.
+// TODO: SERVER-4276
+//checkFailingOperations();
+t.save({});
+
+// Check with base collection present.
+checkFailingOperations();
+