@mock.patch('nova.console.serial._verify_port')
def test_acquire_port_not_ble_to_bind_at_any_port(self, fake_verify_port):
    (start, stop) = (15, 20)
    self.flags(port_range=('%d:%d' % (start, stop)), group='serial_console')
    fake_verify_port.side_effect = exception.SocketPortRangeExhaustedException(host='127.0.0.1')
    self.assertRaises(exception.SocketPortRangeExhaustedException, serial.acquire_port, '127.0.0.1')
@mock.patch('nova.console.serial._verify_port')
def test_acquire_port_not_ble_to_bind_at_any_port(self, fake_verify_port):
    (start, stop) = (15, 20)
    self.flags(port_range=('%d:%d' % (start, stop)), group='serial_console')
    fake_verify_port.side_effect = exception.SocketPortRangeExhaustedException(host='127.0.0.1')
    self.assertRaises(exception.SocketPortRangeExhaustedException, serial.acquire_port, '127.0.0.1')