From dc32af21f7d39f2ba7420c8fe1e0787dc196d285 Mon Sep 17 00:00:00 2001 From: yaowei Date: Mon, 18 Jan 2016 18:13:13 +0800 Subject: [PATCH] Change all name and path from stetho to steth Since project name has changed to steth, name and path should be changed too. Change-Id: I83590ec90e1c3f4fac1faa3b842a9079b248488d --- README.md | 24 +++++++++---------- etc/init.d/{stetho-agent => steth-agent} | 4 ++-- ...etho-agent.service => steth-agent.service} | 2 +- etc/{stetho.conf => steth.conf} | 0 setup.cfg | 10 ++++---- {stetho => steth}/__init__.py | 0 {stetho => steth}/agent/__init__.py | 0 {stetho => steth}/agent/agent.py | 6 ++--- {stetho => steth}/agent/api.py | 6 ++--- {stetho => steth}/agent/common/__init__.py | 0 {stetho => steth}/agent/common/log.py | 2 +- {stetho => steth}/agent/common/resource.py | 0 {stetho => steth}/agent/common/utils.py | 4 ++-- {stetho => steth}/agent/drivers/__init__.py | 0 {stetho => steth}/agent/drivers/iperf.py | 4 ++-- {stetho => steth}/common/__init__.py | 0 .../stethclient}/__init__.py | 0 .../stethclient}/agent_api.py | 4 ++-- .../stethclient}/constants.py | 8 +++---- .../stethclient}/drivers/__init__.py | 0 .../stethclient}/drivers/iperf_api.py | 4 ++-- .../stethclient}/shell.py | 18 +++++++------- .../stethclient}/strutils.py | 0 {stetho => steth}/tests/__init__.py | 0 {stetho => steth}/tests/unit/__init__.py | 0 .../tests/unit/agent/__init__.py | 0 .../tests/unit/agent/common/__init__.py | 0 .../tests/unit/agent/common/test_utils.py | 2 +- .../tests/unit/agent/drivers/__init__.py | 0 .../tests/unit/agent/drivers/test_iperf.py | 4 ++-- .../tests/unit/agent/test_agent.py | 0 .../tests/unit/agent/test_api.py | 4 ++-- .../tests/unit/common/__init__.py | 0 .../tests/unit/stethclient}/__init__.py | 0 .../unit/stethclient/test_stethclient.py | 20 +++++++++------- 35 files changed, 64 insertions(+), 62 deletions(-) rename etc/init.d/{stetho-agent => steth-agent} (95%) rename etc/init.d/{stetho-agent.service => steth-agent.service} (78%) rename etc/{stetho.conf => steth.conf} (100%) rename {stetho => steth}/__init__.py (100%) rename {stetho => steth}/agent/__init__.py (100%) rename {stetho => steth}/agent/agent.py (90%) rename {stetho => steth}/agent/api.py (97%) rename {stetho => steth}/agent/common/__init__.py (100%) rename {stetho => steth}/agent/common/log.py (95%) rename {stetho => steth}/agent/common/resource.py (100%) rename {stetho => steth}/agent/common/utils.py (98%) rename {stetho => steth}/agent/drivers/__init__.py (100%) rename {stetho => steth}/agent/drivers/iperf.py (96%) rename {stetho => steth}/common/__init__.py (100%) rename {stetho/stethoclient => steth/stethclient}/__init__.py (100%) rename {stetho/stethoclient => steth/stethclient}/agent_api.py (98%) rename {stetho/stethoclient => steth/stethclient}/constants.py (82%) rename {stetho/stethoclient => steth/stethclient}/drivers/__init__.py (100%) rename {stetho/stethoclient => steth/stethclient}/drivers/iperf_api.py (97%) rename {stetho/stethoclient => steth/stethclient}/shell.py (86%) rename {stetho/stethoclient => steth/stethclient}/strutils.py (100%) rename {stetho => steth}/tests/__init__.py (100%) rename {stetho => steth}/tests/unit/__init__.py (100%) rename {stetho => steth}/tests/unit/agent/__init__.py (100%) rename {stetho => steth}/tests/unit/agent/common/__init__.py (100%) rename {stetho => steth}/tests/unit/agent/common/test_utils.py (99%) rename {stetho => steth}/tests/unit/agent/drivers/__init__.py (100%) rename {stetho => steth}/tests/unit/agent/drivers/test_iperf.py (94%) rename {stetho => steth}/tests/unit/agent/test_agent.py (100%) rename {stetho => steth}/tests/unit/agent/test_api.py (97%) rename {stetho => steth}/tests/unit/common/__init__.py (100%) rename {stetho/tests/unit/stethoclient => steth/tests/unit/stethclient}/__init__.py (100%) rename stetho/tests/unit/stethoclient/test_stethoclient.py => steth/tests/unit/stethclient/test_stethclient.py (85%) diff --git a/README.md b/README.md index cdf7a50..3ef8d8a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Stetho +# Steth A network inspection tool for OpenStack. -Stetho is an inspection tool that can aid in pinpointing issues before deployment and during operation of an OpenStack environment. +Steth is an inspection tool that can aid in pinpointing issues before deployment and during operation of an OpenStack environment. It is modelled as agent(s)/client in which a controller interacts with agents deployed in your environment. @@ -10,23 +10,23 @@ It is modelled as agent(s)/client in which a controller interacts with agents de OpenStack networking can be deloyed as different architectures, such as ML2 with OVS(legacy and DVR), Linux bridge, OVN, Dragonflow and so forth. However, they all need enviromental prerequisites. For instance, VLAN needs to be configured as we expect; bandwidth should meet our requirements; connection between nodes should be active, etc. -Besides, with some well-deployed architectures, troubleshooting for VM networking is difficult. For instance, why VM cannot get an IP address; or why it cannot connect to Internet, etc. Stetho integrates useful scripts and third party tools(like iperf, tcpdump, etc.) to help operators keep tracking on VM networking. +Besides, with some well-deployed architectures, troubleshooting for VM networking is difficult. For instance, why VM cannot get an IP address; or why it cannot connect to Internet, etc. Steth integrates useful scripts and third party tools(like iperf, tcpdump, etc.) to help operators keep tracking on VM networking. ## Mission -Stetho is an introspection tool for OpenStack networking. Only proved to be working in ML2 with OVS for now. +Steth is an introspection tool for OpenStack networking. Only proved to be working in ML2 with OVS for now. ## Multiple Node Architecture ``` - note that stetho does not save + note that steth does not save any state, it acts as a rpc - client which makes requests to stetho + client which makes requests to steth +--------------------------+ agent(s) and analyses the result. | | - | +----CLI-----------+ | + | +------CLI---------+ | | | | | - +--------------------------+ stetho +--------------------------+ + +--------------------------+ steth +--------------------------+ | | | | | | | | +--------+---------+ | | | | | | | @@ -38,7 +38,7 @@ Stetho is an introspection tool for OpenStack networking. Only proved to be work | | | | | | | | | | +----------+-------+ | | +----------+-------+ | | +----------+-------+ | | | | | | | | | | | | | -| | stetho-agent | | | | stetho-agent | | | | stetho-agent | | +| | steth-agent | | | | steth-agent | | | | steth-agent | | | | | | | | | | | | | | | +-----------+------+ | | +-----------+------+ | | +-----------+------+ | | | | | | | | | | @@ -54,11 +54,11 @@ Stetho is an introspection tool for OpenStack networking. Only proved to be work +--------------------------+ +--------------------------+ +--------------------------+ ``` -In multiple nodes scenario, Stetho is a steteless CLI and controller. It knows each stetho agent and will read config files, interact with OpenStack, and following by sending signals to agents if it is needed. +In multiple nodes scenario, Steth is a steteless CLI and controller. It knows each steth agent and will read config files, interact with OpenStack, and following by sending signals to agents if it is needed. -Stetho Agent is introduced to manage processes or run commands. It should be installed in each compute and network node, and their IPs should be defined at config file of stetho controller. +Steth Agent is introduced to manage processes or run commands. It should be installed in each compute and network node, and their IPs should be defined at config file of steth controller. -## Stetho Agent +## Steth Agent Linstening in 0.0.0.0:9698 and waiting for the rpc request. diff --git a/etc/init.d/stetho-agent b/etc/init.d/steth-agent similarity index 95% rename from etc/init.d/stetho-agent rename to etc/init.d/steth-agent index 5627cd9..1146c38 100755 --- a/etc/init.d/stetho-agent +++ b/etc/init.d/steth-agent @@ -1,6 +1,6 @@ #!/bin/bash # -# stetho OpenStack Software Defined Networking Debuging +# steth OpenStack Software Defined Networking Debuging # # chkconfig: - 98 02 # description: neutron provides an API to \ @@ -10,7 +10,7 @@ . /etc/rc.d/init.d/functions -prog=stetho +prog=steth exec="/usr/bin/$prog-agent" pidfile="/var/run/$prog/$prog.pid" logfile="/var/log/$prog/server.log" diff --git a/etc/init.d/stetho-agent.service b/etc/init.d/steth-agent.service similarity index 78% rename from etc/init.d/stetho-agent.service rename to etc/init.d/steth-agent.service index 0e6ca79..51b782c 100644 --- a/etc/init.d/stetho-agent.service +++ b/etc/init.d/steth-agent.service @@ -6,7 +6,7 @@ After=network.target [Service] Type=simple User=root -ExecStart=/usr/bin/python /usr/bin/stetho-agent +ExecStart=/usr/bin/python /usr/bin/steth-agent Restart=on-abort [Install] diff --git a/etc/stetho.conf b/etc/steth.conf similarity index 100% rename from etc/stetho.conf rename to etc/steth.conf diff --git a/setup.cfg b/setup.cfg index 942cc95..659af3f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] -name = stetho -summary = Stetho is a sophisticated debug bridge for OpenStack Neutron. +name = steth +summary = Steth is a sophisticated debug bridge for OpenStack Neutron. description-file = README.md author = "UnitedStackSDN" @@ -23,12 +23,12 @@ setup-hooks = [files] packages = - stetho + steth [entry_points] console_scripts = - stetho = stetho.stethoclient.shell:main - stetho-agent = stetho.agent.agent:main + steth = steth.stethclient.shell:main + steth-agent = steth.agent.agent:main [egg_info] tag_build = diff --git a/stetho/__init__.py b/steth/__init__.py similarity index 100% rename from stetho/__init__.py rename to steth/__init__.py diff --git a/stetho/agent/__init__.py b/steth/agent/__init__.py similarity index 100% rename from stetho/agent/__init__.py rename to steth/agent/__init__.py diff --git a/stetho/agent/agent.py b/steth/agent/agent.py similarity index 90% rename from stetho/agent/agent.py rename to steth/agent/agent.py index 262ff8d..63f7e2e 100644 --- a/stetho/agent/agent.py +++ b/steth/agent/agent.py @@ -15,9 +15,9 @@ from SocketServer import ThreadingMixIn from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer -from stetho.agent import api as agent_api -from stetho.agent.common import utils as agent_utils -from stetho.agent.common import log +from steth.agent import api as agent_api +from steth.agent.common import utils as agent_utils +from steth.agent.common import log # Listening endpoint LISTEN_ADDR = '0.0.0.0' diff --git a/stetho/agent/api.py b/steth/agent/api.py similarity index 97% rename from stetho/agent/api.py rename to steth/agent/api.py index 2c59202..414ff84 100644 --- a/stetho/agent/api.py +++ b/steth/agent/api.py @@ -15,9 +15,9 @@ import re from netaddr import IPNetwork -from stetho.agent.common import utils as agent_utils -from stetho.agent.drivers import iperf as iperf_driver -from stetho.agent.common import log +from steth.agent.common import utils as agent_utils +from steth.agent.drivers import iperf as iperf_driver +from steth.agent.common import log LOG = log.get_logger() diff --git a/stetho/agent/common/__init__.py b/steth/agent/common/__init__.py similarity index 100% rename from stetho/agent/common/__init__.py rename to steth/agent/common/__init__.py diff --git a/stetho/agent/common/log.py b/steth/agent/common/log.py similarity index 95% rename from stetho/agent/common/log.py rename to steth/agent/common/log.py index 8c4ac6e..ff8cda4 100644 --- a/stetho/agent/common/log.py +++ b/steth/agent/common/log.py @@ -17,7 +17,7 @@ import logging FORMAT = '%(asctime)s %(filename)s %(levelname)s %(message)s' DATEFMT = '%d %b %Y %H:%M:%S' -FILENAME = '/var/log/stetho/stetho-agent.log' +FILENAME = '/var/log/steth/steth-agent.log' def get_logger(filename=FILENAME, format=FORMAT, diff --git a/stetho/agent/common/resource.py b/steth/agent/common/resource.py similarity index 100% rename from stetho/agent/common/resource.py rename to steth/agent/common/resource.py diff --git a/stetho/agent/common/utils.py b/steth/agent/common/utils.py similarity index 98% rename from stetho/agent/common/utils.py rename to steth/agent/common/utils.py index e9d6552..d2a559c 100644 --- a/stetho/agent/common/utils.py +++ b/steth/agent/common/utils.py @@ -20,8 +20,8 @@ import signal import subprocess import platform from threading import Timer -from stetho.agent.common import resource -from stetho.agent.common import log +from steth.agent.common import resource +from steth.agent.common import log LOG = log.get_logger() diff --git a/stetho/agent/drivers/__init__.py b/steth/agent/drivers/__init__.py similarity index 100% rename from stetho/agent/drivers/__init__.py rename to steth/agent/drivers/__init__.py diff --git a/stetho/agent/drivers/iperf.py b/steth/agent/drivers/iperf.py similarity index 96% rename from stetho/agent/drivers/iperf.py rename to steth/agent/drivers/iperf.py index 69aea5e..5972d22 100644 --- a/stetho/agent/drivers/iperf.py +++ b/steth/agent/drivers/iperf.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from stetho.agent.common import log -from stetho.agent.common import utils +from steth.agent.common import log +from steth.agent.common import utils LOG = log.get_logger() diff --git a/stetho/common/__init__.py b/steth/common/__init__.py similarity index 100% rename from stetho/common/__init__.py rename to steth/common/__init__.py diff --git a/stetho/stethoclient/__init__.py b/steth/stethclient/__init__.py similarity index 100% rename from stetho/stethoclient/__init__.py rename to steth/stethclient/__init__.py diff --git a/stetho/stethoclient/agent_api.py b/steth/stethclient/agent_api.py similarity index 98% rename from stetho/stethoclient/agent_api.py rename to steth/stethclient/agent_api.py index 38ac692..d05471d 100644 --- a/stetho/stethoclient/agent_api.py +++ b/steth/stethclient/agent_api.py @@ -47,13 +47,13 @@ class Logger(): try: - from stetho.stethoclient.constants import AGENT_INFOS + from steth.stethclient.constants import AGENT_INFOS except: AGENT_INFOS = { 'agent-64': "127.0.0.1", 'agent-65': "127.0.0.1", } - Logger.log_fail("Import stetho configure file fail. Use fake data!") + Logger.log_fail("Import steth configure file fail. Use fake data!") def setup_server(agent): diff --git a/stetho/stethoclient/constants.py b/steth/stethclient/constants.py similarity index 82% rename from stetho/stethoclient/constants.py rename to steth/stethclient/constants.py index dabd384..d9e8d28 100644 --- a/stetho/stethoclient/constants.py +++ b/steth/stethclient/constants.py @@ -17,16 +17,16 @@ from oslo_config import cfg OPTS = [ cfg.ListOpt('network_agents_info', default=[], - help="Mappings of network agents and stetho listened IP."), + help="Mappings of network agents and steth listened IP."), cfg.ListOpt('compute_agents_info', default=[], - help="Mappings of compute agents and stetho listened IP."), + help="Mappings of compute agents and steth listened IP."), cfg.StrOpt('managed_network_prefix', default='127.0.0.', help="Managed network prefix."), ] cfg.CONF.register_opts(OPTS) -cfg.CONF([], project='stetho', - default_config_files=['/etc/stetho/stetho.conf']) +cfg.CONF([], project='steth', + default_config_files=['/etc/steth/steth.conf']) AGENT_INFOS = {} all_agents = cfg.CONF.network_agents_info + cfg.CONF.compute_agents_info diff --git a/stetho/stethoclient/drivers/__init__.py b/steth/stethclient/drivers/__init__.py similarity index 100% rename from stetho/stethoclient/drivers/__init__.py rename to steth/stethclient/drivers/__init__.py diff --git a/stetho/stethoclient/drivers/iperf_api.py b/steth/stethclient/drivers/iperf_api.py similarity index 97% rename from stetho/stethoclient/drivers/iperf_api.py rename to steth/stethclient/drivers/iperf_api.py index 4a916d1..708fca6 100644 --- a/stetho/stethoclient/drivers/iperf_api.py +++ b/steth/stethclient/drivers/iperf_api.py @@ -45,13 +45,13 @@ class Logger(): print Logger.FAIL + info + Logger.ENDC try: - from stetho.stethoclient.constants import AGENT_INFOS + from steth.stethclient.constants import AGENT_INFOS except: AGENT_INFOS = { 'agent-64': "127.0.0.1", 'agent-65': "127.0.0.1", } - Logger.log_fail("Import stetho configure file fail. Use fake data!") + Logger.log_fail("Import steth configure file fail. Use fake data!") def setup_server(agent): diff --git a/stetho/stethoclient/shell.py b/steth/stethclient/shell.py similarity index 86% rename from stetho/stethoclient/shell.py rename to steth/stethclient/shell.py index 7b5a7ae..a4d83e9 100644 --- a/stetho/stethoclient/shell.py +++ b/steth/stethclient/shell.py @@ -13,20 +13,20 @@ # License for the specific language governing permissions and limitations # under the License. """ -Command-line interface to Stetho APIs +Command-line interface to Steth APIs """ import sys from cliff import app from cliff import commandmanager -from stetho.stethoclient import agent_api -from stetho.stethoclient.drivers import iperf_api -from stetho.stethoclient import strutils +from steth.stethclient import agent_api +from steth.stethclient.drivers import iperf_api +from steth.stethclient import strutils VERSION = '0.1' -STETHO_API_VERSION = '0.1' +STETH_API_VERSION = '0.1' COMMAND_V1 = { 'setup-link': agent_api.SetUpLink, @@ -42,13 +42,13 @@ COMMAND_V1 = { COMMANDS = {'0.1': COMMAND_V1} -class StethoShell(app.App): +class StethShell(app.App): def __init__(self, apiversion): - super(StethoShell, self).__init__( + super(StethShell, self).__init__( description=__doc__.strip(), version=VERSION, - command_manager=commandmanager.CommandManager('stetho.cli'), + command_manager=commandmanager.CommandManager('steth.cli'), ) self.commands = COMMANDS for k, v in self.commands[apiversion].items(): @@ -68,7 +68,7 @@ class StethoShell(app.App): def main(argv=sys.argv[1:]): try: - return StethoShell(STETHO_API_VERSION).run( + return StethShell(STETH_API_VERSION).run( list(map(strutils.safe_decode, argv))) except KeyboardInterrupt: print "... terminating neutron client" diff --git a/stetho/stethoclient/strutils.py b/steth/stethclient/strutils.py similarity index 100% rename from stetho/stethoclient/strutils.py rename to steth/stethclient/strutils.py diff --git a/stetho/tests/__init__.py b/steth/tests/__init__.py similarity index 100% rename from stetho/tests/__init__.py rename to steth/tests/__init__.py diff --git a/stetho/tests/unit/__init__.py b/steth/tests/unit/__init__.py similarity index 100% rename from stetho/tests/unit/__init__.py rename to steth/tests/unit/__init__.py diff --git a/stetho/tests/unit/agent/__init__.py b/steth/tests/unit/agent/__init__.py similarity index 100% rename from stetho/tests/unit/agent/__init__.py rename to steth/tests/unit/agent/__init__.py diff --git a/stetho/tests/unit/agent/common/__init__.py b/steth/tests/unit/agent/common/__init__.py similarity index 100% rename from stetho/tests/unit/agent/common/__init__.py rename to steth/tests/unit/agent/common/__init__.py diff --git a/stetho/tests/unit/agent/common/test_utils.py b/steth/tests/unit/agent/common/test_utils.py similarity index 99% rename from stetho/tests/unit/agent/common/test_utils.py rename to steth/tests/unit/agent/common/test_utils.py index fa4dc15..3cec41d 100644 --- a/stetho/tests/unit/agent/common/test_utils.py +++ b/steth/tests/unit/agent/common/test_utils.py @@ -18,7 +18,7 @@ import mock import unittest import types import platform -from stetho.agent.common import utils +from steth.agent.common import utils class TestUtils(unittest.TestCase): diff --git a/stetho/tests/unit/agent/drivers/__init__.py b/steth/tests/unit/agent/drivers/__init__.py similarity index 100% rename from stetho/tests/unit/agent/drivers/__init__.py rename to steth/tests/unit/agent/drivers/__init__.py diff --git a/stetho/tests/unit/agent/drivers/test_iperf.py b/steth/tests/unit/agent/drivers/test_iperf.py similarity index 94% rename from stetho/tests/unit/agent/drivers/test_iperf.py rename to steth/tests/unit/agent/drivers/test_iperf.py index fce5bb8..6338e0c 100644 --- a/stetho/tests/unit/agent/drivers/test_iperf.py +++ b/steth/tests/unit/agent/drivers/test_iperf.py @@ -15,8 +15,8 @@ import mock import unittest -from stetho.agent.drivers import iperf -from stetho.agent.common import utils +from steth.agent.drivers import iperf +from steth.agent.common import utils class TestIPerfDriver(unittest.TestCase): diff --git a/stetho/tests/unit/agent/test_agent.py b/steth/tests/unit/agent/test_agent.py similarity index 100% rename from stetho/tests/unit/agent/test_agent.py rename to steth/tests/unit/agent/test_agent.py diff --git a/stetho/tests/unit/agent/test_api.py b/steth/tests/unit/agent/test_api.py similarity index 97% rename from stetho/tests/unit/agent/test_api.py rename to steth/tests/unit/agent/test_api.py index c371b44..965b7c6 100644 --- a/stetho/tests/unit/agent/test_api.py +++ b/steth/tests/unit/agent/test_api.py @@ -15,8 +15,8 @@ import mock import unittest -from stetho.agent import api -from stetho.agent.common import utils as agent_utils +from steth.agent import api +from steth.agent.common import utils as agent_utils class TestApi(unittest.TestCase): diff --git a/stetho/tests/unit/common/__init__.py b/steth/tests/unit/common/__init__.py similarity index 100% rename from stetho/tests/unit/common/__init__.py rename to steth/tests/unit/common/__init__.py diff --git a/stetho/tests/unit/stethoclient/__init__.py b/steth/tests/unit/stethclient/__init__.py similarity index 100% rename from stetho/tests/unit/stethoclient/__init__.py rename to steth/tests/unit/stethclient/__init__.py diff --git a/stetho/tests/unit/stethoclient/test_stethoclient.py b/steth/tests/unit/stethclient/test_stethclient.py similarity index 85% rename from stetho/tests/unit/stethoclient/test_stethoclient.py rename to steth/tests/unit/stethclient/test_stethclient.py index fc08b7d..3c7ccd7 100644 --- a/stetho/tests/unit/stethoclient/test_stethoclient.py +++ b/steth/tests/unit/stethclient/test_stethclient.py @@ -1,8 +1,8 @@ import mock import unittest -from stetho.stethoclient import shell -from stetho.stethoclient import agent_api -from stetho.stethoclient.drivers import iperf_api +from steth.stethclient import shell +from steth.stethclient import agent_api +from steth.stethclient.drivers import iperf_api class Server(object): @@ -32,20 +32,20 @@ class Server(object): pass -class TestStethoClientMethods(unittest.TestCase): +class TestStethClientMethods(unittest.TestCase): def setUp(self): self.server = Server() agent_api.setup_server = mock.Mock(return_value=self.server) iperf_api.setup_server = mock.Mock(return_value=self.server) - def test_stethoclient_get_interface(self): + def test_stethclient_get_interface(self): r = {'message': '', 'code': 0, 'data': {'name': 'eth0'}} self.server.get_interface = mock.Mock(return_value=r) shell.main(['get-interface', 'agent-64', 'eth0']) self.assertEqual(self.server.get_interface.called, True) - def test_stethoclient_add_vlan_to_interface(self): + def test_stethclient_add_vlan_to_interface(self): r = {'message': '', 'code': 0, 'data': {}} rr = {'message': '', 'code': 0, 'data': {'name': 'eth0'}} self.server.add_vlan_to_interface = mock.Mock(return_value=r) @@ -53,13 +53,13 @@ class TestStethoClientMethods(unittest.TestCase): shell.main(['add-vlan-to-interface', 'agent-64', 'eth0', '100']) self.assertEqual(self.server.add_vlan_to_interface.called, True) - def test_stethoclient_ping(self): + def test_stethclient_ping(self): r = {'message': '', 'code': 0, 'data': {'1.2.4.8': 100}} self.server.ping = mock.Mock(return_value=r) shell.main(['ping', 'agent-64', '1.2.4.8']) self.assertEqual(self.server.ping.called, True) - def test_stethoclient_setup_link(self): + def test_stethclient_setup_link(self): r = {'message': '', 'code': 0, 'data': {}} rr = {'message': '', 'code': 0, 'data': {'name': 'eth0'}} self.server.get_interface = mock.Mock(return_value=rr) @@ -67,7 +67,7 @@ class TestStethoClientMethods(unittest.TestCase): shell.main(['setup-link', 'agent-64', 'eth1', '192.168.10.10/24']) self.assertEqual(self.server.setup_link.called, True) - def test_stethoclint_check_ports_on_br(self): + def test_stethclint_check_ports_on_br(self): r = {'message': '', 'code': 0, 'data': {'ovs_port': True}} self.server.check_ports_on_br = mock.Mock(return_value=r) shell.main(['check-ports-on-br', 'agent-64', 'br0', 'ovs_port']) @@ -90,7 +90,9 @@ class TestStethoClientMethods(unittest.TestCase): self.server.start_iperf_client = mock.Mock(return_value=iperf_client_r) self.server.teardown_iperf_server = mock.Mock( return_value=teardown_iperf_r) + iperf_api.get_ip_by_hostname = mock.Mock(return_value='10.0.0.64') shell.main(['check-iperf', 'agent-64', 'agent-64']) self.assertEqual(self.server.setup_iperf_server.called, True) + self.assertEqual(iperf_api.get_ip_by_hostname.called, True) self.assertEqual(self.server.start_iperf_client.called, True) self.assertEqual(self.server.teardown_iperf_server.called, True)