'Test case clone volume when there is replica.'

@mock.patch('cinder.volume.drivers.veritas.utils.message_data_plane')
@mock.patch('cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver._select_rt')
@mock.patch('cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver._get_volume_metadata_value')
def test_create_cloned_volume_with_replica(self, mock_gvmv, mock_srt, mock_mdp):

    mock_gvmv.side_effect = VRTSHyperScaleDriverTestCase.gvmv_side_effect
    mock_obj = {'payload': {}}
    mock_mdp.return_value = (mock_obj, None)
    mock_srt.return_value = ('{1234}', '192.0.2.2')
    vol_a = _stub_volume()
    vol_b = _stub_volume()
    metadata = {'current_dn_owner': '{1234}', 'Potential_secondary_key': '{1234}', 'Primary_datanode_ip': '192.0.2.1', 'Potential_secondary_ip': '192.0.2.2', 'current_dn_ip': '192.0.2.1', 'source_volid': vol_a['id'], 'size': vol_a['size']}
    self.assertDictContainsSubset({'provider_location': 'hyperscale-sv:/hyperscale', 'metadata': metadata}, self.driver.create_cloned_volume(vol_b, vol_a))
