diff options
author | Pavi Vetriselvan <pavithra.vetriselvan@mongodb.com> | 2020-08-10 10:22:13 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-16 12:12:26 +0000 |
commit | 268081db9538c5db216c83a1b63f83540be0075c (patch) | |
tree | 8d5eebfdc665f6d6de9f074d308bf02786c7e362 /jstests | |
parent | 25e3aeda438f7144b6771618ce1c9dd4dbee3f7e (diff) | |
download | mongo-268081db9538c5db216c83a1b63f83540be0075c.tar.gz |
SERVER-49991 Alias db. and rs.printSlaveReplicationInfo() to printSecondaryReplicationInfo()
(cherry picked from commit 996dcdc3d96346d71f012388eccc79c691619340)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/replsets/get_replication_info_helper.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/jstests/replsets/get_replication_info_helper.js b/jstests/replsets/get_replication_info_helper.js index 0fed84db2c4..f22a3852024 100644 --- a/jstests/replsets/get_replication_info_helper.js +++ b/jstests/replsets/get_replication_info_helper.js @@ -1,4 +1,5 @@ -// Tests the output of db.getReplicationInfo() and tests db.printSlaveReplicationInfo(). +// Tests the output of db.getReplicationInfo(), db.printSlaveReplicationInfo(), and the latter's +// alias, db.printSecondaryReplicationInfo(). (function() { "use strict"; @@ -43,10 +44,21 @@ } catch (e) { } + // printSlaveReplicationInfo is deprecated and aliased to printSecondaryReplicationInfo, but + // ensure it still works for backwards compatibility. mongo = startParallelShell("db.getSiblingDB('admin').printSlaveReplicationInfo();", primary.port); mongo(); assert(rawMongoProgramOutput().match("behind the freshest")); + clearRawMongoProgramOutput(); + assert.eq(rawMongoProgramOutput().match("behind the freshest"), null); + + // Ensure that the new helper, printSecondaryReplicationInfo works the same. + mongo = startParallelShell("db.getSiblingDB('admin').printSecondaryReplicationInfo();", + primary.port); + mongo(); + assert(rawMongoProgramOutput().match("behind the freshest")); + replSet.stopSet(); })(); |