[lnst] Created tag v5
by Jiří Pírko
The lightweight tag 'v5' was created pointing to:
f7eb2c0... 5 release
9 years, 2 months
[lnst] 5 release
by Jiří Pírko
commit f7eb2c08ec516410b04bdb3d5568389a5fecf6e7
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Mon Jul 28 14:50:55 2014 +0200
5 release
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 2835844..4fbcf57 100755
--- a/setup.py
+++ b/setup.py
@@ -163,7 +163,7 @@ DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + \
SCHEMAS + BASH_COMP
setup(name="lnst",
- version="4",
+ version="5",
description="Linux Network Stack Test",
author="LNST Team",
author_email="lnst-developers(a)lists.fedorahosted.org",
9 years, 2 months
[lnst] NetTestController: store pcap based on machine id
by Jiří Pírko
commit 9845adee0fe19a25d031394413380aed744c6dc2
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Tue Jul 22 09:13:30 2014 +0200
NetTestController: store pcap based on machine id
Gathered pcap files were previously stored in directories named after
machine hostnames with logs. Since then we moved the log files to
directories named after machine ids used in the recipe. This patch moves
the pcap files to the same location.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestController.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 58a17b4..890bba7 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -721,9 +721,7 @@ class NetTestController:
logging_root = os.path.abspath(logging_root)
logging.info("Retrieving capture files from slaves")
for machine_id, machine in self._machines.iteritems():
- hostname = machine.get_hostname()
-
- slave_logging_dir = os.path.join(logging_root, hostname + "/")
+ slave_logging_dir = os.path.join(logging_root, machine_id + "/")
try:
os.mkdir(slave_logging_dir)
except OSError as err:
9 years, 2 months
[lnst] NetTestController: fix url handling for python tasks
by Jiří Pírko
commit 47ba471be146235d8c47c3b2f5246880e1667cb2
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Jul 21 16:45:49 2014 +0200
NetTestController: fix url handling for python tasks
The python task pathname was not handled properly if recipe was
specified as url, e.g.
lnst-ctl -d run http://example.net/recipe.xml
The fix is to use abstract class RecipePath for python task pathnames in the
recipe.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestController.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 3c33d68..58a17b4 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -312,10 +312,10 @@ class NetTestController:
if "python" in task_data:
root = RecipePath(None, self._recipe_path).get_root()
- path = "%s/%s" % (root, task_data["python"])
+ path = RecipePath(root, task_data["python"])
task["python"] = path
- if not os.path.isfile(path):
+ if not path.exists():
msg = "Task file '%s' not found." % path
raise RecipeError(msg, task_data)
@@ -635,8 +635,9 @@ class NetTestController:
# Initialize the API handle
Task.ctl = Task.ControllerAPI(self, self._machines)
- name = os.path.basename(task["python"]).split(".")[0]
- module = imp.load_source(name, task["python"])
+ task_path = task["python"]
+ name = os.path.basename(task_path.abs_path()).split(".")[0]
+ module = imp.load_source(name, task_path.resolve())
#restore resource table
self._resource_table = res_table_bkp
9 years, 2 months
[lnst] RecipePath: Add exists and resolve methods
by Jiří Pírko
commit 16eaa1bef30c919b4460839d5bf945169665357e
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Jul 21 16:38:38 2014 +0200
RecipePath: Add exists and resolve methods
These two new methods, exists() and resolve() are needed for proper handling
of python tasks if a recipe is specified as URL.
The exists() method returns True if a file or URL exists, False
otherwise.
The resolve() method returns the filename containing the data. In case
of ordinary file nothing special needs to be done. In case of URL, the
file is downloaded and saved in temporary file.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/RecipePath.py | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Common/RecipePath.py b/lnst/Common/RecipePath.py
index 84c6acc..b976238 100644
--- a/lnst/Common/RecipePath.py
+++ b/lnst/Common/RecipePath.py
@@ -13,6 +13,7 @@ jtluka(a)redhat.com (Jan Tluka)
import os
from urlparse import urljoin
from urllib2 import urlopen
+from tempfile import NamedTemporaryFile
def get_recipepath_class(root, path):
if root == None:
@@ -44,6 +45,12 @@ class RecipePath:
def to_str(self):
return self._recipepath_class.to_str()
+ def exists(self):
+ return self._recipepath_class.exists()
+
+ def resolve(self):
+ return self._recipepath_class.resolve()
+
class RecipePathGeneric:
def __init__(self, root, path):
self._root = root
@@ -59,6 +66,12 @@ class RecipePathGeneric:
def to_str(self):
pass
+ def exists(self):
+ pass
+
+ def resolve(self):
+ pass
+
class FileRecipePath(RecipePathGeneric):
def _load_file(self):
f = open(self.abs_path(),'r')
@@ -85,7 +98,14 @@ class FileRecipePath(RecipePathGeneric):
def get_root(self):
return os.path.dirname(self.abs_path())
+ def exists(self):
+ return os.path.isfile(self.abs_path())
+
+ def resolve(self):
+ return self.abs_path()
+
class HttpRecipePath(RecipePathGeneric):
+ _file = None
def _get_url(self):
url = self.abs_path()
@@ -113,3 +133,23 @@ class HttpRecipePath(RecipePathGeneric):
def get_root(self):
url = self.abs_path()
return url.rpartition('/')[0]
+
+ def exists(self):
+ url = self.abs_path()
+ try:
+ f = urlopen(url)
+ except HTTPError:
+ return False
+
+ f.close()
+ return True
+
+ def resolve(self):
+ if self._file:
+ return self._file.name
+
+ self._file = NamedTemporaryFile(suffix='.py',delete=True)
+ self._file.write(self.to_str())
+ self._file.flush()
+
+ return self._file.name
9 years, 2 months
[lnst] PacketAssert: do not process EOF line
by Jiří Pírko
commit be66c1600cfbd92818d37490636b2bde6550d095
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri Jul 18 09:31:21 2014 +0200
PacketAssert: do not process EOF line
When the tcpdump capture is empty and there are no grep_filters available
the processing of dump file will incorrectly report one captured packet.
The fix is to remove empty line that is returned by readline() on EOF
from the processing.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
test_modules/PacketAssert.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/test_modules/PacketAssert.py b/test_modules/PacketAssert.py
index 404f371..b0a7101 100644
--- a/test_modules/PacketAssert.py
+++ b/test_modules/PacketAssert.py
@@ -125,7 +125,8 @@ class PacketAssert(TestGeneric):
break
line = line.strip("\n")
- self._process_captured_line(line)
+ if len(line) != 0:
+ self._process_captured_line(line)
tcpdump_file.close()
os.remove(tcpdump_file.name)
9 years, 2 months
[lnst] SlavePool: allow matching of isolated machines
by Jiří Pírko
commit bcb9f2bb88cbb5a1e2060cc1b6bedc56ec7f8ceb
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu Jul 17 15:11:42 2014 +0200
SlavePool: allow matching of isolated machines
This patch makes it possible to match hosts that have connections not
connected to the rest of the hosts. This also allows for single machine
recipes and isolated (in the context of the recipe) machines.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/SlavePool.py | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 0049519..baca1e7 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -400,9 +400,10 @@ class SetupMapper:
topology[m_id].append(nc)
if not net_in_use:
- msg = "Network labeled '%s' contains only one machine!" %\
- net_name
- raise MapperError(msg)
+ for dev_in_net in devs_in_net:
+ nc = (None, net_name, dev_in_net)
+ if not nc in topology[m_id]:
+ topology[m_id].append(nc)
return topology
@@ -430,6 +431,11 @@ class SetupMapper:
:rtype: Bool
"""
+ if template_id == None and pool_id == None:
+ return True
+ if template_id == None or pool_id == None:
+ return False
+
template_machine = self._template_machines[template_id]
pool_machine = self._pool_machines[pool_id]
@@ -507,7 +513,7 @@ class SetupMapper:
@staticmethod
def _get_node_with_most_neighbours(topology):
max_machine = None
- max_len = 0
+ max_len = -1
for machine, nc_list in topology.iteritems():
if len(nc_list) > max_len:
max_machine = machine
@@ -604,7 +610,8 @@ class SetupMapper:
return (i, m, n)
def _save_nc_match(self, nc_match):
- self._machine_map |= set(nc_match[1])
+ if nc_match[1] != [(None, None)]:
+ self._machine_map |= set(nc_match[1])
self._network_map |= set(nc_match[2])
def _revert_nc_match(self, nc_match):
@@ -657,11 +664,6 @@ class SetupMapper:
template_topology = self._get_topology(template_machines)
pool_topology = self._get_topology(pool_machines)
- for m, cons in template_topology.iteritems():
- if len(cons) == 0:
- msg = "Isolated machine in template topology: '%s'" % m
- raise MapperError(msg)
-
if self._map_setup(template_topology, pool_topology):
machine_map = [(tm, pm, self._iface_map[tm]) \
for tm, pm in self._machine_map]
9 years, 2 months
[lnst] SlavePool: ignore non-xml files in pools
by Jiří Pírko
commit 44c1b5b967a6006bdc86bc20267eb947856292d9
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu Jul 17 15:11:41 2014 +0200
SlavePool: ignore non-xml files in pools
The controller would crash if there was a non-xml file in a pool
directory, for example hidden .swp files created by vim. This patch
fixes that by ignoring all non-xml files.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/SlavePool.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 00ee4b8..0049519 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -52,7 +52,9 @@ class SlavePool:
res = []
for dirent in dentries:
- res.append(self.add_file("%s/%s" % (pool_dir, dirent)))
+ m_info = self.add_file("%s/%s" % (pool_dir, dirent))
+ if m_info != None:
+ res.append(m_info)
if len(res) == 0:
logging.warn("No machines found in this directory")
9 years, 2 months
[PATCH] patch for the lnst rpm repository for fedora
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The following patch fixes an issue in the rpm spec file that is present in the
lnst rpm repository for fedora. I didn't know how else to post it so hopefully
this is ok.
Ondrej Lichtner (1):
lnst.spec: fix selinux label of lnst-slave
lnst.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--
1.9.3
9 years, 2 months
[PATCH] NetTestController: store pcap based on machine id
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
Gathered pcap files were previously stored in directories named after
machine hostnames with logs. Since then we moved the log files to
directories named after machine ids used in the recipe. This patch moves
the pcap files to the same location.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/NetTestController.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 3c33d68..85bd3af 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -720,9 +720,7 @@ class NetTestController:
logging_root = os.path.abspath(logging_root)
logging.info("Retrieving capture files from slaves")
for machine_id, machine in self._machines.iteritems():
- hostname = machine.get_hostname()
-
- slave_logging_dir = os.path.join(logging_root, hostname + "/")
+ slave_logging_dir = os.path.join(logging_root, machine_id + "/")
try:
os.mkdir(slave_logging_dir)
except OSError as err:
--
1.9.3
9 years, 2 months