~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to jstests/slowNightly/testing_only_commands.js

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Test to make sure that commands that should only work when testing commands are enabled
 
3
 * via the --enableTestCommands flag fail when that flag isn't provided.
 
4
 */
 
5
 
 
6
var testOnlyCommands = ['_testDistLockWithSyncCluster',
 
7
                        '_testDistLockWithSkew',
 
8
                        '_skewClockCommand',
 
9
                        'configureFailPoint',
 
10
                        '_hashBSONElement',
 
11
                        'replSetTest',
 
12
                        'journalLatencyTest',
 
13
                        'godinsert',
 
14
                        'sleep',
 
15
                        'captrunc',
 
16
                        'emptycapped']
 
17
 
 
18
var assertCmdNotFound = function(db, cmdName) {
 
19
    var res = db.runCommand(cmdName);
 
20
    assert.eq(0, res.ok);
 
21
    assert(res.errmsg == 'no such cmd: ' + cmdName);
 
22
}
 
23
 
 
24
var assertCmdFound = function(db, cmdName) {
 
25
    var res = db.runCommand(cmdName);
 
26
    assert(res.ok || res.errmsg != 'no such cmd' + cmdName);
 
27
}
 
28
 
 
29
jsTest.setOption('enableTestCommands', false);
 
30
 
 
31
var conn = startMongodTest();
 
32
for (i in testOnlyCommands) {
 
33
    assertCmdNotFound(conn.getDB('test'), testOnlyCommands[i]);
 
34
}
 
35
MongoRunner.stopMongod(conn.port);
 
36
 
 
37
// Now enable the commands
 
38
jsTest.setOption('enableTestCommands', true);
 
39
 
 
40
var conn = startMongodTest();
 
41
for (i in testOnlyCommands) {
 
42
    assertCmdFound(conn.getDB('test'), testOnlyCommands[i]);
 
43
}
 
44
MongoRunner.stopMongod(conn.port);