summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-08-30 16:57:35 -0400
committerJames Wahlin <james.wahlin@10gen.com>2016-08-31 19:00:59 -0400
commitbbc9748b355ae0ac07d6ac37db757712bc35af43 (patch)
tree770c7d6f0c71d2c515e4f0a1c2e7ca371776c803 /jstests/noPassthroughWithMongod
parentf5c9d27ca6f0f4e1e2673c64b84b628ac29493ec (diff)
downloadmongo-bbc9748b355ae0ac07d6ac37db757712bc35af43.tar.gz
SERVER-25796 copydb support for views + additional cloner tests
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r--jstests/noPassthroughWithMongod/clonecollection.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/clonecollection.js b/jstests/noPassthroughWithMongod/clonecollection.js
index 2f0ec45ad44..2c7cf24ea9a 100644
--- a/jstests/noPassthroughWithMongod/clonecollection.js
+++ b/jstests/noPassthroughWithMongod/clonecollection.js
@@ -54,3 +54,13 @@ assert.writeOK(f.a.insert({}));
assert.gt(f.system.profile.count(), 0);
t.system.profile.drop();
assert.commandFailed(t.cloneCollection("localhost:" + fromMongod.port, "system.profile"));
+
+// Check that cloning a view is disallowed.
+f.a.drop();
+t.a.drop();
+
+assert.commandWorked(f.createCollection("a"));
+assert.commandWorked(f.createView("viewA", "a", []));
+assert.commandFailedWithCode(t.cloneCollection("localhost:" + fromMongod.port, "viewA"),
+ ErrorCodes.CommandNotSupportedOnView,
+ "cloneCollection on view expected to fail");