'Test case for updating NetworkInterfaces when new prop includes old.
Instance.handle_update supports changing the NetworkInterfaces,
and makes the change making a resize API call against Nova.'

def test_instance_update_network_interfaces_new_include_old(self):

    return_server = self.fc.servers.list()[1]
    return_server.id = '1234'
    instance = self._create_test_instance(return_server, 'ud_network_interfaces')
    self._stub_glance_for_update()
    old_interfaces = [{'NetworkInterfaceId': 'ea29f957-cd35-4364-98fb-57ce9732c10d', 'DeviceIndex': '2'}]
    new_interfaces = [{'NetworkInterfaceId': 'ea29f957-cd35-4364-98fb-57ce9732c10d', 'DeviceIndex': '2'}, {'NetworkInterfaceId': 'd1e9c73c-04fe-4e9e-983c-d5ef94cd1a46', 'DeviceIndex': '1'}]
    before_props = self.instance_props.copy()
    before_props['NetworkInterfaces'] = old_interfaces
    update_props = self.instance_props.copy()
    update_props['NetworkInterfaces'] = new_interfaces
    after = instance.t.freeze(properties=update_props)
    before = instance.t.freeze(properties=before_props)
    self.m.StubOutWithMock(self.fc.servers, 'get')
    self.fc.servers.get('1234').MultipleTimes().AndReturn(return_server)
    self.m.StubOutWithMock(return_server, 'interface_attach')
    return_server.interface_attach('d1e9c73c-04fe-4e9e-983c-d5ef94cd1a46', None, None).AndReturn(None)
    self.m.ReplayAll()
    scheduler.TaskRunner(instance.update, after, before)()
    self.assertEqual((instance.UPDATE, instance.COMPLETE), instance.state)
