[lnst] NetTestSlave: Adding caching support
by Jiří Pírko
commit 2ddb81643382fb9621b4ae3fbbd7786d524db4ee
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:48 2012 +0100
NetTestSlave: Adding caching support
This patch carries all the necessary modifications to NetTestSlave
that makes the slave support test caching.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestSlave.py | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/NetTest/NetTestSlave.py b/NetTest/NetTestSlave.py
index 988dc00..7f0b035 100644
--- a/NetTest/NetTestSlave.py
+++ b/NetTest/NetTestSlave.py
@@ -25,6 +25,7 @@ from NetTest.NetTestCommand import NetTestCommandContext, NetTestCommand, Comman
from Common.Utils import die_when_parent_die
from Common.NetUtils import scan_netdevs, test_tcp_connection
from Common.ExecCmd import exec_cmd
+from Common.ResourceCache import ResourceCache
DefaultRPCPort = 9999
@@ -40,6 +41,11 @@ class NetTestSlaveXMLRPC:
self._copy_target = None
+ self._cache = ResourceCache(config.get_option("cache", "dir"),
+ config.get_option("cache", "expiration_period"))
+
+ self._resource_table = {}
+
def hello(self):
return "hello"
@@ -121,7 +127,9 @@ class NetTestSlaveXMLRPC:
def run_command(self, command):
try:
- return NetTestCommand(self._command_context, command).run()
+ cmd_cls = NetTestCommand(self._command_context, command,
+ self._resource_table)
+ return cmd_cls.run()
except:
log_exc_traceback()
cmd_type = command["type"]
@@ -134,6 +142,8 @@ class NetTestSlaveXMLRPC:
NetConfigDeviceAllCleanup()
self._netconfig.cleanup()
self._command_context.cleanup()
+ self.reset_resource_table()
+ self._cache.del_old_entries()
return True
def start_copy(self, filename=None):
@@ -163,6 +173,32 @@ class NetTestSlaveXMLRPC:
return ""
+ def clear_resource_table(self):
+ self._resource_table = {}
+ return True
+
+ def has_resource(self, res_hash):
+ if self._cache.query(res_hash):
+ return True
+
+ return False
+
+ def map_resource(self, res_hash, res_type, res_name):
+ resource_location = self._cache.get_path(res_hash)
+
+ if not res_type in self._resource_table:
+ self._resource_table[res_type] = {}
+
+ self._resource_table[res_type][res_name] = resource_location
+ self._cache.renew_entry(res_hash)
+
+ return True
+
+ def add_resource_to_cache(self, file_hash, local_path, name,
+ res_hash, res_type):
+ self._cache.add_cache_entry(file_hash, local_path, name, res_type)
+ return True
+
class MySimpleXMLRPCServer(Server):
def __init__(self, command_context, *args, **kwargs):
self._finished = False
11 years, 5 months
[lnst] ResourceCache: Adding a cache for modules and tools
by Jiří Pírko
commit a77f43452f69d9cf9d5ce295be076eff3812084c
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:47 2012 +0100
ResourceCache: Adding a cache for modules and tools
This commit introduces resource cache for managing test
modules and tools that are transfered from controller to the
slaves.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Common/ResourceCache.py | 132 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 132 insertions(+), 0 deletions(-)
---
diff --git a/Common/ResourceCache.py b/Common/ResourceCache.py
new file mode 100644
index 0000000..9bc463f
--- /dev/null
+++ b/Common/ResourceCache.py
@@ -0,0 +1,132 @@
+"""
+
+Copyright 2012 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+rpazdera(a)redhat.com (Radek Pazdera)
+"""
+
+import logging
+import os
+import re
+import time
+import shutil
+from Common.Utils import md5sum
+from Common.ExecCmd import exec_cmd
+
+class ResourceCacheError(Exception):
+ pass
+
+class ResourceCache(object):
+ _CACHE_INDEX_FILE_NAME = "index"
+ _root = None
+ _entries = {}
+ _expiration_period = None
+
+ def __init__(self, cache_path, expiration_period):
+ if os.path.exists(cache_path):
+ if os.path.isdir(cache_path):
+ self._root = cache_path
+ else:
+ raise ResourceCacheError("Invalid cache path (%s)" % cache_path)
+ else:
+ os.mkdir(cache_path)
+ self._root = cache_path
+
+ self._read_index()
+ self._expiration_period = expiration_period
+
+ def _read_index(self):
+ logging.debug("Test cache index loaded")
+ try:
+ f = open(self._get_index_loc(), "r")
+ except:
+ return
+
+ for line in f.readlines():
+ if not re.match("^\s*#", line) and not re.match("^\s*$", line):
+ try:
+ entry_hash, last_used, entry_type, \
+ entry_name, entry_path = line.split()
+ except:
+ raise ResourceCacheError("Malformed cache index")
+
+ entry = {"type": entry_type, "name": entry_name,
+ "last_used": int(last_used), "path": entry_path }
+ self._entries[entry_hash] = entry
+
+ def _save_index(self):
+ logging.debug("Test cache index commited")
+ with open(self._get_index_loc(), "w") as f:
+ header = "# hash " \
+ "last_used type name path\n"
+ f.write(header)
+ for entry_hash, entry in self._entries.iteritems():
+ values = (entry_hash, entry["last_used"], entry["type"],
+ entry["name"], entry["path"])
+ line = "%s %d %s %s %s\n" % values
+ f.write(line)
+
+ def _get_index_loc(self):
+ return "%s/%s" % (self._root, self._CACHE_INDEX_FILE_NAME)
+
+ def query(self, res_hash):
+ return res_hash in self._entries
+
+ def get_path(self, res_hash):
+ return "%s/%s" % (self._root, self._entries[res_hash]["path"])
+
+ def renew_entry(self, entry_hash):
+ self._entries[entry_hash]["last_used"] = int(time.time())
+ self._save_index()
+
+ def add_cache_entry(self, entry_hash, filepath, entry_name, entry_type):
+ if entry_hash in self._entries:
+ raise ResourceCacheError("File already in cache")
+
+ entry_dir = "%s/%s" % (self._root, entry_hash)
+ os.mkdir(entry_dir)
+
+ shutil.move(filepath, entry_dir)
+ entry_path = "%s/%s" % (entry_dir, os.path.basename(filepath))
+
+ if entry_type == "module":
+ filename = "Test%s.py" % entry_name
+ shutil.move(entry_path, "%s/%s" % (entry_dir, filename))
+ elif entry_type == "tools":
+ filename = entry_name
+ tools_dir = "%s/%s" % (entry_dir, filename)
+
+ exec_cmd("tar xjmf \"%s\" -C \"%s\"" % (entry_path, entry_dir))
+ exec_cmd("cd \"%s\" && ./lnst-setup.sh" % tools_dir)
+
+ entry = {"type": entry_type, "name": entry_name,
+ "last_used": int(time.time()),
+ "path": "%s/%s" % (entry_hash, filename)}
+ self._entries[entry_hash] = entry
+
+ self._save_index()
+
+ return entry_hash
+
+ def del_cache_entry(self, entry_hash):
+ if entry_hash in self._entries:
+ shutil.rmtree("%s/%s" % (self._root, entry_hash))
+ del self._entries[entry_hash]
+ self._save_index()
+
+ def del_old_entries(self):
+ if self._expiration_period == 0:
+ return
+
+ rm = []
+ now = time.time()
+ for entry_hash, entry in self._entries.iteritems():
+ if entry["last_used"] <= (now - self._expiration_period):
+ rm.append(entry_hash)
+
+ for entry_hash in rm:
+ self.del_cache_entry(entry_hash)
11 years, 5 months
[lnst] Resources: Turn Tests/ and test_tools/ into resources
by Jiří Pírko
commit f0c6261a7c9157e24cdbf49ab1e753074e1d3fa8
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:46 2012 +0100
Resources: Turn Tests/ and test_tools/ into resources
This patch removes the Test package and turns all the tests
contained within it into resources a new concept, that will
be used to transfer tests and tools between controller and
the slaves.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
{Tests => test_modules}/TestDummyFailing.py | 0
{Tests => test_modules}/TestIcmp6Ping.py | 0
{Tests => test_modules}/TestIcmpPing.py | 0
{Tests => test_modules}/TestIperf.py | 1 -
{Tests => test_modules}/TestMulticast.py | 9 +++------
{Tests => test_modules}/TestNetCat.py | 0
{Tests => test_modules}/TestPacketAssert.py | 0
{Tests => test_modules}/TestPktCounter.py | 0
{Tests => test_modules}/TestPktgenTx.py | 0
{Tests => test_modules}/TestTCPConnect.py | 0
{Tests => test_modules}/TestTCPListen.py | 0
test_tools/multicast/lnst-setup.sh | 3 +++
12 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/Tests/TestDummyFailing.py b/test_modules/TestDummyFailing.py
similarity index 100%
rename from Tests/TestDummyFailing.py
rename to test_modules/TestDummyFailing.py
diff --git a/Tests/TestIcmp6Ping.py b/test_modules/TestIcmp6Ping.py
similarity index 100%
rename from Tests/TestIcmp6Ping.py
rename to test_modules/TestIcmp6Ping.py
diff --git a/Tests/TestIcmpPing.py b/test_modules/TestIcmpPing.py
similarity index 100%
rename from Tests/TestIcmpPing.py
rename to test_modules/TestIcmpPing.py
diff --git a/Tests/TestIperf.py b/test_modules/TestIperf.py
similarity index 99%
rename from Tests/TestIperf.py
rename to test_modules/TestIperf.py
index e928702..84c887d 100644
--- a/Tests/TestIperf.py
+++ b/test_modules/TestIperf.py
@@ -148,4 +148,3 @@ class TestIperf(TestGeneric):
return self.set_fail(message)
return self.set_pass(message)
-
diff --git a/Tests/TestMulticast.py b/test_modules/TestMulticast.py
similarity index 93%
rename from Tests/TestMulticast.py
rename to test_modules/TestMulticast.py
index 860608a..9909bcd 100644
--- a/Tests/TestMulticast.py
+++ b/test_modules/TestMulticast.py
@@ -25,7 +25,6 @@ class TestMulticast(TestGeneric):
"""
- _tools_location = "test_tools/multicast/"
_conditions = {}
@staticmethod
@@ -41,7 +40,7 @@ class TestMulticast(TestGeneric):
cmd = ""
opts = {}
- setup = self._tools_location + self.get_mopt("setup")
+ setup = self.get_mopt("setup")
opts["multicast_address"] = self._remove_mask(self.get_opt("address"))
opts["port"] = self.get_opt("port")
opts["interface"] = self._remove_mask(self.get_opt("interface"))
@@ -108,11 +107,9 @@ class TestMulticast(TestGeneric):
setup_name = self.get_mopt("setup")
logging.info("Started Multicast test setup {0}".format(setup_name))
- exec_cmd("cd " + self._tools_location + " && make",
- log_outputs=False)
-
cmd = self._compose_cmd()
- data_stdout = exec_cmd(cmd, die_on_err=False, log_outputs=False)[0]
+ data_stdout = self.exec_from("multicast", cmd, die_on_err=False,
+ log_outputs=False)[0]
res = {}
diff --git a/Tests/TestNetCat.py b/test_modules/TestNetCat.py
similarity index 100%
rename from Tests/TestNetCat.py
rename to test_modules/TestNetCat.py
diff --git a/Tests/TestPacketAssert.py b/test_modules/TestPacketAssert.py
similarity index 100%
rename from Tests/TestPacketAssert.py
rename to test_modules/TestPacketAssert.py
diff --git a/Tests/TestPktCounter.py b/test_modules/TestPktCounter.py
similarity index 100%
rename from Tests/TestPktCounter.py
rename to test_modules/TestPktCounter.py
diff --git a/Tests/TestPktgenTx.py b/test_modules/TestPktgenTx.py
similarity index 100%
rename from Tests/TestPktgenTx.py
rename to test_modules/TestPktgenTx.py
diff --git a/Tests/TestTCPConnect.py b/test_modules/TestTCPConnect.py
similarity index 100%
rename from Tests/TestTCPConnect.py
rename to test_modules/TestTCPConnect.py
diff --git a/Tests/TestTCPListen.py b/test_modules/TestTCPListen.py
similarity index 100%
rename from Tests/TestTCPListen.py
rename to test_modules/TestTCPListen.py
diff --git a/test_tools/multicast/lnst-setup.sh b/test_tools/multicast/lnst-setup.sh
new file mode 100755
index 0000000..2aad486
--- /dev/null
+++ b/test_tools/multicast/lnst-setup.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+make
11 years, 5 months
[lnst] Utils: Adding has_changed_since
by Jiří Pírko
commit e7663fb358dea488958e0dccbef265817bcc15ab
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:45 2012 +0100
Utils: Adding has_changed_since
This predicate will examine a file or a directory subtree and
evaluate False in case any file has been modified after the
threshold time.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Common/Utils.py | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/Common/Utils.py b/Common/Utils.py
index 0170920..3109a31 100644
--- a/Common/Utils.py
+++ b/Common/Utils.py
@@ -129,3 +129,22 @@ def dir_md5sum(dir_path):
os.unlink(tar_filepath)
return md5_digest
+
+def has_changed_since(filepath, threshold):
+ if os.path.isfile(filepath):
+ return _is_newer_than(filepath, threshold)
+
+ for root, dirs, files in os.walk(directory):
+ for f in files:
+ if _is_newer_than(f, threshold):
+ return False
+
+ for d in dirs:
+ if _is_newer_than(d, threshold):
+ return False
+
+ return True
+
+def _is_newer_than(f, threshold):
+ stat = os.stat(f)
+ return stat.st_mtime > threshold
11 years, 5 months
[lnst] Utils: Addding dir_md5sum and create_tar_archive
by Jiří Pírko
commit 1405f633e4ae3bd3988afb09792ef1fb4ed79e87
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:44 2012 +0100
Utils: Addding dir_md5sum and create_tar_archive
This commit adds the above mentioned functions to Common/Utils.
The former will compute md5hash of a directory by taring the
whole dir into an archive and then computing its hash.
The latter function can be used for creating tar archives with
or without bzip2 compression.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Common/Utils.py | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/Common/Utils.py b/Common/Utils.py
index 8d00a00..0170920 100644
--- a/Common/Utils.py
+++ b/Common/Utils.py
@@ -12,7 +12,10 @@ jzupka(a)redhat.com (Jiri Zupka)
import logging
import time
import re
+import os
import hashlib
+import tempfile
+from ExecCmd import exec_cmd
def die_when_parent_die():
try:
@@ -97,3 +100,32 @@ def md5sum(file_path, block_size=2**20):
md5.update(data)
return md5.hexdigest()
+
+def create_tar_archive(input_path, target_path, compression=False):
+ if compression:
+ args = "cfj"
+ else:
+ args = "cf"
+
+ if os.path.isdir(target_path):
+ target_path += "/%s.tar.bz" % os.path.basename(input_file.rstrip("/"))
+
+ input_path = input_path.rstrip("/")
+ input_file = os.path.basename(input_path)
+ parent = os.path.dirname(input_path)
+
+ exec_cmd("cd \"%s\" && tar %s \"%s\" \"%s\"" % \
+ (parent, args, target_path, input_file))
+
+ return target_path
+
+def dir_md5sum(dir_path):
+ tmp_file = tempfile.NamedTemporaryFile(delete=False)
+ tmp_file.close()
+
+ tar_filepath = create_tar_archive(dir_path, tmp_file.name)
+ md5_digest = md5sum(tar_filepath)
+
+ os.unlink(tar_filepath)
+
+ return md5_digest
11 years, 5 months
[lnst] Utils: Adding md5sum function
by Jiří Pírko
commit d3dd720293a44a43331f6316bea33f2bab609880
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:43 2012 +0100
Utils: Adding md5sum function
This function can be used to compute a hash of a file.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Common/Utils.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/Common/Utils.py b/Common/Utils.py
index bae3043..8d00a00 100644
--- a/Common/Utils.py
+++ b/Common/Utils.py
@@ -12,6 +12,7 @@ jzupka(a)redhat.com (Jiri Zupka)
import logging
import time
import re
+import hashlib
def die_when_parent_die():
try:
@@ -85,3 +86,14 @@ def bool_it(val):
elif re.match("^\s*(?i)(false)", val):
return False
return True if int_it(val) else False
+
+def md5sum(file_path, block_size=2**20):
+ md5 = hashlib.md5()
+ with open(file_path, "rb") as f:
+ while True:
+ data = f.read(block_size)
+ if not data:
+ break
+ md5.update(data)
+
+ return md5.hexdigest()
11 years, 5 months
[lnst] NetTest: Adding copy-to-slave capability
by Jiří Pírko
commit 843411ca29a67ab28321b291b314863ebb8a67dd
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:42 2012 +0100
NetTest: Adding copy-to-slave capability
This patch introduces a function at controller that will copy a
local file to a remote location using the rpc channel.
Files are copied in 1M large chunks.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestController.py | 16 ++++++++++++++++
NetTest/NetTestSlave.py | 30 ++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index c66abb0..c01eecd 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -15,6 +15,7 @@ import logging
import socket
import os
import pickle
+from xmlrpclib import Binary
from Common.Logs import Logs, log_exc_traceback
from Common.SshUtils import scp_from_remote
from pprint import pprint, pformat
@@ -550,3 +551,18 @@ class NetTestController:
data['address'] = '(' + address + ')'
record = logging.makeLogRecord(data)
logger.handle(record)
+
+ def _copy_to_slave(self, local_path, machine_id, remote_path=None):
+ self._rpc_call(machine_id, "start_copy", remote_path)
+ f = open(local_path, "r+b")
+
+ while True:
+ data = f.read(1024*1024) # 1MB buffer
+ if len(data) == 0:
+ break
+
+ self._rpc_call(machine_id, "copy_part", Binary(data))
+
+ # return remote path
+ rpath = self._rpc_call(machine_id, "finish_copy")
+ return rpath
diff --git a/NetTest/NetTestSlave.py b/NetTest/NetTestSlave.py
index 822dc37..988dc00 100644
--- a/NetTest/NetTestSlave.py
+++ b/NetTest/NetTestSlave.py
@@ -15,6 +15,7 @@ from Common.Logs import Logs, log_exc_traceback
import signal
import select, logging
import os
+from tempfile import NamedTemporaryFile
from Common.PacketCapture import PacketCapture
from Common.XmlRpc import Server
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
@@ -37,6 +38,8 @@ class NetTestSlaveXMLRPC:
self._netconfig = NetConfig()
self._command_context = command_context
+ self._copy_target = None
+
def hello(self):
return "hello"
@@ -133,6 +136,33 @@ class NetTestSlaveXMLRPC:
self._command_context.cleanup()
return True
+ def start_copy(self, filename=None):
+ if self._copy_target:
+ return False
+
+ if filename:
+ self._copy_target = open(filename, "w+b")
+ else:
+ self._copy_target = NamedTemporaryFile("w+b", delete=False)
+
+ return True
+
+ def copy_part(self, binary_data):
+ if self._copy_target:
+ self._copy_target.write(binary_data.data)
+ return True
+
+ return False
+
+ def finish_copy(self):
+ if self._copy_target:
+ name = self._copy_target.name
+ del self._copy_target
+ self._copy_target = None
+ return name
+
+ return ""
+
class MySimpleXMLRPCServer(Server):
def __init__(self, command_context, *args, **kwargs):
self._finished = False
11 years, 5 months
[PATCH 00/13] Test modules and tools management
by Radek Pazdera
This series revamps the way how LNST manages test modules and tools.
Up to this point modules and tools were integral part of the LNST
distribution. This patchset was developed to provide users with a way
of adding their own modules and tools.
LNST is now able to mange the tools and transfer them from controller
to the slaves automatically. Here is a quick overview of how it works:
Test modules are python files in (configurable) ./test_modules/Test.*\.py
Test tools are directories in (configurable) ./test_tools/.*/
nettestctl will generate hashes from all these files and send them over
to slaves. They will respond with a list of files they don't have. The
controller then transfers the files. Files are cached on slaves' side.
Each of LNST tools has to contain an init script 'lnst-steup.sh' that
will be executed when the tools arrive to each slave.
Radek Pazdera (13):
NetTest: Adding copy-to-slave capability
Utils: Adding md5sum function
Utils: Addding dir_md5sum and create_tar_archive
Utils: Adding has_changed_since
Resources: Turn Tests/ and test_tools/ into resources
ResourceCache: Adding a cache for modules and tools
NetTestSlave: Adding caching support
NetTestCommand: Adding caching support
NetTestController: Caching support implementation
nettestslave: Pass config to the RPC methods
Config: Adding cache expiration_period to slave config
xmlrpc: Modifying 'hello' and adding 'bye' method
ctl-config: Adding default path to tools and modules
Common/Config.py | 26 +++++
Common/ResourceCache.py | 132 +++++++++++++++++++++++
Common/Utils.py | 63 +++++++++++
NetTest/NetTestCommand.py | 53 +++++++---
NetTest/NetTestController.py | 135 +++++++++++++++++++++---
NetTest/NetTestParse.py | 3 +
NetTest/NetTestSlave.py | 81 ++++++++++++++-
Tests/TestDummyFailing.py | 18 ---
Tests/TestIcmp6Ping.py | 63 -----------
Tests/TestIcmpPing.py | 57 ----------
Tests/TestIperf.py | 151 --------------------------
Tests/TestMulticast.py | 134 ------------------------
Tests/TestNetCat.py | 67 ------------
Tests/TestPacketAssert.py | 140 -------------------------
Tests/TestPktCounter.py | 69 ------------
Tests/TestPktgenTx.py | 92 ----------------
Tests/TestTCPConnect.py | 203 ------------------------------------
Tests/TestTCPListen.py | 198 -----------------------------------
lnst-ctl.conf | 4 +-
lnst-slave.conf | 1 +
nettestslave.py | 5 +-
test_modules/TestDummyFailing.py | 18 +++
test_modules/TestIcmp6Ping.py | 63 +++++++++++
test_modules/TestIcmpPing.py | 57 ++++++++++
test_modules/TestIperf.py | 150 ++++++++++++++++++++++++++
test_modules/TestMulticast.py | 131 +++++++++++++++++++++++
test_modules/TestNetCat.py | 67 ++++++++++++
test_modules/TestPacketAssert.py | 140 +++++++++++++++++++++++++
test_modules/TestPktCounter.py | 69 ++++++++++++
test_modules/TestPktgenTx.py | 92 ++++++++++++++++
test_modules/TestTCPConnect.py | 203 ++++++++++++++++++++++++++++++++++++
test_modules/TestTCPListen.py | 198 +++++++++++++++++++++++++++++++++++
test_tools/multicast/lnst-setup.sh | 3 +
33 files changed, 1654 insertions(+), 1232 deletions(-)
create mode 100644 Common/ResourceCache.py
delete mode 100644 Tests/TestDummyFailing.py
delete mode 100644 Tests/TestIcmp6Ping.py
delete mode 100644 Tests/TestIcmpPing.py
delete mode 100644 Tests/TestIperf.py
delete mode 100644 Tests/TestMulticast.py
delete mode 100644 Tests/TestNetCat.py
delete mode 100644 Tests/TestPacketAssert.py
delete mode 100644 Tests/TestPktCounter.py
delete mode 100644 Tests/TestPktgenTx.py
delete mode 100644 Tests/TestTCPConnect.py
delete mode 100644 Tests/TestTCPListen.py
delete mode 100644 Tests/__init__.py
create mode 100644 test_modules/TestDummyFailing.py
create mode 100644 test_modules/TestIcmp6Ping.py
create mode 100644 test_modules/TestIcmpPing.py
create mode 100644 test_modules/TestIperf.py
create mode 100644 test_modules/TestMulticast.py
create mode 100644 test_modules/TestNetCat.py
create mode 100644 test_modules/TestPacketAssert.py
create mode 100644 test_modules/TestPktCounter.py
create mode 100644 test_modules/TestPktgenTx.py
create mode 100644 test_modules/TestTCPConnect.py
create mode 100644 test_modules/TestTCPListen.py
create mode 100755 test_tools/multicast/lnst-setup.sh
--
1.7.7.6
11 years, 5 months
[lnst] Fix crash in deconfiguration when no interfaces were configured
by Jiří Pírko
commit ec87320c17c12a22e9989c5b10873e5a71828858
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Thu Nov 8 11:37:48 2012 +0100
Fix crash in deconfiguration when no interfaces were configured
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
NetTest/NetTestController.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 13eefb4..c66abb0 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -309,7 +309,7 @@ class NetTestController:
return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
- if "rpc" not in info:
+ if "rpc" not in info or "configured_interfaces" not in info:
continue
for if_id in reversed(info["configured_interfaces"]):
self._rpc_call(machine_id, 'deconfigure_interface', if_id)
11 years, 5 months
[PATCH] Fix crash in deconfiguration when no interfaces were configured
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
NetTest/NetTestController.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 13eefb4..c66abb0 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -309,7 +309,7 @@ class NetTestController:
return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
- if "rpc" not in info:
+ if "rpc" not in info or "configured_interfaces" not in info:
continue
for if_id in reversed(info["configured_interfaces"]):
self._rpc_call(machine_id, 'deconfigure_interface', if_id)
--
1.7.7.6
11 years, 5 months