'Helper to check that events are received for expected devices.
:param devices: The list of expected devices. WARNING: This list
is modified by this method
:param state: The state of the devices (added or removed)'

def _expected_devices_events(self, devices, state):

    events = self.monitor.get_events()
    event_devices = [(dev['name'], dev['external_ids']) for dev in events.get(state)]
    for dev in event_devices:
        if (dev[0] in devices):
            devices.remove(dev[0])
            self.assertEqual(dev[1].get('iface-status'), 'active')
        if (not devices):
            return True
