

def test_verify_networks_resp_incomplete_network_data_error(self):
    meta = self.env.default_metadata()
    mac = '02:07:43:78:4F:58'
    self.env.set_interfaces_in_meta(meta, [{
        'name': 'eth0',
        'mac': mac,
    }])
    cluster_db = self.env.create(cluster_kwargs={
        
    }, nodes_kwargs=[{
        'api': False,
        'name': 'node1',
    }, {
        'api': False,
        'name': 'node2',
        'meta': meta,
    }, {
        'api': False,
        'name': 'node3',
    }])
    (node1, node2, node3) = self.env.nodes
    nets_sent = [{
        'iface': 'eth0',
        'vlans': range(100, 105),
    }, {
        'iface': 'eth1',
        'vlans': [106],
    }, {
        'iface': 'eth2',
        'vlans': [107],
    }]
    task = Task(name='super', cluster_id=cluster_db.id)
    task.cache = {
        'args': {
            'nodes': self.nodes_message((node1, node2, node3), nets_sent),
            'offline': 0,
        },
    }
    self.db.add(task)
    self.db.commit()
    kwargs = {
        'task_uuid': task.uuid,
        'status': 'ready',
        'nodes': self.nodes_message((node1, node2, node3), nets_sent),
    }
    kwargs['nodes'][1]['networks'] = []
    self.receiver.verify_networks_resp(**kwargs)
    self.db.flush()
    self.db.refresh(task)
    self.assertEqual(task.status, 'error')
    self.assertEqual(task.message, '')
    error_nodes = [{
        'uid': node2.id,
        'interface': 'eth0',
        'name': node2.name,
        'mac': node2.interfaces[0].mac,
        'absent_vlans': nets_sent[0]['vlans'],
    }, {
        'uid': node2.id,
        'interface': 'eth1',
        'name': node2.name,
        'mac': 'unknown',
        'absent_vlans': nets_sent[1]['vlans'],
    }, {
        'uid': node2.id,
        'interface': 'eth2',
        'name': node2.name,
        'mac': 'unknown',
        'absent_vlans': nets_sent[2]['vlans'],
    }]
    self.assertItemsEqual(task.result, error_nodes)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestVerifyNetworks.test_verify_networks_resp_incomplete_network_data_error/original