From: Jozef Urbanovsky jurbanov@redhat.com
deleted obsolete code, referencing lnst-ctl, recipes, xslt results and test tools added install_requires with python dependencies
Signed-off-by: Jozef Urbanovsky jurbanov@redhat.com --- setup.py | 151 +++++++++++++++++-------------------------------------- 1 file changed, 45 insertions(+), 106 deletions(-)
diff --git a/setup.py b/setup.py index 2a6a491..33aacd6 100755 --- a/setup.py +++ b/setup.py @@ -1,30 +1,31 @@ #!/usr/bin/env python3 + """ Install script for lnst
-This script will install both lnst controller and slave -to your system. To install LNST, execute it as follows: +This script will install LNST to your system. +To install LNST, execute it as follows:
- ./setup.py install + pip3 install .
To install lnst to a different root use:
- .setup.py install --root=<path> + pip3 install --prefix <path> .
"""
__author__ = """ rpazdera@redhat.com (Radek Pazdera) +jurbanov@redhat.com (Jozef Urbanovsky) """
-import sys import re import gzip -import os from time import gmtime, strftime from setuptools import setup, find_packages from lnst.Common.Version import lnst_version
+ def process_template(template_path, values): template_name_re = ".in$" if not re.search(template_name_re, template_path): @@ -40,6 +41,7 @@ def process_template(template_path, values): f.close() t.close()
+ def gzip_file(path): src = open(path, "rb") dst = gzip.open(path + ".gz", "wb") @@ -47,13 +49,12 @@ def gzip_file(path): dst.close() src.close()
+ # Various paths CONF_DIR = "/etc/" BASH_COMP_DIR = CONF_DIR + "bash_completion.d/" MAN_DIR = "/usr/share/man/man1/"
-CTL_MODULES_LOCATIONS = "/usr/share/lnst/test_modules/" -CTL_TOOLS_LOCATIONS = "/usr/share/lnst/test_tools/" CTL_RESOURCE_DIR = "/usr/share/lnst/" CTL_LOGS_DIR = "~/.lnst/logs/"
@@ -62,26 +63,22 @@ SLAVE_CACHE_DIR = "/var/cache/lnst"
# Process templated files TEMPLATES_VALUES = { -"conf_dir": CONF_DIR, -"man_dir": MAN_DIR, + "conf_dir": CONF_DIR, + "man_dir": MAN_DIR,
-"ctl_modules_locations": CTL_MODULES_LOCATIONS, -"ctl_tools_locations": CTL_TOOLS_LOCATIONS, -"ctl_resource_dir": CTL_RESOURCE_DIR, -"ctl_logs_dir": CTL_LOGS_DIR, + "ctl_resource_dir": CTL_RESOURCE_DIR, + "ctl_logs_dir": CTL_LOGS_DIR,
-"slave_logs_dir": SLAVE_LOGS_DIR, -"slave_cache_dir": SLAVE_CACHE_DIR, + "slave_logs_dir": SLAVE_LOGS_DIR, + "slave_cache_dir": SLAVE_CACHE_DIR,
-"date": strftime("%Y-%m-%d", gmtime()) + "date": strftime("%Y-%m-%d", gmtime()) }
TEMPLATES = [ -"install/lnst-ctl.conf.in", -"install/lnst-slave.conf.in", -"install/lnst-ctl.1.in", -"install/lnst-slave.1.in", -"install/lnst-pool-wizard.1.in" + "install/lnst-ctl.conf.in", + "install/lnst-slave.conf.in", + "install/lnst-slave.1.in", ]
for template in TEMPLATES: @@ -89,12 +86,9 @@ for template in TEMPLATES: # ---
# Pack man pages -gzip_file("install/lnst-ctl.1") gzip_file("install/lnst-slave.1") -gzip_file("install/lnst-pool-wizard.1") # ---
- LONG_DESC = """LNST
Linux Network Stack Test is a tool that supports development and execution @@ -104,92 +98,37 @@ For detailed description of the architecture of LNST please refer to project website https://fedorahosted.org/lnst. """
-SCRIPTS = ["lnst-ctl", "lnst-slave", "lnst-pool-wizard"] - -RECIPE_FILES = [] -for dirpath, dirnames, files in os.walk("recipes/"): - if len(files) > 0: - RECIPE_FILES.append((CTL_RESOURCE_DIR + dirpath + "/", - [dirpath + "/" + f for f in files])) - -TEST_MODULES = [ - (CTL_MODULES_LOCATIONS, - ["test_modules/DummyFailing.py", - "test_modules/Icmp6Ping.py", - "test_modules/IcmpPing.py", - "test_modules/Iperf.py", - "test_modules/Multicast.py", - "test_modules/NetCat.py", - "test_modules/Netperf.py", - "test_modules/PacketAssert.py", - "test_modules/PktCounter.py", - "test_modules/PktgenTx.py", - "test_modules/LinkNeg.py", - "test_modules/Custom.py"] - ) -] - -MULTICAST_TEST_TOOLS = [ - (CTL_TOOLS_LOCATIONS + "multicast", - ["test_tools/multicast/igmp_utils.h", - "test_tools/multicast/lnst-setup.sh", - "test_tools/multicast/Makefile", - "test_tools/multicast/multicast_utils.h", - "test_tools/multicast/parameters_igmp.h", - "test_tools/multicast/parameters_multicast.h", - "test_tools/multicast/README", - "test_tools/multicast/sockopt_utils.h"]), - (CTL_TOOLS_LOCATIONS + "multicast/client", - ["test_tools/multicast/client/send_igmp_query.c", - "test_tools/multicast/client/send_simple.c"]), - (CTL_TOOLS_LOCATIONS + "multicast/offline", - ["test_tools/multicast/offline/max_groups.c", - "test_tools/multicast/offline/sockopt_block_source.c", - "test_tools/multicast/offline/sockopt_if.c", - "test_tools/multicast/offline/sockopt_loop.c", - "test_tools/multicast/offline/sockopt_membership.c", - "test_tools/multicast/offline/sockopt_source_membership.c", - "test_tools/multicast/offline/sockopt_ttl.c"]), - (CTL_TOOLS_LOCATIONS + "multicast/server", - ["test_tools/multicast/server/recv_block_source.c", - "test_tools/multicast/server/recv_membership.c", - "test_tools/multicast/server/recv_simple.c", - "test_tools/multicast/server/recv_source_membership.c"]), - (CTL_TOOLS_LOCATIONS + "tcp_conn", - ["test_tools/tcp_conn/lnst-setup.sh", - "test_tools/tcp_conn/Makefile", - "test_tools/tcp_conn/tcp_connect.c", - "test_tools/tcp_conn/tcp_listen.c"]) -] +SCRIPTS = ["lnst-slave"]
-MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz", "install/lnst-slave.1.gz", - "install/lnst-pool-wizard.1.gz"])] +MAN_PAGES = [(MAN_DIR, ["install/lnst-slave.1.gz"])]
CONFIG = [(CONF_DIR, ["install/lnst-ctl.conf", "install/lnst-slave.conf"])]
-BASH_COMP = [(BASH_COMP_DIR, ["install/lnst-ctl.bash", - "install/lnst-slave.bash", - "install/lnst-pool-wizard.bash"])] - -SCHEMAS = [(CTL_RESOURCE_DIR, ["schema-recipe.rng", "schema-sm.rng"])] +BASH_COMP = [(BASH_COMP_DIR, ["install/lnst-slave.bash"])]
-RESULT_XSLT_DATA = [(CTL_RESOURCE_DIR + "result_xslt/", - ["result_xslt/" + f for f in os.listdir("result_xslt")])] +SCHEMAS = [(CTL_RESOURCE_DIR, ["schema-sm.rng"])]
-DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + \ - SCHEMAS + BASH_COMP + RECIPE_FILES + RESULT_XSLT_DATA +DATA_FILES = CONFIG + MAN_PAGES + SCHEMAS + BASH_COMP
setup(name="lnst", - version=lnst_version.version, - description="Linux Network Stack Test", - author="LNST Team", - author_email="lnst-developers@lists.fedorahosted.org", - maintainer="Jiri Pirko", - maintainer_email="jiri@resnulli.us", - url="http://lnst-project.org", - long_description=LONG_DESC, - platforms=["linux"], - license=["GNU GPLv2"], - packages=find_packages(), - scripts=SCRIPTS, - data_files=DATA_FILES) + version=lnst_version.version, + description="Linux Network Stack Test", + author="LNST Team", + author_email="lnst-developers@lists.fedorahosted.org", + maintainer="Ondrej Lichtner", + maintainer_email="olichtne@redhat.com", + url="http://lnst-project.org", + long_description=LONG_DESC, + platforms=["linux"], + license=["GNU GPLv2"], + packages=find_packages(), + install_requires=['pyyaml', + 'lxml', + 'requests', + 'urllib3', + 'pyroute2', + 'pyOpenSSL', + 'coreapi', + 'libvirt-python'], + scripts=SCRIPTS, + data_files=DATA_FILES)