1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

IOUCON start when vm start

This commit is contained in:
Julien Duponchelle 2015-02-11 15:57:02 +01:00
parent 986c63f344
commit faa7472670
4 changed files with 17 additions and 9 deletions

View File

@ -27,12 +27,15 @@ import signal
import re
import asyncio
import shutil
import argparse
import threading
from pkg_resources import parse_version
from .iou_error import IOUError
from ..adapters.ethernet_adapter import EthernetAdapter
from ..adapters.serial_adapter import SerialAdapter
from ..base_vm import BaseVM
from .ioucon import start_ioucon
import logging
@ -50,9 +53,12 @@ class IOUVM(BaseVM):
:param project: Project instance
:param manager: parent VM Manager
:param console: TCP console port
:params console_host: TCP console host IP
"""
def __init__(self, name, vm_id, project, manager, console=None):
def __init__(self, name, vm_id, project, manager,
console=None,
console_host="0.0.0.0"):
super().__init__(name, vm_id, project, manager)
@ -65,6 +71,7 @@ class IOUVM(BaseVM):
self._iou_path = None
self._iourc_path = None
self._ioucon_thread = None
self._console_host = console_host
# IOU settings
self._ethernet_adapters = [EthernetAdapter(), EthernetAdapter()] # one adapter = 4 interfaces
@ -292,7 +299,7 @@ class IOUVM(BaseVM):
raise IOUError("could not start IOU {}: {}\n{}".format(self._iou_path, e, iou_stdout))
# start console support
# self._start_ioucon()
self._start_ioucon()
# connections support
# self._start_iouyap()

View File

@ -55,7 +55,7 @@ EXIT_ABORT = 2
# Mostly from:
# https://code.google.com/p/miniboa/source/browse/trunk/miniboa/telnet.py
#--[ Telnet Commands ]---------------------------------------------------------
# --[ Telnet Commands ]---------------------------------------------------------
SE = 240 # End of sub-negotiation parameters
NOP = 241 # No operation
DATMK = 242 # Data stream portion of a sync.
@ -74,7 +74,7 @@ DONT = 254 # Don't = Demand or confirm option halt
IAC = 255 # Interpret as Command
SEND = 1 # Sub-process negotiation SEND command
IS = 0 # Sub-process negotiation IS command
#--[ Telnet Options ]----------------------------------------------------------
# --[ Telnet Options ]----------------------------------------------------------
BINARY = 0 # Transmit Binary
ECHO = 1 # Echo characters back to sender
RECON = 2 # Reconnection

View File

@ -32,6 +32,7 @@ def fake_iou_bin(tmpdir):
os.chmod(path, stat.S_IREAD | stat.S_IEXEC)
return path
@pytest.fixture
def base_params(tmpdir, fake_iou_bin):
"""Return standard parameters"""