Commit 6ee5d4a1 authored by Federico Sismondi's avatar Federico Sismondi

complete refact, updated setup.py and license

parent 811dec1c
This diff is collapsed.
from __future__ import absolute_import
from .agent_cli import Agent
from __future__ import absolute_import
from .agent_cli import main
if __name__ == "__main__":
main()
...@@ -23,19 +23,21 @@ Features of the agent ...@@ -23,19 +23,21 @@ Features of the agent
* The agent isn't the way the user interact with test coordinator/manager. It simply connects to backend to establish a * The agent isn't the way the user interact with test coordinator/manager. It simply connects to backend to establish a
sort of virtual network. sort of virtual network.
""" """
from __future__ import absolute_import
import sys import sys
import logging import logging
import click import click
import uuid import uuid
import multiprocessing import multiprocessing
from connectors.tun import TunConnector from .connectors.tun import TunConnector
from connectors.core import CoreConnector from .connectors.core import CoreConnector
from connectors.http import HTTPConnector from .connectors.http import HTTPConnector
from connectors.serialconn import SerialConnector from .connectors.serialconn import SerialConnector
from utils import arrow_down, arrow_up, ioppytest_banner from .utils import arrow_down, arrow_up, ioppytest_banner
from utils.packet_dumper import launch_amqp_data_to_pcap_dumper from .utils.packet_dumper import launch_amqp_data_to_pcap_dumper
try: try:
from urllib.parse import urlparse from urllib.parse import urlparse
...@@ -68,7 +70,7 @@ Note: We assume that a session was a already created and user has url ...@@ -68,7 +70,7 @@ Note: We assume that a session was a already created and user has url
and it has been exported as environment variable and it has been exported as environment variable
e.g.: e.g.:
export AMQP_URL=amqp://alfredo:zitarrosa@exampleRmqHost[:port]/sessionXX export AMQP_URL=amqp://alfredo:zitarrosa@example.com[:port]/sessionXX
--------------------------------------------------------------------- ---------------------------------------------------------------------
1. user runs an IPv6 based implementation (e.g. coap_client) which runs in same PC where agent runs (default mode): 1. user runs an IPv6 based implementation (e.g. coap_client) which runs in same PC where agent runs (default mode):
...@@ -76,7 +78,7 @@ export AMQP_URL=amqp://alfredo:zitarrosa@exampleRmqHost[:port]/sessionXX ...@@ -76,7 +78,7 @@ export AMQP_URL=amqp://alfredo:zitarrosa@exampleRmqHost[:port]/sessionXX
\b \b
command: command:
sudo python -m agent connect \\ sudo -E python -m agent connect \\
--url $AMQP_URL \\ --url $AMQP_URL \\
--name coap_client --name coap_client
...@@ -91,7 +93,7 @@ bootstrap ( virtual interface creation, and forced IP assignation) ...@@ -91,7 +93,7 @@ bootstrap ( virtual interface creation, and forced IP assignation)
\b \b
command: command:
sudo python -m agent connect \\ sudo -E python -m agent connect \\
--url $AMQP_URL \\ --url $AMQP_URL \\
--name coap_client \\ --name coap_client \\
--force-bootstrap \\ --force-bootstrap \\
...@@ -109,7 +111,7 @@ This can be used for example when the implementation under test is a device in a ...@@ -109,7 +111,7 @@ This can be used for example when the implementation under test is a device in a
\b \b
command: command:
sudo python -m agent connect \\ sudo -E python -m agent connect \\
--url $AMQP_URL \\ --url $AMQP_URL \\
--name coap_client \\ --name coap_client \\
--force-bootstrap \\ --force-bootstrap \\
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Federico Sismondi <federico.sismondi@gmail.com> # Federico Sismondi <federico.sismondi@gmail.com>
# #
# License: ??? # License: ???
from __future__ import absolute_import
import io import io
from setuptools import setup, find_packages from setuptools import setup, find_packages
...@@ -34,17 +35,15 @@ CLASSIFIERS = [ ...@@ -34,17 +35,15 @@ CLASSIFIERS = [
with open("version.py", "w") as f: with open("version.py", "w") as f:
f.write("__version__ = '{}'\n".format(VERSION)) f.write("__version__ = '{}'\n".format(VERSION))
setup( setup(
name=name, name=name,
author='fedesismo', author='Federico Sismondi',
author_email="federicosismondi@gmail.com", author_email="federicosismondi@gmail.com",
description="Component for setting up user's environment for the tests", description="Component for setting up user's environment for the tests",
version=VERSION, version=VERSION,
license="??", license='GPLv3+',
classifiers=CLASSIFIERS, classifiers=CLASSIFIERS,
py_modules=['agent'], packages=['agent'],
packages=find_packages(exclude=["tests"]),
long_description=io.open('README.md', 'r', encoding='utf-8').read(), long_description=io.open('README.md', 'r', encoding='utf-8').read(),
install_requires=[ install_requires=[
'click', 'click',
...@@ -54,8 +53,5 @@ setup( ...@@ -54,8 +53,5 @@ setup(
'pyserial', 'pyserial',
'requests', 'requests',
], ],
entry_points={'console_scripts': [ entry_points={'console_scripts': ['ioppytest-agent=agent.agent_cli:main']},
'ioppytest-agent=agent:main',
],
},
) )
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