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
This commit is contained in:
yaowei 2016-01-18 18:13:13 +08:00
parent dcba681f80
commit dc32af21f7
35 changed files with 64 additions and 62 deletions

View File

@ -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.

View File

@ -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"

View File

@ -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]

View File

@ -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 =

View File

@ -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'

View File

@ -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()

View File

@ -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,

View File

@ -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()

View File

@ -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()

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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"

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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)