Commit 5d752ccf authored by Federico Sismondi's avatar Federico Sismondi

code clean up, doc update

parent b7ccc4ca
Agent for the f-interop platform Agent for the f-interop platform (ioppytest-agent)
-------------------------------- --------------------------------------------------
Design Design
------ ------
...@@ -12,7 +12,6 @@ Note well ...@@ -12,7 +12,6 @@ Note well
---- ----
Agent is only supported by python2 -> tun librarires py2 only Agent is only supported by python2 -> tun librarires py2 only
Core Core
---- ----
When started, the agent starts up the core module. This component is in When started, the agent starts up the core module. This component is in
...@@ -179,8 +178,8 @@ tunneling all traffic through AMQP messages. ...@@ -179,8 +178,8 @@ tunneling all traffic through AMQP messages.
For running the agent you will need privileges on the machine, basically For running the agent you will need privileges on the machine, basically
cause we need to open a virtual interface to tunnel the packets. cause we need to open a virtual interface to tunnel the packets.
The command for executing it will be provided to you by F-Interop web The command for executing it will be provided to you by the
GUI,it should look something like this: GUI or AMQP broker sys admin, it should look something like this:
``` ```
sudo python -m agent connect --url amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX --name coap_client sudo python -m agent connect --url amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX --name coap_client
......
...@@ -2,29 +2,26 @@ ...@@ -2,29 +2,26 @@
""" """
Agent for f-interop ioppytest-agent CLI:
******************* ********************
Installation Installation
------------ ------------
The installation for the user is supposed to be as simple as possible. Ideally, the user TBD
should only have the ./finterop tool installed with the relevant dependencies and should
be ready to go.
Features of the agent Features of the agent
---------------------- ----------------------
* The agent must be able to inject packets in the local loop or re-emit packets it receives * The agent must be able to inject packets in the local loop or re-emit packets it receives
from the f-interop backend. from the testing tool.
* The agent MUST be able to authenticate itself with the backend. * The agent MUST be able to authenticate itself with the backend.
* The agent will monitor all the network traffic passing through it and send it to the backend. * The agent will monitor all the network traffic passing through it and send it to the backend.
* The agent isn't the way the user interact with test. It simply connects to f-interop and from there receive * The agent isn't the way the user interact with test coordinator/manager. It simply connects to backend to establish a
instruction. All the commands send from the agent are for debugging and developing purposes and won't be enabled sort of virtual network.
by default in the final version.
""" """
import logging import logging
import click import click
...@@ -44,9 +41,7 @@ try: ...@@ -44,9 +41,7 @@ try:
except ImportError: except ImportError:
from urlparse import urlparse from urlparse import urlparse
__version__ = (0, 1, 0) DEFAULT_PLATFORM = 'f-interop.rennes.inria.fr'
DEFAULT_PLATFORM = 'f-interop.paris.inria.fr'
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
...@@ -84,7 +79,7 @@ command: ...@@ -84,7 +79,7 @@ command:
expected result: expected result:
agent is connected to f-interop and now awaits bootstrap command from backend agent is listening to event bus and now awaits bootstrap command
--------------------------------------------------------------------- ---------------------------------------------------------------------
...@@ -101,7 +96,7 @@ command: ...@@ -101,7 +96,7 @@ command:
--ipv6-host 100 --ipv6-host 100
expected result: expected result:
agent is connected to f-interop, bootstrapped, and has an assigned agent is listening to event bus, bootstrapped, and has an assigned
IPv6 (check interface with ifconfig) IPv6 (check interface with ifconfig)
--------------------------------------------------------------------- ---------------------------------------------------------------------
...@@ -123,7 +118,7 @@ command: ...@@ -123,7 +118,7 @@ command:
expected result: expected result:
agent is connected to f-interop, bootstrapped, agent plays the role of a router, and hence forwards packets agent is listening to event bus, bootstrapped, agent plays the role of a router, and hence forwards packets
from bbbb:: network to cccc:: network, devices in the cccc:: network should be able to ping6 devices in the from bbbb:: network to cccc:: network, devices in the cccc:: network should be able to ping6 devices in the
bbbb:: network and vice-versa. bbbb:: network and vice-versa.
...@@ -137,7 +132,7 @@ TODO document --router-mode for re-routing the packets to another interface ...@@ -137,7 +132,7 @@ TODO document --router-mode for re-routing the packets to another interface
\b \b
--------------------------------------------------------------------- ---------------------------------------------------------------------
For exploring all "connect" command option type: python -m agent connect --help For exploring all "connect" command option type: python -m agent connect --help
For more information visit: http://doc.f-interop.eu For more information: README.md
--------------------------------------------------------------------- ---------------------------------------------------------------------
""" """
...@@ -155,7 +150,7 @@ For more information visit: http://doc.f-interop.eu ...@@ -155,7 +150,7 @@ For more information visit: http://doc.f-interop.eu
param_decls=["--url"], param_decls=["--url"],
default="amqp://guest:guest@localhost/", default="amqp://guest:guest@localhost/",
required=True, required=True,
help="AMQP url provided by F-Interop") help="AMQP url of the session")
self.session_amqp_exchange = click.Option( self.session_amqp_exchange = click.Option(
param_decls=["--exchange"], param_decls=["--exchange"],
...@@ -226,7 +221,7 @@ For more information visit: http://doc.f-interop.eu ...@@ -226,7 +221,7 @@ For more information visit: http://doc.f-interop.eu
def handle_connect(self, url, exchange, name, dump, force_bootstrap, ipv6_host, ipv6_prefix, serial): def handle_connect(self, url, exchange, name, dump, force_bootstrap, ipv6_host, ipv6_prefix, serial):
""" """
Authenticate USER and create agent connection to f-interop. Authenticate USER and create agent connection to AMQP broker.
""" """
......
""" """
Plugin to connect to the F-interop backend Plugin to connect to the AMQP broker
""" """
import json import json
import logging import logging
......
...@@ -154,11 +154,11 @@ class TunConsumer(BaseConsumer): ...@@ -154,11 +154,11 @@ class TunConsumer(BaseConsumer):
self.log.debug(("Data", message.data)) self.log.debug(("Data", message.data))
self.log.debug('\n* * * * * * * * * * * * * * * * * * * * * * *') self.log.debug('\n* * * * * * * * * * * * * * * * * * * * * * *')
self.log.info("Message received from F-Interop. Injecting in Tun. Message count (downlink): %s" self.log.info("Message received from testing tool. Injecting in Tun. Message count (downlink): %s"
% self.packet_count) % self.packet_count)
self.tun._eventBusToTun( self.tun._eventBusToTun(
sender="F-Interop server", sender="Testing Tool",
signal="tun inject", signal="tun inject",
data=message.data data=message.data
) )
......
This diff is collapsed.
...@@ -507,7 +507,7 @@ class OpenTunLinux(object): ...@@ -507,7 +507,7 @@ class OpenTunLinux(object):
log.debug("Pushing message to topic: %s" % routing_key) log.debug("Pushing message to topic: %s" % routing_key)
self.packet_count += 1 self.packet_count += 1
log.info("Messaged captured in tun. Pushing message to F-Interop. Message count (uplink): %s" log.info("Messaged captured in tun. Pushing message to testing tool. Message count (uplink): %s"
% self.packet_count) % self.packet_count)
# dispatch to EventBus # dispatch to EventBus
...@@ -722,7 +722,7 @@ class OpenTunMACOS(object): ...@@ -722,7 +722,7 @@ class OpenTunMACOS(object):
log.debug("Pushing message to topic: %s" % routing_key) log.debug("Pushing message to topic: %s" % routing_key)
self.packet_count += 1 self.packet_count += 1
log.info("Messaged captured in tun. Pushing message to F-Interop. Message count (uplink): %s" log.info("Messaged captured in tun. Pushing message to testing tool. Message count (uplink): %s"
% self.packet_count) % self.packet_count)
# dispatch to EventBus # dispatch to EventBus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment