Ejemplo n.º 1
0
 def show_portgroup(self, portgroup_id, params=''):
     """Show detailed information about a port group."""
     portgroup_show = self.ironic('portgroup-show',
                                  flags=self.pg_api_ver,
                                  params='{0} {1}'.format(
                                      portgroup_id, params))
     return utils.get_dict_from_output(portgroup_show)
Ejemplo n.º 2
0
 def update_portgroup(self, portgroup_id, op, params=''):
     """Update information about a port group."""
     updated_portgroup = self.ironic('portgroup-update',
                                     flags=self.pg_api_ver,
                                     params='{0} {1} {2}'.format(
                                         portgroup_id, op, params))
     return utils.get_dict_from_output(updated_portgroup)
Ejemplo n.º 3
0
    def create_chassis(self, params=''):
        chassis = self.ironic('chassis-create', params=params)

        if not chassis:
            self.fail('Ironic chassis has not been created!')

        chassis = utils.get_dict_from_output(chassis)
        self.addCleanup(self.delete_chassis, chassis['uuid'])
        return chassis
Ejemplo n.º 4
0
    def create_chassis(self, params=''):
        chassis = self.ironic('chassis-create', params=params)

        if not chassis:
            self.fail('Ironic chassis has not been created!')

        chassis = utils.get_dict_from_output(chassis)
        self.addCleanup(self.delete_chassis, chassis['uuid'])
        return chassis
Ejemplo n.º 5
0
    def create_node(self, driver='fake-hardware', params=''):
        node = self.ironic('node-create',
                           params='--driver {0} {1}'.format(driver, params))

        if not node:
            self.fail('Ironic node has not been created!')

        node = utils.get_dict_from_output(node)
        self.addCleanup(self.delete_node, node['uuid'])
        return node
Ejemplo n.º 6
0
    def create_node(self, driver='fake', params=''):
        node = self.ironic('node-create',
                           params='--driver {0} {1}'.format(driver, params))

        if not node:
            self.fail('Ironic node has not been created!')

        node = utils.get_dict_from_output(node)
        self.addCleanup(self.delete_node, node['uuid'])
        return node
Ejemplo n.º 7
0
    def create_port(self, node_id, mac_address=None, params=''):

        if mac_address is None:
            mac_address = data_utils.rand_mac_address()

        port = self.ironic('port-create',
                           params='--address {0} --node {1} {2}'.format(
                               mac_address, node_id, params))
        if not port:
            self.fail('Ironic port has not been created!')

        return utils.get_dict_from_output(port)
Ejemplo n.º 8
0
 def create_portgroup(self, node_id, params=''):
     """Create a new portgroup."""
     portgroup = self.ironic('portgroup-create',
                             flags=self.pg_api_ver,
                             params='--node {0} {1}'.format(
                                 node_id, params))
     if not portgroup:
         self.fail('Ironic portgroup failed to create!')
     portgroup = utils.get_dict_from_output(portgroup)
     self.addCleanup(self.delete_portgroup,
                     portgroup['uuid'],
                     ignore_exceptions=True)
     return portgroup
Ejemplo n.º 9
0
    def test_node_get_console(self):
        """Test steps:

        1) create node
        2) check console mode using node-show
        3) get console mode using node-get-console
        4) check that node-get-console value equals node-show value
        """
        node_show = self.show_node(self.node['uuid'])
        node_get = self.ironic('node-get-console', params=self.node['uuid'])
        node_get = utils.get_dict_from_output(node_get)

        self.assertEqual(node_show['console_enabled'],
                         node_get['console_enabled'])
Ejemplo n.º 10
0
    def test_node_get_console(self):
        """Test steps:

        1) create node
        2) check console mode using node-show
        3) get console mode using node-get-console
        4) check that node-get-console value equals node-show value
        """
        node_show = self.show_node(self.node['uuid'])
        node_get = self.ironic('node-get-console', params=self.node['uuid'])
        node_get = utils.get_dict_from_output(node_get)

        self.assertEqual(node_show['console_enabled'],
                         node_get['console_enabled'])
Ejemplo n.º 11
0
    def create_port(self,
                    node_id,
                    mac_address=utils.generate_mac_address(),
                    params=''):

        port = self.ironic('port-create',
                           params='--address {0} --node {1} {2}'
                           .format(mac_address, node_id, params))
        if not port:
            self.fail('Ironic port has not been created!')

        port = utils.get_dict_from_output(port)
        self.addCleanup(self.delete_port, port['uuid'])
        return port
