'Test case user snapshot.'

@mock.patch('cinder.volume.drivers.veritas.utils.message_controller')
@mock.patch('cinder.volume.drivers.veritas.utils.message_data_plane')
@mock.patch('cinder.volume.drivers.veritas.utils.episodic_snap')
@mock.patch('cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver._get_volume_metadata_value')
@mock.patch('cinder.volume.drivers.veritas.utils.message_compute_plane')
def test_create_snapshot_user(self, mock_cdp, mock_gvmv, mock_es, mock_mdp, mock_mc):

    mock_gvmv.side_effect = VRTSHyperScaleDriverTestCase.gvmv_side_effect
    mock_es_obj = {'payload': {'update': False}}
    mock_es.return_value = mock_es_obj
    mock_obj = {'payload': {}}
    mock_mdp.return_value = ('', None)
    mock_mc.return_value = ('', None)
    mock_cdp.return_value = (mock_obj, None)
    fake_snapshot = _stub_snapshot()
    expected = {'metadata': {'status': 'creating', 'datanode_ip': '192.0.2.1', 'TYPE': vrts.TYPE_USER_SNAP}}
    self.assertEqual(expected, self.driver.create_snapshot(fake_snapshot))
