'Succeed to failover even if a service is not updated.'

@mock.patch('cinder.volume.rpcapi.VolumeAPI.failover')
def test_failover_api_success_multiple_results_not_updated(self, failover_mock):

    rep_field = fields.ReplicationStatus
    cluster_name = 'mycluster@backend1'
    cluster = objects.Cluster(self.context, name=cluster_name, replication_status=rep_field.ENABLED, binary=constants.VOLUME_BINARY)
    cluster.create()
    services = [objects.Service(self.context, host='host1@backend1', cluster_name=cluster_name, replication_status=rep_field.ENABLED, binary=constants.VOLUME_BINARY), objects.Service(self.context, host='host2@backend1', cluster_name=cluster_name, replication_status=rep_field.ERROR, binary=constants.VOLUME_BINARY)]
    services[0].create()
    services[1].create()
    self.volume_api.failover(self.context, None, cluster_name, mock.sentinel.secondary_id)
    for service in (services[:1] + [cluster]):
        service.refresh()
        self.assertEqual(rep_field.FAILING_OVER, service.replication_status)
    services[1].refresh()
    self.assertEqual(rep_field.ERROR, services[1].replication_status)
    failover_mock.assert_called_once_with(self.context, mock.ANY, mock.sentinel.secondary_id)
    self.assertEqual(services[0].id, failover_mock.call_args[0][1].id)