Ejemplo n.º 12
0
    def create_port(self,
                    node_id,
                    mac_address=None,
                    params=''):

        if mac_address is None:
            mac_address = data_utils.rand_mac_address()

        port = self.ironic('port-create',
                           params='--address {0} --node {1} {2}'
                           .format(mac_address, node_id, params))
        if not port:
            self.fail('Ironic port has not been created!')

        return utils.get_dict_from_output(port)
Ejemplo n.º 13
0
 def show_port(self, port_id, params=''):
     port_show = self.ironic('port-show', params='{0} {1}'
                             .format(port_id, params))
     return utils.get_dict_from_output(port_show)
Ejemplo n.º 14
0
 def update_port(self, port_id, operation, params=''):
     updated_port = self.ironic('port-update',
                                params='{0} {1} {2}'
                                .format(port_id, operation, params))
     return utils.get_dict_from_output(updated_port)
Ejemplo n.º 15
0
 def update_port(self, port_id, operation, flags='', params=''):
     updated_port = self.ironic('port-update',
                                flags=flags,
                                params='{0} {1} {2}'.format(
                                    port_id, operation, params))
     return utils.get_dict_from_output(updated_port)
Ejemplo n.º 16
0
 def show_port(self, port_id, params=''):
     port_show = self.ironic('port-show',
                             params='{0} {1}'.format(port_id, params))
     return utils.get_dict_from_output(port_show)
Ejemplo n.º 17
0
 def update_chassis(self, chassis_id, operation, params=''):
     updated_chassis = self.ironic('chassis-update',
                                   params='{0} {1} {2}'.format(
                                       chassis_id, operation, params))
     return utils.get_dict_from_output(updated_chassis)
Ejemplo n.º 18
0
 def show_chassis(self, chassis_id, params=''):
     chassis_show = self.ironic('chassis-show',
                                params='{0} {1}'.format(chassis_id, params))
     return utils.get_dict_from_output(chassis_show)
Ejemplo n.º 19
0
 def show_node(self, node_id, params=''):
     node_show = self.ironic('node-show',
                             params='{0} {1}'.format(node_id, params))
     return utils.get_dict_from_output(node_show)
Ejemplo n.º 20
0
 def show_node_states(self, node_id):
     show_node_states = self.ironic('node-show-states', params=node_id)
     return utils.get_dict_from_output(show_node_states)
Ejemplo n.º 21
0
 def update_node(self, node_id, params):
     updated_node = self.ironic('node-update',
                                params='{0} {1}'.format(node_id, params))
     return utils.get_dict_from_output(updated_node)
Ejemplo n.º 22
0
 def show_node(self, node_id, params=''):
     node_show = self.ironic('node-show',
                             params='{0} {1}'.format(node_id, params))
     return utils.get_dict_from_output(node_show)
Ejemplo n.º 23
0
 def show_chassis(self, chassis_id, params=''):
     chassis_show = self.ironic('chassis-show',
                                params='{0} {1}'.format(chassis_id, params))
     return utils.get_dict_from_output(chassis_show)
Ejemplo n.º 24
0
 def show_node_states(self, node_id):
     show_node_states = self.ironic('node-show-states', params=node_id)
     return utils.get_dict_from_output(show_node_states)
Ejemplo n.º 25
0
 def update_node(self, node_id, params):
     updated_node = self.ironic('node-update',
                                params='{0} {1}'.format(node_id, params))
     return utils.get_dict_from_output(updated_node)
Ejemplo n.º 26
0
 def show_driver(self, driver_name):
     driver_show = self.ironic('driver-show', params=driver_name)
     return utils.get_dict_from_output(driver_show)
Ejemplo n.º 27
0
 def show_driver(self, driver_name):
     driver_show = self.ironic('driver-show', params=driver_name)
     return utils.get_dict_from_output(driver_show)
Ejemplo n.º 28
0
 def update_chassis(self, chassis_id, operation, params):
     updated_chassis = self.ironic(
         'chassis-update',
         params='{0} {1} {2}'.format(chassis_id, operation, params))
     return utils.get_dict_from_output(updated_chassis)