[lnst] setup.py: Fixing manpages bug
by Jiří Pírko
commit 269de0ac27880df06d25fb59b3450e92be50437d
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 17 12:20:41 2013 +0200
setup.py: Fixing manpages bug
As it turns out, the setup script has been packaging the man pages
incorrectly (they were not gziped) the whole time.
This patch fixes that issue.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index babfbcf..9fc6ebe 100755
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ def process_template(template_path, values):
f.write(template)
def gzip_file(path):
- with open(path, "rb") as src, open(path + ".gz", "wb") as dst:
+ with open(path, "rb") as src, gzip.open(path + ".gz", "wb") as dst:
dst.writelines(src)
# Various paths
10 years, 9 months
[PATCH] install: Update the manpages
by Radek Pazdera
We added a few new command-line options to both lnst-ctl and lnst-slave.
This patch adds them to the manpages as well.
---
install/lnst-ctl.1.in | 10 ++++++++--
install/lnst-slave.1.in | 5 ++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/install/lnst-ctl.1.in b/install/lnst-ctl.1.in
index 34afdbf..fb5add9 100644
--- a/install/lnst-ctl.1.in
+++ b/install/lnst-ctl.1.in
@@ -35,7 +35,13 @@ Toggle emitting debugging messages.
.B \-h, \-\-help
Display usage of this command.
.TP
-.B \-p, \-\-packet_capture
+.B \-m, \-\-no\-colours
+Disable coloured terminal output.
+.TP
+.B \-o, \-\-disable\-pool\-checks
+Skip the pool machine availability checks.
+.TP
+.B \-p, \-\-packet\-capture
Capture and log all ongoing network communication between the slaves
during the test.
.TP
@@ -110,7 +116,7 @@ Mailing List: <lnst-developers(a)lists.fedorahosted.org>
.br
\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
.SH COPYRIGHT
-Copyright (C) 2012 Red Hat, Inc.
+Copyright (C) 2011\-2013 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 &
diff --git a/install/lnst-slave.1.in b/install/lnst-slave.1.in
index ceec0b7..276f6a3 100644
--- a/install/lnst-slave.1.in
+++ b/install/lnst-slave.1.in
@@ -39,6 +39,9 @@ Display usage of this command.
.BI "\-i, \-\-pidfile" =file
File to write damonized process' PID to.
.TP
+.B \-m, \-\-no\-colours
+Disable coloured terminal output.
+.TP
.BI "\-p, \-\-port" =port_number
The port number
.B lnst-slave
@@ -92,7 +95,7 @@ Mailing List: <lnst-developers(a)lists.fedorahosted.org>
.br
\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
.SH COPYRIGHT
-Copyright (C) 2012 Red Hat, Inc.
+Copyright (C) 2011\-2013 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 &
--
1.7.7.6
10 years, 9 months
[lnst] install: Update the manpages
by Jiří Pírko
commit 0a6b2e83f7dbf9b87e75aeb8b4b15bbdcaf570a4
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 17 10:28:07 2013 +0200
install: Update the manpages
We added a few new command-line options to both lnst-ctl and lnst-slave.
This patch adds them to the manpages as well.
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
install/lnst-ctl.1.in | 10 ++++++++--
install/lnst-slave.1.in | 5 ++++-
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/install/lnst-ctl.1.in b/install/lnst-ctl.1.in
index 34afdbf..fb5add9 100644
--- a/install/lnst-ctl.1.in
+++ b/install/lnst-ctl.1.in
@@ -35,7 +35,13 @@ Toggle emitting debugging messages.
.B \-h, \-\-help
Display usage of this command.
.TP
-.B \-p, \-\-packet_capture
+.B \-m, \-\-no\-colours
+Disable coloured terminal output.
+.TP
+.B \-o, \-\-disable\-pool\-checks
+Skip the pool machine availability checks.
+.TP
+.B \-p, \-\-packet\-capture
Capture and log all ongoing network communication between the slaves
during the test.
.TP
@@ -110,7 +116,7 @@ Mailing List: <lnst-developers(a)lists.fedorahosted.org>
.br
\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
.SH COPYRIGHT
-Copyright (C) 2012 Red Hat, Inc.
+Copyright (C) 2011\-2013 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 &
diff --git a/install/lnst-slave.1.in b/install/lnst-slave.1.in
index ceec0b7..276f6a3 100644
--- a/install/lnst-slave.1.in
+++ b/install/lnst-slave.1.in
@@ -39,6 +39,9 @@ Display usage of this command.
.BI "\-i, \-\-pidfile" =file
File to write damonized process' PID to.
.TP
+.B \-m, \-\-no\-colours
+Disable coloured terminal output.
+.TP
.BI "\-p, \-\-port" =port_number
The port number
.B lnst-slave
@@ -92,7 +95,7 @@ Mailing List: <lnst-developers(a)lists.fedorahosted.org>
.br
\fBOndrej Lichtner\fR <olichtne(a)redhat.com>
.SH COPYRIGHT
-Copyright (C) 2012 Red Hat, Inc.
+Copyright (C) 2011\-2013 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 &
10 years, 9 months
[PATCH] install: use_nm turned off by default
by Radek Pazdera
This patch adds the use_nm option to the configuration template that is
used to generate the configurations to be installed.
The use_nm is turned on by default, however, it is still an
experimental feature, so we would like to turn it of when installing
lnst to users.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
install/lnst-slave.conf.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/install/lnst-slave.conf.in b/install/lnst-slave.conf.in
index 8c9ab86..739cd6a 100644
--- a/install/lnst-slave.conf.in
+++ b/install/lnst-slave.conf.in
@@ -25,3 +25,10 @@ expiration_period = 7days
#in this option.
#The option accepts one directory path that will be created if it doesn't exist.
log_dir = @slave_logs_dir@
+
+#This option can be used to enable/disable the support of network
+#configuration using NetworkManager on slaves.
+#
+#The feature is highly experimental at the moment, so it is turned off
+#by default.
+use_nm = false
--
1.7.7.6
10 years, 9 months
[PATCH] setup.py: Updating the install script
by Radek Pazdera
This is a tiny update of the install script. The TCP test module has
been transformed into a tool, so some files had to be removed and
added to the install script.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
setup.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/setup.py b/setup.py
index a401ccc..babfbcf 100755
--- a/setup.py
+++ b/setup.py
@@ -104,9 +104,7 @@ TEST_MODULES = [
"test_modules/TestNetCat.py",
"test_modules/TestPacketAssert.py",
"test_modules/TestPktCounter.py",
- "test_modules/TestPktgenTx.py",
- "test_modules/TestTCPConnect.py",
- "test_modules/TestTCPListen.py"]
+ "test_modules/TestPktgenTx.py"]
)
]
@@ -135,7 +133,12 @@ MULTICAST_TEST_TOOLS = [
["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"])
+ "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"])
]
MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz", "install/lnst-slave.1.gz"])]
--
1.7.7.6
10 years, 9 months
[lnst] install: use_nm turned off by default
by Jiří Pírko
commit 35c60f6783820bd678ae22ee2662ace4a34f665c
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Jul 16 11:37:27 2013 +0200
install: use_nm turned off by default
This patch adds the use_nm option to the configuration template that is
used to generate the configurations to be installed.
The use_nm is turned on by default, however, it is still an
experimental feature, so we would like to turn it of when installing
lnst to users.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
install/lnst-slave.conf.in | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/install/lnst-slave.conf.in b/install/lnst-slave.conf.in
index 8c9ab86..739cd6a 100644
--- a/install/lnst-slave.conf.in
+++ b/install/lnst-slave.conf.in
@@ -25,3 +25,10 @@ expiration_period = 7days
#in this option.
#The option accepts one directory path that will be created if it doesn't exist.
log_dir = @slave_logs_dir@
+
+#This option can be used to enable/disable the support of network
+#configuration using NetworkManager on slaves.
+#
+#The feature is highly experimental at the moment, so it is turned off
+#by default.
+use_nm = false
10 years, 9 months
[lnst] setup.py: Updating the install script
by Jiří Pírko
commit 993ee1b74d2f29bcfbd3129784efbbf2e95313bb
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Jul 16 11:25:11 2013 +0200
setup.py: Updating the install script
This is a tiny update of the install script. The TCP test module has
been transformed into a tool, so some files had to be removed and
added to the install script.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
setup.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/setup.py b/setup.py
index a401ccc..babfbcf 100755
--- a/setup.py
+++ b/setup.py
@@ -104,9 +104,7 @@ TEST_MODULES = [
"test_modules/TestNetCat.py",
"test_modules/TestPacketAssert.py",
"test_modules/TestPktCounter.py",
- "test_modules/TestPktgenTx.py",
- "test_modules/TestTCPConnect.py",
- "test_modules/TestTCPListen.py"]
+ "test_modules/TestPktgenTx.py"]
)
]
@@ -135,7 +133,12 @@ MULTICAST_TEST_TOOLS = [
["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"])
+ "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"])
]
MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz", "install/lnst-slave.1.gz"])]
10 years, 9 months
[RFC] Command Sequences
by Radek Pazdera
Hello everyone,
I've been working on the parser recently (which I'm trying to refactor)
and I found a few things that might be worthy to at least think about.
What I am trying to do is to separate the process into two phases. First
one being the parsing along with structural checks (whether the tags are
properly nested and they have all the required attributes) and the
second one the processing with semantic checks (whether the id's match,
and there are no conflicts between different things, type checks, etc.).
The goal of this approach is to reduce the complexity of the code (which
is unfortunately quite high at the moment -- and we are still far away
from having all the semantic checks covered, so the user gets a
reasonable error message when his recipe is wrong).
The problem with the current command sequence structure is that it's
structure depends on the semantic, while it should be the other way
around. We have several types of commands and different commands expect
different attributes to be specified. And in order to be able to
validate the proper structure of the document, we would have to do a
part of the semantic analysis first. We had a similar problem with
interface types in <netconfig> already few months back.
For example:
<command_sequence>
<command type="exec" machine_id="3"
from="multicast" value="./send_igmp_query"/>
<command type="system_config" machine_id="2"
option="/proc/sys/net/ipv4/igmp_max_memberships"
value="5"/>
<command type="test" machine_id="1" timeout="30" value="IcmpPing">
<options>...</options>
</command>
</command_sequence>
Some commands can have children, some cannot and some of the attributes
are common, while there are many that are supported only by a few
commands. We use a very general attribute called "value" that has
different meaning for different command types which might be confusing.
This makes the parsing logic quite complicated and when we split the
parsing into two phases, we will have to put a hack here to evaluate
the "type" ahead of the semantic analysis so we can check the structure,
or alternatively delay checking the structure for the semantic analysis,
which would again bring everything into one place :-(.
What I would like to propose is a similar change we did earlier with the
interfaces -- move the type to the name of the tag, e.g.,
<command_sequence>
<exec machine_id="3" from="multicast" command="./send_igmp_query"/>
<system_config machine_id="2"
option="/proc/sys/net/ipv4/igmp_max_memberships"
value="5"/>
<test name="IcmpPing" machine_id="1" timeout="30">
<options>...</options>
</test>
</command_sequence>
This would also allow us to have "more personalised" attributes for each
command type (use name or command instead of value for tests and execs
etc.). It would make the parser much cleaner and easier to maintain.
However, we'd have to break the XML once more ...
What do you think?
Cheers,
Radek
10 years, 9 months
[RFC] Test Fixtures
by Radek Pazdera
Hello again :-),
This RFC is also related to the command sequences. They are great,
because if you know what you're doing you can do whatever you want with
them. However, when the tests get more complex and spread across
multiple sequences, they might be quite hard to follow.
What I think would increase the readability of the tests in some cases
are test fixtures. We could support them as an alternative to more
general command sequences and work with them internally as with command
sequences as their behaviour can be simulated with a series of multiple
command sequences like this:
<!-- SETUP -->
<command_sequence quit_on_fail="yes">
<command type="system_config" ...>
<command type="exec" ...>
<command type="exec" ...>
</command_sequence>
<!-- TEST CASES -->
<command_sequence quit_on_fail="no">
<command type="test" ...>
<command type="test" ...>
<command type="test" ...>
</command_sequence>
<command_sequence quit_on_fail="no">
<command type="test" ...>
</command_sequence>
<!-- TEARDOWN -->
<command_sequence quit_on_fail="yes">
<command type="system_config" ...>
<command type="intr" ...>
<command type="kill" ...>
<command type="exec" ...>
</command_sequence>
My proposal is to add an syntactic alternative to this as follows:
<!-- Not sure about the name, maybe only 'test' would be better? -->
<test_unit desc="TCP Tests">
<!-- The setup section is optional and the quit_on_fail
option is set by default. -->
<setup>
<command type="system_config" ...>
<command type="exec" ...>
<command type="exec" ...>
</setup>
<!-- There must be at least one. The name could be 'case' only.
If a command within the testcase fails, the case is
terminated, but LNST would carry on with the following
test case. -->
<test_case desc="Handshake">
<command type="test" ...>
<command type="test" ...>
</test_case>
<test_case desc="Load balance">
<command type="test" ...>
</test_case>
<test_case desc="Checksums">
<command type="test" ...>
</test_case>
<!-- This section is again optional -->
<teardown>
<command type="system_config" ...>
<command type="intr" ...>
<command type="kill" ...>
<command type="exec" ...>
</teardown>
</test_unit>
We could also provide some documentation for the test cases and units
directly with the tags and use them to print a nice coloured summary
after the test :-). Internally, a fixture could be handled as multiple
command sequences, so we wouldn't need to change that much (hopefully).
Cheers,
Radek
10 years, 9 months
[RFC] Autonomous Cleanup on Slaves
by Radek Pazdera
Dear All,
This should be the last RFC for today :-). We discussed some problems
related to cleanup at the slaves recently. The problem is, that slave
cleanup is directed from the controller. And if it terminates before
actually cleaning the slave, it stays hanging ther in an inconsistant
state.
To solve this, we use the -c option which will force the cleanup before
the execution of the recipes. However, this cleanup is done basically by
removing all the kernel modules for soft devices and loading them back
up. That means, we cannot use the modules for anything else than testing
(for instance the controller interface cannot be a bond). This is not
the biggest problem though; the number of configuration options and
tasks grows and we have to be able to roll them back as well (namely
system config, network manager connections, active instances of teamd
and more).
In my opinion, we should think about having some sort of "configuration
journal" to keep track of the configuration actions that has been done,
so we are able to roll them back automatically upon receiving a new
HELLO from the controller. We discussed this with Ondrej who had a similar
idea.
It could work like this:
1. HELLO from the controller for run #1
2. Controller configures the slave
3. Controller starts the test
4. Someting goes wrong, the controller fails.
5. HELLO from the controller for run #2
6. The slave detects that it has not been cleaned up properly
7. Slave does a rollback
8. Controller configures the slave
9. Controller starts the test
10. Controller sends BYE
11. Slave does a rollback
Additionally, we could add a new action to lnst-ctl called "reset" that
would just send HELLO and BYE to a slave to clean them up. But even this
would be a bit redundant in case the slaves are able to clean up
themselves.
The "configuration journal" could be basically a list of objects per
interface to remember the way each interface was configured and would
have a deconfigure method. The rollback feature is already there for
system configs.
Cheers,
Radek
10 years, 9 months