jstests/replsets/tenant_migration_cluster_time_keys_cloning.js
/**
 * Asserts that the donor and recipient have copied each other's cluster time keys into
 * config.external_validation_keys.
 */
Asserts that the donor and recipient have copied each other's cluster time keys into
config.external_validation_keys.
Asserts that the donor and recipient have copied each other ' s cluster time keys into config . external_validation_keys .
function assertCopiedExternalKeys(tenantMigrationTest, migrationId) {
    const donorPrimary = tenantMigrationTest.getDonorPrimary();
    const recipientPrimary = tenantMigrationTest.getRecipientPrimary();
    recipientPrimary.getCollection(kInternalKeysNs).find().forEach(internalKeyDoc => {
        assert.neq(null, donorPrimary.getCollection(kExternalKeysNs).findOne({
            keyId: internalKeyDoc._id,
            key: internalKeyDoc.key,
            expiresAt: internalKeyDoc.expiresAt,
            migrationId,
        }));
    });
    donorPrimary.getCollection(kInternalKeysNs).find().forEach(internalKeyDoc => {
        assert.neq(null, recipientPrimary.getCollection(kExternalKeysNs).findOne({
            keyId: internalKeyDoc._id,
            key: internalKeyDoc.key,
            expiresAt: internalKeyDoc.expiresAt,
            migrationId,
        }));
    });
}
function assertCopiedExternalKeys ( tenantMigrationTest , migrationId ) { const donorPrimary = tenantMigrationTest . getDonorPrimary ( ) ; const recipientPrimary = tenantMigrationTest . getRecipientPrimary ( ) ; recipientPrimary . getCollection ( kInternalKeysNs ) . find ( ) . forEach ( internalKeyDoc => { assert . neq ( null , donorPrimary . getCollection ( kExternalKeysNs ) . findOne ( { keyId : internalKeyDoc . _id , key : internalKeyDoc . key , expiresAt : internalKeyDoc . expiresAt , migrationId , } ) ) ; } ) ; donorPrimary . getCollection ( kInternalKeysNs ) . find ( ) . forEach ( internalKeyDoc => { assert . neq ( null , recipientPrimary . getCollection ( kExternalKeysNs ) . findOne ( { keyId : internalKeyDoc . _id , key : internalKeyDoc . key , expiresAt : internalKeyDoc . expiresAt , migrationId , } ) ) ; } ) ; }
Asserts that the donor and recipient have copied each other's cluster time keys into
 config.external_validation_keys.
Asserts that the donor and recipient have copied each other ' s cluster time keys into config . external_validation_keys .