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)
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)
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
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
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
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
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)
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
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'])
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'])
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
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def show_driver(self, driver_name): driver_show = self.ironic('driver-show', params=driver_name) return utils.get_dict_from_output(driver_show)
def show_driver(self, driver_name): driver_show = self.ironic('driver-show', params=driver_name) return utils.get_dict_from_output(driver_show)
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)