Ejemplo n.º 1
0
 def test_register_ironic_node_pxe_drac(self):
     node_properties = {
         "cpus": "1",
         "memory_mb": "2048",
         "local_gb": "30",
         "cpu_arch": "amd64",
         "capabilities": "num_nics:6"
     }
     node = self._get_node()
     node['pm_type'] = 'pxe_drac'
     node['pm_port'] = '6230'
     client = mock.MagicMock()
     nodes.register_ironic_node(node, client=client)
     client.node.create.assert_called_once_with(driver='pxe_drac',
                                                name='node1',
                                                properties=node_properties,
                                                resource_class='baremetal',
                                                driver_info={
                                                    'drac_password':
                                                    '******',
                                                    'drac_address':
                                                    'foo.bar',
                                                    'drac_username': '******',
                                                    'drac_port': '6230'
                                                })
Ejemplo n.º 2
0
 def test_register_ironic_node_redfish(self):
     node_properties = {
         "cpus": "1",
         "memory_mb": "2048",
         "local_gb": "30",
         "cpu_arch": "amd64",
         "capabilities": "num_nics:6"
     }
     node = self._get_node()
     node['pm_type'] = 'redfish'
     node['pm_system_id'] = '/redfish/v1/Systems/1'
     client = mock.MagicMock()
     nodes.register_ironic_node(node, client=client)
     client.node.create.assert_called_once_with(driver='redfish',
                                                name='node1',
                                                properties=node_properties,
                                                resource_class='baremetal',
                                                driver_info={
                                                    'redfish_password':
                                                    '******',
                                                    'redfish_address':
                                                    'foo.bar',
                                                    'redfish_username':
                                                    '******',
                                                    'redfish_system_id':
                                                    '/redfish/v1/Systems/1'
                                                })
Ejemplo n.º 3
0
 def test_register_ironic_node_fake_pxe(self):
     node_properties = {
         "cpus": "1",
         "memory_mb": "2048",
         "local_gb": "30",
         "cpu_arch": "amd64",
         "capabilities": "num_nics:6"
     }
     node = self._get_node()
     for v in ('pm_addr', 'pm_user', 'pm_password'):
         del node[v]
     node['pm_type'] = 'fake_pxe'
     client = mock.MagicMock()
     nodes.register_ironic_node(node, client=client)
     client.node.create.assert_called_once_with(driver='fake_pxe',
                                                name='node1',
                                                properties=node_properties,
                                                resource_class='baremetal',
                                                driver_info={})