

def test_nodes_info(self):
    info = InstallationInfo()
    cluster = self.env.create(release_kwargs={
        'operating_system': consts.RELEASE_OS.centos,
    })
    self.env.create_nodes_w_interfaces_count(nodes_count=2, if_count=4, roles=['controller', 'compute'], pending_addition=True, cluster_id=cluster['id'])
    self.env.make_bond_via_api('bond0', consts.BOND_MODES.active_backup, ['eth1', 'eth2'], node_id=self.env.nodes[0].id)
    nodes_info = info.get_nodes_info(self.env.nodes)
    self.assertEquals(len(self.env.nodes), len(nodes_info))
    for (idx, node) in enumerate(self.env.nodes):
        node_info = nodes_info[idx]
        self.assertEquals(node_info['id'], node.id)
        self.assertEquals(node_info['group_id'], node.group_id)
        self.assertListEqual(node_info['roles'], node.roles)
        self.assertEquals(node_info['os'], node.os_platform)
        self.assertEquals(node_info['status'], node.status)
        self.assertEquals(node_info['error_type'], node.error_type)
        self.assertEquals(node_info['online'], node.online)
        self.assertEquals(node_info['manufacturer'], node.manufacturer)
        self.assertEquals(node_info['platform_name'], node.platform_name)
        self.assertIn('meta', node_info)
        for iface in node_info['meta']['interfaces']:
            self.assertNotIn('mac', iface)
        self.assertNotIn('fqdn', node_info['meta']['system'])
        self.assertNotIn('serial', node_info['meta']['system'])
        self.assertEquals(node_info['pending_addition'], node.pending_addition)
        self.assertEquals(node_info['pending_deletion'], node.pending_deletion)
        self.assertEquals(node_info['pending_roles'], node.pending_roles)
        self.assertEqual(node_info['nic_interfaces'], [{
            'id': i.id,
        } for i in node.nic_interfaces])
        self.assertEqual(node_info['bond_interfaces'], [{
            'id': i.id,
            'slaves': [s.id for s in i.slaves],
        } for i in node.bond_interfaces])

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/unit/fuel_statistics_tests/test_installation_info.py TestInstallationInfo.test_nodes_info/original