...
 
Commits (2)
......@@ -16,6 +16,7 @@ Installation
------------
create virtual env for not messing up your current environment
```
pip install virtualenv
virtualenv -p /usr/bin/python2.7 my_venv
......@@ -23,6 +24,7 @@ source my_venv/bin/activate
```
install ioppytest-agent using pip
```
pip install ioppytest-agent
```
......@@ -49,6 +51,66 @@ Error handling
When there is a user interrupt signal (Ctrl-C) the agent should kill
all other components and disconnect as gracefully as possible.
IP tunneling mode (active-probe)
--------------------------------
This mode can be used for communicating two IPv6-based implementations
tunneling all traffic through AMQP messages.
## Running the agent for IP tun
For running the agent you will need privileges on the machine, basically
cause we need to open a virtual interface to tunnel the packets.
The command for executing it will be provided to you by the
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
```
for more info
```
python agent.py --help
python agent.py connect --help
```
```
+----------------+
| |
| AMQP broker |
| |
| |
+----------------+
^ +
| |
data.tun.fromAgent.agent_name | | data.tun.toAgent.agent_name
| |
+ v
+---------------------------------+
| |
| Agent |
| |
| (tun mode) |
| |
| |
| +------tun interface--------+ |
| |
| +----------------------------+ |
| | IPv6-based | |
| | communicating | |
| | piece of software | |
| | (e.g. coap client) | |
| | | |
| +----------------------------+ |
+---------------------------------+
```
Serial mode (with 802.15.4 probe)
---------------------------------
......@@ -74,10 +136,11 @@ This mode can be used for connecting two remote (geographically distant)
Active mode probe automatically ACKs messages received by the user
device, the 802.15.4 are not forwarded to the AMQP connection.
## Running the agent
## Running the agent (serial mode) w/ active-probe
export AMQP connection variables, and USB params for the serial connection
env vars:
`
export AMQP_EXCHANGE='amq.topic'
export AMQP_URL="amqp://someUser:somePassword@f-interop.rennes.inria.fr/sessionXX"
......@@ -91,6 +154,7 @@ export FINTEROP_CONNECTOR_BAUDRATE=115200
`
then execute (e.g. for a coap_server running under the agent):
`
python -m agent connect --url $AMQP_URL --name coap_server --serial
`
......@@ -138,7 +202,7 @@ data.serial.fromAgent.agent_name | | data.serial.toAgent.agent_name
This mode can be used for forwarding all sniffed packet in a 802.15.4 network to AMQP broker
and eventually other tools listening to the correct routing keys/topics.
## Running the agent
## Running the agent (serial mode) w/ passive-probe
**TBD**
```
......@@ -188,64 +252,3 @@ data.serial.fromAgent.agent_name |
+---------------+ +---------------+
```
IP tunneling mode (active-probe)
--------------------------------
This mode can be used for communicating two IPv6-based implementations
tunneling all traffic through AMQP messages.
## Running the agent
For running the agent you will need privileges on the machine, basically
cause we need to open a virtual interface to tunnel the packets.
The command for executing it will be provided to you by the
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
```
for more info
```
python agent.py --help
python agent.py connect --help
```
```
+----------------+
| |
| AMQP broker |
| |
| |
+----------------+
^ +
| |
data.tun.fromAgent.agent_name | | data.tun.toAgent.agent_name
| |
+ v
+---------------------------------+
| |
| Agent |
| |
| (tun mode) |
| |
| |
| +------tun interface--------+ |
| |
| +----------------------------+ |
| | IPv6-based | |
| | communicating | |
| | piece of software | |
| | (e.g. coap client) | |
| | | |
| +----------------------------+ |
+---------------------------------+
```
\ No newline at end of file
from __future__ import absolute_import
from . import messages
from . import packet_dumper
from . import serial_listener
......
......@@ -6,7 +6,6 @@ import sys
from kombu import Exchange
from ..utils import messages
from ..utils import arrow_up
STATE_OK = 0
STATE_ESC = 1
......@@ -20,6 +19,49 @@ logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
arrow_up = """
_
/ \\
/ \\
/ \\
/ \\
/__ __\\
| | _ _ _
| | | (_) | |
| | _ _ _ __ | |_ _ __ | | __
| | | | | | '_ \| | | '_ \\| |/ /
| | | |_| | |_) | | | | | | <
| | \__,_| .__/|_|_|_| |_|_|\_\\
| | | |
| | |_|
!___!
\\ O /
\\/|\/
|
/ \\
_/ \\ _
"""
arrow_down = """
___
| |
| | _ _ _ _
| | | | | (_) | |
| | __| | _____ ___ __ | |_ _ __ | | __
| | / _` |/ _ \\ \\ /\\ / / '_ \\| | | '_ '\\| |/ /
| | | (_| | (_) \\ V V /| | | | | | | | | <
| | \\__,_|\\___/ \\_/\\_/ |_| |_|_|_|_| |_|_|\_\\
| |
__! !__,
\\ / \O
\\ / \/|
\\ / |
\\ / / \\
Y _/ _\\
"""
class SerialListener(object):
def __init__(self, agent_name, rmq_connection, rmq_exchange="amq.topic", serial_port='/dev/ttyUSB0',
serial_boudrate='460800'):
......
# Author:
# Authors:
# Federico Sismondi <federicosismondi@gmail.com>
# Remy Leone
from __future__ import absolute_import
import io
from setuptools import setup, find_packages
MAJOR = 0
MINOR = 1
PATCH = 8
VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)
PATCH = 9
VERSION = '{}.{}.{}'.format(MAJOR, MINOR, PATCH)
name = 'ioppytest-agent'
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Topic :: Internet",
"Topic :: Software Development :: Testing",
"Topic :: Scientific/Engineering",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS"
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Internet',
'Topic :: Software Development :: Testing',
'Topic :: Scientific/Engineering',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS'
]
with open("version.py", "w") as f:
f.write("__version__ = '{}'\n".format(VERSION))
with open('version.py', 'w') as f:
f.write('__version__ = "{version}"\n'.format(version=VERSION))
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name=name,
author='Federico Sismondi',
author_email="federicosismondi@gmail.com",
author_email='federicosismondi@gmail.com',
maintainer='Federico Sismondi',
maintainer_email="federicosismondi@gmail.com",
maintainer_email='federicosismondi@gmail.com',
url='https://gitlab.f-interop.eu/f-interop-contributors/agent',
description="Component for setting up user's environment for the tests",
description='Component for setting up users environment for the tests',
version=VERSION,
license='GPLv3+',
classifiers=CLASSIFIERS,
packages=find_packages(exclude=["tests"]),
long_description=io.open('README.md', 'r', encoding='utf-8').read(),
packages=find_packages(exclude=['tests']),
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=[
'click',
'six',
......@@ -53,4 +57,3 @@ setup(
],
entry_points={'console_scripts': ['ioppytest-agent=agent.agent_cli:main']},
)