From 5f25a5bbf6b3049ed82d0f324f8d180a4577ddc2 Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Fri, 2 Mar 2018 08:43:24 -0800 Subject: [PATCH 1/7] Updated to faradayio v0.0.4 and pytest v3.4.1 full requirements --- faradayio_cli/faradayio_cli.py | 2 +- requirements.txt | 13 ++++++++++++- setup.py | 13 ++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index 96880c7..92d9d5d 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -1,6 +1,6 @@ """faradayio-cli.faradayio-cli: provides entry point main().""" -__version__ = "0.0.3" +__version__ = "0.0.4" import argparse import serial diff --git a/requirements.txt b/requirements.txt index 84035d4..24f3e59 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,13 @@ attrs==17.4.0 -faradayio==0.0.3 +certifi==2018.1.18 +chardet==3.0.4 +coverage==4.5.1 +coveralls==1.2.0 +docopt==0.6.2 +faradayio==0.0.4 +faradayio-cli==0.0.4 flake8==3.5.0 +idna==2.6 mccabe==0.6.1 pluggy==0.6.0 py==1.5.2 @@ -8,8 +15,12 @@ pycodestyle==2.3.1 pyflakes==1.6.0 pyserial==3.4 pytest==3.4.1 +pytest-cov==2.5.1 python-pytun==2.2.1 +requests==2.18.4 +scapy-python3==0.23 six==1.11.0 sliplib==0.3.0 sphinx-rtd-theme==0.2.4 timeout-decorator==0.4.0 +urllib3==1.22 diff --git a/setup.py b/setup.py index c38ab27..76fbc71 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,15 @@ packages=['faradayio_cli'], install_requires=[ 'attrs==17.4.0', - 'faradayio==0.0.3', + 'certifi==2018.1.18', + 'chardet==3.0.4', + 'coverage==4.5.1', + 'coveralls==1.2.0', + 'docopt==0.6.2', + 'faradayio==0.0.4', + 'faradayio-cli==0.0.4', 'flake8==3.5.0', + 'idna==2.6', 'mccabe==0.6.1', 'pluggy==0.6.0', 'py==1.5.2', @@ -21,11 +28,15 @@ 'pyflakes==1.6.0', 'pyserial==3.4', 'pytest==3.4.1', + 'pytest-cov==2.5.1', 'python-pytun==2.2.1', + 'requests==2.18.4', + 'scapy-python3==0.23', 'six==1.11.0', 'sliplib==0.3.0', 'sphinx-rtd-theme==0.2.4', 'timeout-decorator==0.4.0', + 'urllib3==1.22', ], entry_points={ "console_scripts": ['faradayio-cli = faradayio_cli.faradayio_cli:main'] From b104ec636aec098ffce5f50d3b46dc5f53c2f8bc Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Thu, 8 Mar 2018 23:46:47 -0800 Subject: [PATCH 2/7] Per #29 added a `-m` and `-mtu` option to set MTU size --- faradayio_cli/faradayio_cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index 92d9d5d..fbdfb3a 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -33,6 +33,8 @@ def setupArgparse(): help="Use software loopback serial port") parser.add_argument("-p", "--port", default="/dev/ttyUSB0", help="Physical serial port of radio") + parser.add_argument("-m", "--mtu", default="1500", + help="Set Maximum Transmission Unit (MTU)") # Parse and return arguments return parser.parse_args() From bc80c7b29a100116cd780f9624089e1a8e7aba95 Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Thu, 8 Mar 2018 23:49:41 -0800 Subject: [PATCH 3/7] Added ip address `-i' and `--addr` option per #29 --- faradayio_cli/faradayio_cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index fbdfb3a..aa7b7ec 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -35,6 +35,8 @@ def setupArgparse(): help="Physical serial port of radio") parser.add_argument("-m", "--mtu", default="1500", help="Set Maximum Transmission Unit (MTU)") + parser.add_argument("-i", "--addr", default="10.0.0.1", + help="Set IP Address of TUN adapter (Farday Radio)") # Parse and return arguments return parser.parse_args() From 41153cbd01ebd6b910ef2a25b049cf9ef4a9f65e Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Thu, 8 Mar 2018 23:50:20 -0800 Subject: [PATCH 4/7] Organized options alphabetically --- faradayio_cli/faradayio_cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index aa7b7ec..588b08f 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -29,14 +29,14 @@ def setupArgparse(): parser.add_argument("id", type=int, help="ID number radio") # Optional arguments + parser.add_argument("-i", "--addr", default="10.0.0.1", + help="Set IP Address of TUN adapter (Farday Radio)") parser.add_argument("-l", "--loopback", action="store_true", help="Use software loopback serial port") - parser.add_argument("-p", "--port", default="/dev/ttyUSB0", - help="Physical serial port of radio") parser.add_argument("-m", "--mtu", default="1500", help="Set Maximum Transmission Unit (MTU)") - parser.add_argument("-i", "--addr", default="10.0.0.1", - help="Set IP Address of TUN adapter (Farday Radio)") + parser.add_argument("-p", "--port", default="/dev/ttyUSB0", + help="Physical serial port of radio") # Parse and return arguments return parser.parse_args() From dc8b0377b2432df721a7be3620c9e2dd8470605b Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Thu, 8 Mar 2018 23:52:07 -0800 Subject: [PATCH 5/7] Fixed linting error --- faradayio_cli/faradayio_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index 588b08f..9586442 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -30,7 +30,7 @@ def setupArgparse(): # Optional arguments parser.add_argument("-i", "--addr", default="10.0.0.1", - help="Set IP Address of TUN adapter (Farday Radio)") + help="Set IP Address of TUN adapter (Farday Radio)") parser.add_argument("-l", "--loopback", action="store_true", help="Use software loopback serial port") parser.add_argument("-m", "--mtu", default="1500", From ec46aae16e3ce2cf8bb7d7b242727994f47a449f Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Fri, 9 Mar 2018 00:04:29 -0800 Subject: [PATCH 6/7] Added IP and MTU options to Monitor() implementation per #29 * Added the command line arguments to the Monitor() instance --- faradayio_cli/faradayio_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index 9586442..7072992 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -33,7 +33,7 @@ def setupArgparse(): help="Set IP Address of TUN adapter (Farday Radio)") parser.add_argument("-l", "--loopback", action="store_true", help="Use software loopback serial port") - parser.add_argument("-m", "--mtu", default="1500", + parser.add_argument("-m", "--mtu", default=1500, help="Set Maximum Transmission Unit (MTU)") parser.add_argument("-p", "--port", default="/dev/ttyUSB0", help="Physical serial port of radio") @@ -100,7 +100,7 @@ def main(): # Setup TUN adapter and start try: - tun = Monitor(serialPort=serialPort, name=tunName, isRunning=isRunning) + tun = Monitor(serialPort=serialPort, name=tunName, isRunning=isRunning, addr=args.addr, mtu=int(args.mtu)) tun.start() except pytun.Error as error: From 684b2b790f15b8f7445603c7bdbefc86b1495d10 Mon Sep 17 00:00:00 2001 From: kb1lqc Date: Fri, 9 Mar 2018 00:06:14 -0800 Subject: [PATCH 7/7] Fixed linting errors on Monitor() instance --- faradayio_cli/faradayio_cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/faradayio_cli/faradayio_cli.py b/faradayio_cli/faradayio_cli.py index 7072992..503c1d0 100644 --- a/faradayio_cli/faradayio_cli.py +++ b/faradayio_cli/faradayio_cli.py @@ -100,7 +100,11 @@ def main(): # Setup TUN adapter and start try: - tun = Monitor(serialPort=serialPort, name=tunName, isRunning=isRunning, addr=args.addr, mtu=int(args.mtu)) + tun = Monitor(serialPort=serialPort, + name=tunName, + isRunning=isRunning, + addr=args.addr, + mtu=int(args.mtu)) tun.start() except pytun.Error as error: