[lnst] dist: Adding systemd service file
by Jiří Pírko
commit b576c83079e227739de0608222ed8b7f502a8fee
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:14:46 2012 +0100
dist: Adding systemd service file
This commit adds two different things.
New dist/ directory for distribution specific things, such as spec files
for different distributions, packaging patches, init scripts. Really
anything that can be useful for distributing LNST as a package within
an operating system.
Also it adds a service file for systemd prepared for distribution
in Fedora to this directory.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
dist/lnst-slave.service | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/dist/lnst-slave.service b/dist/lnst-slave.service
new file mode 100644
index 0000000..fd41892
--- /dev/null
+++ b/dist/lnst-slave.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Linux Network Stack Test - slave daemon
+Documentation=man:lnst-slave(1) http://fedorahosted.org/lnst
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/lnst-slave
+StandardOutput=null
+
+[Install]
+WantedBy=multi-user.target
11 years, 5 months
[lnst] setup.py: Adding an installation script
by Jiří Pírko
commit 389dc12ea4458c9499e1794fbe1b6036f18818f5
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:14:45 2012 +0100
setup.py: Adding an installation script
This commit contains an installation script for LNST. It is a standard
python installation tool using distutils.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
MANIFEST.in | 6 ++
setup.py | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 165 insertions(+), 0 deletions(-)
---
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..1b4f210
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,6 @@
+include COPYING
+recursive-include recipes *.xml
+
+include install/*.in
+exclude install/*.conf
+exclude install/*.gz
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..9954bbf
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+"""
+Install script for lnst
+
+This script will install both lnst controller and slave
+to your system. To install LNST, execute it as follows:
+
+ ./setup.py install
+
+To install lnst to a different root use:
+
+ .setup.py install --root=<path>
+
+"""
+
+__author__ = """
+rpazdera(a)redhat.com (Radek Pazdera)
+"""
+
+import sys
+import re
+import gzip
+from time import gmtime, strftime
+from distutils.core import setup
+
+def process_template(template_path, values):
+ template_name_re = "\.in$"
+ if not re.search(template_name_re, template_path):
+ raise Exception("Not a template!")
+
+ file_path = re.sub(template_name_re, "", template_path)
+ with open(template_path, "r") as t, open(file_path, "w") as f:
+ template = t.read()
+ for var, value in values.iteritems():
+ template = template.replace("@%s@" % var, value)
+ f.write(template)
+
+def gzip_file(path):
+ with open(path, "rb") as src, open(path + ".gz", "wb") as dst:
+ dst.writelines(src)
+
+# Various paths
+CONF_DIR = "/etc/"
+MAN_DIR = "/usr/share/man/man1/"
+
+CTL_MODULES_LOCATIONS = "/usr/share/lnst/test_modules/"
+CTL_TOOLS_LOCATIONS = "/usr/share/lnst/test_tools/"
+CTL_LOGS_DIR = "~/.lnst/logs/"
+
+SLAVE_LOGS_DIR = "/var/log/lnst"
+SLAVE_CACHE_DIR = "/var/cache/lnst"
+
+# Process templated files
+TEMPLATES_VALUES = {
+"conf_dir": CONF_DIR,
+"man_dir": MAN_DIR,
+
+"ctl_modules_locations": CTL_MODULES_LOCATIONS,
+"ctl_tools_locations": CTL_TOOLS_LOCATIONS,
+"ctl_logs_dir": CTL_LOGS_DIR,
+
+"slave_logs_dir": SLAVE_LOGS_DIR,
+"slave_cache_dir": SLAVE_CACHE_DIR,
+
+"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"
+]
+
+for template in TEMPLATES:
+ process_template(template, TEMPLATES_VALUES)
+# ---
+
+# Pack man pages
+gzip_file("install/lnst-ctl.1")
+gzip_file("install/lnst-slave.1")
+# ---
+
+
+LONG_DESC = """LNST
+
+Linux Network Stack Test is a tool that supports development and execution
+of automated and portable network tests.
+
+For detailed description of the architecture of LNST please refer to
+project website <https://fedorahosted.org/lnst>.
+"""
+
+PACKAGES = ["lnst", "lnst.Common", "lnst.Controller", "lnst.Slave"]
+SCRIPTS = ["lnst-ctl", "lnst-slave"]
+
+TEST_MODULES = [
+ (CTL_MODULES_LOCATIONS,
+ ["test_modules/TestDummyFailing.py",
+ "test_modules/TestIcmp6Ping.py",
+ "test_modules/TestIcmpPing.py",
+ "test_modules/TestIperf.py",
+ "test_modules/TestMulticast.py",
+ "test_modules/TestNetCat.py",
+ "test_modules/TestPacketAssert.py",
+ "test_modules/TestPktCounter.py",
+ "test_modules/TestPktgenTx.py",
+ "test_modules/TestTCPConnect.py",
+ "test_modules/TestTCPListen.py"]
+ )
+]
+
+MULTICAST_TEST_TOOLS = [
+ (CTL_TOOLS_LOCATIONS + "multicast",
+ ["test_tools/multicast/igmp_utils.h",
+ "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"])
+]
+
+MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz", "install/lnst-slave.1.gz"])]
+
+CONFIG = [("/etc/", ["install/lnst-ctl.conf", "install/lnst-slave.conf"])]
+
+DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES
+
+setup(name="lnst",
+ version="git",
+ description="Linux Network Stack Test",
+ author="LNST Team",
+ author_email="lnst-developers(a)lists.fedorahosted.org",
+ maintainer="Radek Pazdera",
+ maintainer_email="rpazdera(a)redhat.com",
+ url="https://fedorahosted.org/lnst/",
+ long_description=LONG_DESC,
+ platforms=["linux"],
+ license=["GNU GPLv2"],
+ packages=PACKAGES,
+ scripts=SCRIPTS,
+ data_files=DATA_FILES)
11 years, 5 months
[lnst] README: Adding README file
by Jiří Pírko
commit e058745df80d1b1adbe12fb14d12ba2e25172fff
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:14:44 2012 +0100
README: Adding README file
Either README or README.txt is required by distutils. It prints warnings
during the installation if there is no README available.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
README | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/README b/README
new file mode 100644
index 0000000..c4dd633
--- /dev/null
+++ b/README
@@ -0,0 +1,39 @@
+# LNST - Linux Network Stack Test #
+
+Linux Network Stack Test is a tool that supports development and execution of
+automated and portable network tests. For detailed description of the
+architecture of LNST please refer to project website (link listed on
+Internet Resources bellow).
+
+
+## Install
+
+LNST can be installed using python's distutils.
+
+ $ su
+ # ./setup.py install
+
+
+## Authors
+
+* Jiri Pirko <jpirko(a)redhat.com>
+* Jiri Zupka <jzupka(a)redhat.com>
+* Jan Tluka <jtluka(a)redhat.com>
+* Radek Pazdera <rpazdera(a)redhat.com>
+* Ondrej Lichtner <olichtne(a)redhat.com>
+
+
+## Internet Resources
+
+* Project Wiki: https://fedorahosted.org/lnst/
+* Documentation: https://fedorahosted.org/lnst/wiki/Documentation
+* Git Source Tree: http://git.fedorahosted.org/cgit/lnst.git/
+* Mailing List: lnst-developers(a)lists.fedorahosted.org
+
+## License
+
+Copyright (C) 2012 Red Hat, Inc.
+
+LNST is distributed under GNU General Public License version 2. See the file
+"COPYING" in the source distribution for information on terms & conditions
+for accessing and otherwise using LNST.
11 years, 5 months
[lnst] install configs: Changed names of some variables
by Jiří Pírko
commit 0d5158206702a6b42d3b21161bf66f68a0bbe9b3
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:14:43 2012 +0100
install configs: Changed names of some variables
I changed names of some variables to make them match the names
in the install script (setup.py).
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
install/lnst-ctl.conf.in | 6 +++---
install/lnst-slave.conf.in | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/install/lnst-ctl.conf.in b/install/lnst-ctl.conf.in
index a06d3ca..576a562 100644
--- a/install/lnst-ctl.conf.in
+++ b/install/lnst-ctl.conf.in
@@ -30,16 +30,16 @@ machine_pool_dirs =
#directories in this list. The option behaves the same way as the option
#machine_pool_dirs, it accepts a list of directory paths and both operators,
# += and = can be used
-test_tool_dirs = @test_tool_dirs@
+test_tool_dirs = @ctl_tools_locations@
#test_module_dirs specifies where the controller looks for custom test modules
#the test modules need to be named Test<name>.py otherwise they won't be
#recognized. The behaviour of the option is the same as test_tool_dirs, it
#accepts a list of directory paths and both operators, += and = can be used.
-test_module_dirs = @test_module_dirs@
+test_module_dirs = @ctl_modules_locations@
#log_dir option redirects the location of where logs are stored. Every run of
#the application creates its own timestamped subdirectory in the path specified
#in this option. The option accepts one directory path that will be created if
#it doesn't exist. You cannot use the operator += here.
-log_dir = @log_dir@
+log_dir = @ctl_logs_dir@
diff --git a/install/lnst-slave.conf.in b/install/lnst-slave.conf.in
index c4b379f..8c9ab86 100644
--- a/install/lnst-slave.conf.in
+++ b/install/lnst-slave.conf.in
@@ -9,7 +9,7 @@
#cache_dir option specifies where the slave shoud store the transfered files.
#The option accepts one directory path.
-cache_dir = @cache_dir@
+cache_dir = @slave_cache_dir@
#expiration_period specifies for how long we keep the files stored. If a file
#has not been used for longer than the specified duration it will be removed
@@ -24,4 +24,4 @@ expiration_period = 7days
#a test creates its own timestamped subdirectory in the path specified
#in this option.
#The option accepts one directory path that will be created if it doesn't exist.
-log_dir = @log_dir@
+log_dir = @slave_logs_dir@
11 years, 5 months
[lnst] man pages: Adding man templates
by Jiří Pírko
commit f3187971d3723e3eed7126937e5fe9b4956b6745
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:14:42 2012 +0100
man pages: Adding man templates
This patch adds man templates to the install/ directory. These templates
are processed by setup.py during the installation and turned into an
actuall man pages to be installed.
The man pages are for the following commands:
* lnst-ctl(1)
* lnst-slave(1)
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
install/lnst-ctl.1.in | 117 +++++++++++++++++++++++++++++++++++++++++++++++
install/lnst-slave.1.in | 99 +++++++++++++++++++++++++++++++++++++++
2 files changed, 216 insertions(+), 0 deletions(-)
---
diff --git a/install/lnst-ctl.1.in b/install/lnst-ctl.1.in
new file mode 100644
index 0000000..34afdbf
--- /dev/null
+++ b/install/lnst-ctl.1.in
@@ -0,0 +1,117 @@
+.TH LNST-CTL "1" "@date@"
+
+.\" To view this file while editing, run it through groff:
+.\" groff -Tascii -man lnst-ctl.1 | less -r
+
+.\" This file is a template that contains placeholders for
+.\" certain values. It needs to be processed before it can
+.\" be used as a man-page.
+
+.SH NAME
+lnst-ctl \- Linux Network Stack Test controller
+.SH SYNOPSIS
+.BR
+.B lnst-ctl
+[\fIOPTION\fR]... \fIRECIPE\fR... \fIACTION\fR
+.SH DESCRIPTION
+Linux Network Stack Test is a tool that supports development and execution
+of automated and portable network tests. For detailed description of the
+architecture of LNST please refer to project website
+(link listed on
+.B INTERNET RESOURCES
+bellow).
+
+.B lnst-ctl
+is a script used for managing slaves. It reads a recipe XML file as an
+input and executes tests on the specified slave machines.
+.SH OPTIONS
+.TP
+.B \-c, \-\-cleanup
+Cleanup all slave machines berfore executing the recipes.
+.TP
+.B \-d, \-\-debug
+Toggle emitting debugging messages.
+.TP
+.B \-h, \-\-help
+Display usage of this command.
+.TP
+.B \-p, \-\-packet_capture
+Capture and log all ongoing network communication between the slaves
+during the test.
+.TP
+.BI "\-x, \-\-result" =file
+Write results in XML format to the specified
+.IR file .
+.PP
+.I RECIPE
+can be either a LNST recipe file or a directory containing recipe files.
+One or more files/directories can be passed at the same time. Each recipe
+is a XML file. The format is described in detail in the online documentation
+available at LNST wiki (link is listed on
+.B INTERNET RESOURCES
+bellow).
+
+.I ACTION
+can be one from
+.BR "run",
+.BR "config_only" ", and"
+.BR "dump".
+
+When it is set to
+.BR "run",
+all provided recipe files will be sequentially executed. The network will
+be configured accordingly to each recipe file and clean up
+afterwards.
+
+In case of
+.BR "config_only",
+the recipes provided are processed up to the point where all the machines
+are prepared and properly configured. No tests will be executed and the
+cleanup phase is omitted as well. This mode of operation is useful if you
+want to perform some specific actions or tests outside of LNST using
+the configuration specified in a recipe file.
+
+At last, when the
+.I ACTION
+chosen is
+.BR "dump",
+the network will be configured as specified in the recipe.
+.B lnst-ctl
+will then dump contents of its internal data structures to the standard
+output. This feature can be used for debugging recipes or network setups.
+.SH CONFIGURATION
+.B lnst-ctl
+will look for configuration in the following locations:
+
+.I @conf_dir(a)lnst-ctl.conf
+.br
+.I ~/.lnst/lnst-ctl.conf
+
+For further description of file format or configuration options available,
+please refer to the configuration file itself, where each option is
+documented.
+
+.SH INTERNET RESOURCES
+Project Wiki: https://fedorahosted.org/lnst/
+.br
+Documentation: https://fedorahosted.org/lnst/wiki/Documentation
+.br
+Git Source Tree: http://git.fedorahosted.org/cgit/lnst.git/
+
+Mailing List: <lnst-developers(a)lists.fedorahosted.org>
+.SH AUTHORS
+\fBJiri Pirko\fR <jpirko(a)redhat.com>
+.br
+\fBJiri Zupka\fR <jzupka(a)redhat.com>
+.br
+\fBJan Tluka\fR <jtluka(a)redhat.com>
+.br
+\fBRadek Pazdera\fR <rpazdera(a)redhat.com>
+.br
+\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
+.SH COPYRIGHT
+Copyright (C) 2012 Red Hat, Inc.
+
+LNST is distributed under GNU General Public License version 2. See
+the file "COPYING" in the source distribution for information on terms &
+conditions for accessing and otherwise using LNST.
diff --git a/install/lnst-slave.1.in b/install/lnst-slave.1.in
new file mode 100644
index 0000000..ceec0b7
--- /dev/null
+++ b/install/lnst-slave.1.in
@@ -0,0 +1,99 @@
+.TH LNST-SLAVE "1" "@date@"
+
+.\" To view this file while editing, run it through groff:
+.\" groff -Tascii -man lnst-slave.1 | less -r
+
+.\" This file is a template that contains placeholders for
+.\" certain values. It needs to be processed before it can
+.\" be used as a man-page.
+
+.SH NAME
+lnst-slave \- Linux Network Stack Test slave daemon
+.SH SYNOPSIS
+.BR
+.B lnst-slave
+[\fB-d\fR] [\fB-e\fR] [\fB-h\fR] [\fB-i \fIpidfile\fR]
+[\fB-p \fIport_number\fR]
+.SH DESCRIPTION
+Linux Network Stack Test is a tool that supports development and execution
+of automated and portable network tests. For detailed description of the
+architecture of LNST please refer to project website
+(link listed on
+.B INTERNET RESOURCES
+bellow).
+
+.B lnst-slave
+is a daemon script that runs in the background and waits for incomming
+commands from a controller.
+.SH OPTIONS
+.TP
+.B \-d, \-\-debug
+Toggle emitting debugging messages.
+.TP
+.B \-e, \-\-daemonize
+Detach from parent process and run in background.
+.TP
+.B \-h, \-\-help
+Display usage of this command.
+.TP
+.BI "\-i, \-\-pidfile" =file
+File to write damonized process' PID to.
+.TP
+.BI "\-p, \-\-port" =port_number
+The port number
+.B lnst-slave
+should listen on for incomming commands.
+.SH CONFIGURATION
+.B lnst-slave
+will look for configuration in the following location:
+
+.I @conf_dir(a)lnst-slave.conf
+
+For further description of file format or configuration options available,
+please refer to the configuration file itself, where each option is
+documented.
+.SH FILES
+Apart from configuration, there are few important locations that
+.B lnst-slave
+works with. All bellow mentioned paths can be changed in the
+configuration file.
+.SS Log Path
+Every test exectution and all the commands run by
+.B lnst-slave
+during the test are logged to the following location:
+
+.I @slave_logs_dir@
+.SS Cache Location
+Test modules and tools used by the controllers with this slave are cached
+in resources cache. The cache is by default located at:
+
+.I @slave_cache_dir@
+
+The cache is fully under control of the
+.B lnst-slave
+daemon and is managed automatically. Making any modifications by hand is
+not recommended.
+.SH INTERNET RESOURCES
+Project Wiki: https://fedorahosted.org/lnst/
+.br
+Documentation: https://fedorahosted.org/lnst/wiki/Documentation
+.br
+Git Source Tree: http://git.fedorahosted.org/cgit/lnst.git/
+
+Mailing List: <lnst-developers(a)lists.fedorahosted.org>
+.SH AUTHORS
+\fBJiri Pirko\fR <jpirko(a)redhat.com>
+.br
+\fBJiri Zupka\fR <jzupka(a)redhat.com>
+.br
+\fBJan Tluka\fR <jtluka(a)redhat.com>
+.br
+\fBRadek Pazdera\fR <rpazdera(a)redhat.com>
+.br
+\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
+.SH COPYRIGHT
+Copyright (C) 2012 Red Hat, Inc.
+
+LNST is distributed under GNU General Public License version 2. See
+the file "COPYING" in the source distribution for information on terms &
+conditions for accessing and otherwise using LNST.
11 years, 5 months
[lnst] ResourceCache: Fixed Cache Dir Creation Bug
by Jiří Pírko
commit a0c0f46391fd63d5941598ad163b40096f7d4e00
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Nov 21 13:11:02 2012 +0100
ResourceCache: Fixed Cache Dir Creation Bug
When a name of non-existent directory was put into the configuration,
lnst-slave did correctly create it, but when larger part of the tree
was non-existent it crashed down with an exception.
This patch fixes that. lnst-slave will create all the parent directories
as necessary.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
lnst/Common/ResourceCache.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/ResourceCache.py b/lnst/Common/ResourceCache.py
index fff617c..7cf2f0e 100644
--- a/lnst/Common/ResourceCache.py
+++ b/lnst/Common/ResourceCache.py
@@ -33,7 +33,7 @@ class ResourceCache(object):
else:
raise ResourceCacheError("Invalid cache path (%s)" % cache_path)
else:
- os.mkdir(cache_path)
+ os.makedirs(cache_path)
self._root = cache_path
self._read_index()
11 years, 5 months
[PATCH] scripts usage: Formatting changes
by Radek Pazdera
Some small formatting changes were made to the scripts' help messages.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst-ctl | 21 ++++++++++-----------
lnst-slave | 12 ++++++------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/lnst-ctl b/lnst-ctl
index 00413fd..2ce304f 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -25,20 +25,19 @@ def usage():
"""
Print usage of this app
"""
- print "Usage:"
- print "nettestctl.py [OPTION...] [RECIPE...] ACTION"
+ print "Usage: %s [OPTION...] [RECIPE...] ACTION" % sys.argv[0]
print ""
print "ACTION = [run | dump | config_only]"
print ""
- print "options:"
- print " -d, --debug emit debugging messages"
- print " -p, --packet_capture capture and log all ongoing\n" \
- " network communication during\n" \
- " the test"
- print " -h, --help print this message"
- print " -c, --cleanup perform config cleanup\n" \
- " machines"
- print " -x, --result=FILE file to write xml_result"
+ print "OPTIONS"
+ print " -d, --debug emit debugging messages"
+ print " -p, --packet_capture capture and log all ongoing\n" \
+ " network communication during\n" \
+ " the test"
+ print " -h, --help print this message"
+ print " -c, --cleanup perform config cleanup\n" \
+ " machines"
+ print " -x, --result=FILE file to write xml_result"
sys.exit()
def process_recipe(action, file_path, cleanup, res_serializer,
diff --git a/lnst-slave b/lnst-slave
index 4244209..f0b959f 100755
--- a/lnst-slave
+++ b/lnst-slave
@@ -24,13 +24,13 @@ def usage():
"""
Print usage of this app
"""
- print "Usage: nettestslave.py [OPTION...]"
+ print "Usage: %s [OPTION...]" % sys.argv[0]
print ""
- print " -d, --debug emit debugging messages"
- print " -h, --help print this message"
- print " -e, --daemonize go to background after init"
- print " -i, --pidfile file to write daemonized process pid"
- print " -p, --port xmlrpc port"
+ print " -d, --debug emit debugging messages"
+ print " -h, --help print this message"
+ print " -e, --daemonize go to background after init"
+ print " -i, --pidfile file to write daemonized process pid"
+ print " -p, --port xmlrpc port to listen on"
sys.exit()
def main():
--
1.7.7.6
11 years, 5 months
[PATCH] NetTestParse: Making machine_id mandatory for commands
by Radek Pazdera
This patch fixes a bug with commands. Execution of commands on the
controller is no longer supported, so it is mandatory to pass a
valid machine_id to each command.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Controller/NetTestParse.py | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lnst/Controller/NetTestParse.py b/lnst/Controller/NetTestParse.py
index bb40ed6..40223f5 100644
--- a/lnst/Controller/NetTestParse.py
+++ b/lnst/Controller/NetTestParse.py
@@ -554,12 +554,9 @@ class CommandParse(RecipeParser):
recipe["sequences"][self._seq_num]["commands"].append(command)
self._cmd_num = len(recipe["sequences"][self._seq_num]["commands"]) - 1
- if self._has_attribute(node, "machine_id"):
- machine_id = self._get_attribute(node, "machine_id")
- if machine_id and not machine_id in recipe["machines"]:
- raise XmlProcessingError("Invalid machine_id", node)
- else:
- machine_id = "0" # controller id
+ machine_id = self._get_attribute(node, "machine_id")
+ if machine_id and not machine_id in recipe["machines"]:
+ raise XmlProcessingError("Invalid machine_id", node)
command["machine_id"] = machine_id
command["type"] = self._get_attribute(node, "type")
--
1.7.7.6
11 years, 5 months
[PATCH] ResourceCache: Fixed Cache Dir Creation Bug
by Radek Pazdera
When a name of non-existent directory was put into the configuration,
lnst-slave did correctly create it, but when larger part of the tree
was non-existent it crashed down with an exception.
This patch fixes that. lnst-slave will create all the parent directories
as necessary.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Common/ResourceCache.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lnst/Common/ResourceCache.py b/lnst/Common/ResourceCache.py
index fff617c..7cf2f0e 100644
--- a/lnst/Common/ResourceCache.py
+++ b/lnst/Common/ResourceCache.py
@@ -33,7 +33,7 @@ class ResourceCache(object):
else:
raise ResourceCacheError("Invalid cache path (%s)" % cache_path)
else:
- os.mkdir(cache_path)
+ os.makedirs(cache_path)
self._root = cache_path
self._read_index()
--
1.7.7.6
11 years, 5 months
[lnst] Config files: add a warning comment
by Jiří Pírko
commit 79573f3c06a634c672cf4c6c257fd3587fb4a54a
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Tue Nov 20 15:06:06 2012 +0100
Config files: add a warning comment
This commit adds a comment explaining the usage of the controller and
slave configuration files located in the git tree. The comment points
out that these configuration files override any other configuration
files so that the upstream version is isolated from the packaged one.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
lnst-ctl.conf | 5 +++++
lnst-slave.conf | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/lnst-ctl.conf b/lnst-ctl.conf
index 389434c..584d340 100644
--- a/lnst-ctl.conf
+++ b/lnst-ctl.conf
@@ -1,3 +1,8 @@
+#This is a configuration file for the lnst-ctl application. Values set in this
+#file are the defaults for the upstream version. If this file is found
+#in the same directory as the executable no other configuration files will be
+#loaded. This is so that the upstream version can be used isolated from the
+#packaged version.
[environment]
mac_pool_range = 52:54:01:00:00:01 52:54:01:FF:FF:FF
rpcport = 9999
diff --git a/lnst-slave.conf b/lnst-slave.conf
index 5689819..aa1073a 100644
--- a/lnst-slave.conf
+++ b/lnst-slave.conf
@@ -1,3 +1,8 @@
+#This is a configuration file for the lnst-slave application. Values set in
+#this file are the defaults for the upstream version. If this file is found
+#in the same directory as the executable no other configuration files will be
+#loaded. This is so that the upstream version can be used isolated from the
+#packaged version.
[cache]
cache_dir = ./cache
expiration_period = 7days
11 years, 5 months