mirror of
https://github.com/faucetsdn/ryu.git
synced 2025-08-06 22:57:17 +02:00
fix docker tests and print output for python3
This commit is contained in:
parent
a394673993
commit
8533f7ef3f
@ -35,7 +35,7 @@ LOG = logging.getLogger(__name__)
|
||||
DOCKER_IMAGE_MININET = 'osrg/ryu-book'
|
||||
|
||||
OVSDB_MANAGER_ADDR = 'ptcp:6640'
|
||||
OVSDB_SWITCH_ADDR = 'tcp:%s:6640'
|
||||
OVSDB_SWITCH_ADDR = 'tcp:0.0.0.0:6640'
|
||||
|
||||
|
||||
def setUpModule():
|
||||
@ -93,7 +93,7 @@ class TestVSCtl(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def _docker_run(cls, image):
|
||||
return _run('docker run --privileged -t -d %s' % image)[0]
|
||||
return _run('docker run --privileged -t -d -p 6640:6640 %s' % image)[0]
|
||||
|
||||
@classmethod
|
||||
def _docker_stop(cls, container):
|
||||
@ -124,7 +124,7 @@ class TestVSCtl(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def _set_up_vsctl(cls):
|
||||
cls.vsctl = vsctl.VSCtl(OVSDB_SWITCH_ADDR % cls.container_mn_ip)
|
||||
cls.vsctl = vsctl.VSCtl(OVSDB_SWITCH_ADDR)
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
@ -70,29 +70,29 @@ def check_dependencies():
|
||||
if not HAS_VIRTUALENV:
|
||||
raise Exception('Virtualenv not found. ' + \
|
||||
'Try installing python-virtualenv')
|
||||
print 'done.'
|
||||
print('done.') # pylint: disable=print-statement
|
||||
|
||||
|
||||
def create_virtualenv(venv=VENV, install_pip=False):
|
||||
"""Creates the virtual environment and installs PIP only into the
|
||||
virtual environment
|
||||
"""
|
||||
print 'Creating venv...',
|
||||
print('Creating venv...') # pylint: disable=print-statement
|
||||
|
||||
install = ['virtualenv', '-q', venv]
|
||||
run_command(install)
|
||||
|
||||
print 'done.'
|
||||
print 'Installing pip in virtualenv...',
|
||||
print('done.') # pylint: disable=print-statement
|
||||
print('Installing pip in virtualenv...') # pylint: disable=print-statement
|
||||
if install_pip and \
|
||||
not run_command(['tools/with_venv.sh', 'easy_install',
|
||||
'pip>1.0']):
|
||||
die("Failed to install pip.")
|
||||
print 'done.'
|
||||
print('done.') # pylint: disable=print-statement
|
||||
|
||||
|
||||
def install_dependencies(venv=VENV):
|
||||
print 'Installing dependencies with pip (this can take a while)...'
|
||||
print('Installing dependencies with pip (this can take a while)...') # pylint: disable=print-statement
|
||||
run_command(['tools/with_venv.sh', 'pip', 'install', '-r',
|
||||
PIP_REQUIRES], redirect_output=False)
|
||||
run_command(['tools/with_venv.sh', 'pip', 'install', '-r',
|
||||
@ -126,7 +126,7 @@ def print_help():
|
||||
|
||||
Also, make test will automatically use the virtualenv.
|
||||
"""
|
||||
print help
|
||||
print(help) # pylint: disable=print-statement
|
||||
|
||||
|
||||
def main(argv):
|
||||
|
Loading…
Reference in New Issue
Block a user