[PATCH] recipes: update virtual_bridge_2_vlans_over_bond test
by Jiri Prochazka
offload setting gro on gso on tso on tx on rx off was missing,
this patch adds it
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
.../phase1/virtual_bridge_2_vlans_over_bond.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index e2a9449..59a2dad 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -32,11 +32,12 @@ g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# TESTS
# ------
-offloads = ["gro", "gso", "tso", "tx"]
-offload_settings = [ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on")],
- [("gro", "off"), ("gso", "on"), ("tso", "on"), ("tx", "on")],
- [("gro", "on"), ("gso", "off"), ("tso", "off"), ("tx", "on")],
- [("gro", "on"), ("gso", "on"), ("tso", "off"), ("tx", "off")]]
+offloads = ["gro", "gso", "tso", "tx", "rx"]
+offload_settings = [ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "on")],
+ [("gro", "off"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "on")],
+ [("gro", "on"), ("gso", "off"), ("tso", "off"), ("tx", "on"), ("rx", "on")],
+ [("gro", "on"), ("gso", "on"), ("tso", "off"), ("tx", "off"), ("rx", "on")],
+ [("gro", "on"), ("gso", "on"), ("tso", "on"), ("tx", "on"), ("rx", "off")]]
ipv = ctl.get_alias("ipv")
netperf_duration = int(ctl.get_alias("netperf_duration"))
--
2.4.11
7 years, 5 months
[PATCH v2 1/4] Config: add info about version in config
by Jiri Prochazka
The are two types of versions - LNST Major Version and git HEAD commit
hash. LNST Major Version is used when LNST is installed and run from
RPM and git commit hash is used when LNST is run from devel git repo.
LNSTMajorVersion variable in Config.py will have to be manully
incremented each time new release is made.
Used version is stored in Config.version attribute.
Getting git HEAD commit hash is done in following steps:
1) Save cwd
2) Change cwd to directory where Config.py file is located
3) Try running git rev-parse HEAD, which returns commit hash
4) If git command execution was successful, use hash as version
5) Else use value of LNSTMajorVersion as version
6) Return to original working directory
If we didn't change cwd, we would have problems with running LNST installed
from RPM in any git repo folder.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Common/Config.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lnst/Common/Config.py b/lnst/Common/Config.py
index 31481b2..7b4d17e 100644
--- a/lnst/Common/Config.py
+++ b/lnst/Common/Config.py
@@ -13,12 +13,15 @@ olichtne(a)redhat.com (Ondrej Lichtner)
import os
import sys
import re
+import subprocess
from lnst.Common.Utils import bool_it
from lnst.Common.NetUtils import verify_mac_address
from lnst.Common.Colours import get_preset_conf
DefaultRPCPort = 9999
+LNSTMajorVersion = '11'
+
class ConfigError(Exception):
pass
@@ -28,6 +31,21 @@ class Config():
def __init__(self):
self._options = dict()
+ self.version = self._get_version()
+
+ def _get_version(self):
+ # Check if I'm in git
+ try:
+ cwd = os.getcwd()
+ abspath = os.path.abspath(__file__)
+ dname = os.path.dirname(abspath)
+ os.chdir(dname)
+ head = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
+ return head
+ except subprocess.CalledProcessError:
+ return LNSTMajorVersion
+ finally:
+ os.chdir(cwd)
def controller_init(self):
self._options['environment'] = dict()
--
2.4.11
7 years, 5 months
[PATCH 1/3] Config: add info about version in config
by Jiri Prochazka
This patch is first from series which implements version control in LNST.
The are two types of versions - LNST Major Version and git HEAD commit
hash. LNST Major Version is used when LNST is installed and run from
RPM and git commit hash is used when LNST is run from devel git repo.
LNSTMajorVersion variable in Config.py will have to be manully
incremented each time new release is made.
Used version is stored in Config.version attribute.
Getting git HEAD commit hash is done in following steps:
1) Save cwd
2) Change cwd to directory where Config.py file is located
3) Try running git rev-parse HEAD, which returns commit hash
4) If git command execution was successful, use hash as version
5) Else use value of LNSTMajorVersion as version
6) Return to original working directory
If we didn't change cwd, we would have problems with running LNST installed
from RPM in any git repo folder.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Common/Config.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lnst/Common/Config.py b/lnst/Common/Config.py
index 31481b2..7b4d17e 100644
--- a/lnst/Common/Config.py
+++ b/lnst/Common/Config.py
@@ -13,12 +13,15 @@ olichtne(a)redhat.com (Ondrej Lichtner)
import os
import sys
import re
+import subprocess
from lnst.Common.Utils import bool_it
from lnst.Common.NetUtils import verify_mac_address
from lnst.Common.Colours import get_preset_conf
DefaultRPCPort = 9999
+LNSTMajorVersion = '11'
+
class ConfigError(Exception):
pass
@@ -28,6 +31,21 @@ class Config():
def __init__(self):
self._options = dict()
+ self.version = self._get_version()
+
+ def _get_version(self):
+ # Check if I'm in git
+ try:
+ cwd = os.getcwd()
+ abspath = os.path.abspath(__file__)
+ dname = os.path.dirname(abspath)
+ os.chdir(dname)
+ head = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
+ return head
+ except subprocess.CalledProcessError:
+ return LNSTMajorVersion
+ finally:
+ os.chdir(cwd)
def controller_init(self):
self._options['environment'] = dict()
--
2.4.11
7 years, 6 months
[PATCH 1/2] lnst-ctl: add -C option to override previously loaded configs
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
Sometimes we want to ignore automatically loaded config files and just
force use a specific file. I added a new option for this '-C' that
reloads the Controller Config defaults and then loads the specified
config file. It's possible to use the option multiple times (each time
will reset the defaults) and it's also possible to use the '-c' option
after using '-C'.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst-ctl | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lnst-ctl b/lnst-ctl
index 5ec08b5..42aad02 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -44,6 +44,8 @@ def usage(retval=0):
"will override any other definitions in the recipe"
print " -a, --define-alias name=value define top-level alias"
print " -c, --config=FILE load additional config file"
+ print " -C, --config-override=FILE reset config defaults and load " \
+ "the following config file"
print " -d, --debug emit debugging messages"
print " --dump-config dumps the join of all loaded " \
"configuration files on stdout and exits"
@@ -238,11 +240,12 @@ def main():
try:
opts, args = getopt.getopt(
sys.argv[1:],
- "A:a:c:dhmoprs:t:ux:v",
+ "A:a:c:C:dhmoprs:t:ux:v",
[
"override_alias=",
"define_alias=",
"config=",
+ "config-override=",
"debug",
"dump-config",
"help",
@@ -308,6 +311,14 @@ def main():
usage(RETVAL_ERR)
else:
lnst_config.load_config(arg)
+ elif opt in ("-C", "--config-override"):
+ if not os.path.isfile(arg):
+ print "File '%s' doesn't exist!" % arg
+ usage(RETVAL_ERR)
+ else:
+ print >> sys.stderr, "Reloading config defaults!"
+ lnst_config.controller_init()
+ lnst_config.load_config(arg)
elif opt in ("-x", "--result"):
result_path = arg
elif opt in ("-t", "--html"):
--
2.8.3
7 years, 6 months
[PATCH] Netperf: use multiples of 1000 for pretty printing
by Jan Tluka
For pretty printing I initially used multiples of 1024. This is a bit confusing
therefore I changed the conversion by using multiples of 1000.
Additionally I've added missing conversion for kbits, mbits, gbits, tbits when
conversion unit is specified.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Netperf.py | 38 +++++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index bc6b264..6367808 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -344,21 +344,21 @@ class Netperf(TestGeneric):
def _pretty_rate(self, rate, unit=None):
pretty_rate = {}
if unit is None:
- if rate < 1024:
+ if rate < 1000:
pretty_rate["unit"] = "bits/sec"
pretty_rate["rate"] = rate
- elif rate < 1024 * 1024:
- pretty_rate["unit"] = "Kbits/sec"
- pretty_rate["rate"] = rate / 1024
- elif rate < 1024 * 1024 * 1024:
- pretty_rate["unit"] = "Mbits/sec"
- pretty_rate["rate"] = rate / (1024 * 1024)
- elif rate < 1024 * 1024 * 1024 * 1024:
- pretty_rate["unit"] = "Gbits/sec"
- pretty_rate["rate"] = rate / (1024 * 1024 * 1024)
- elif rate < 1024 * 1024 * 1024 * 1024 * 1024:
+ elif rate < 1000 * 1000:
+ pretty_rate["unit"] = "kbits/sec"
+ pretty_rate["rate"] = rate / 1000
+ elif rate < 1000 * 1000 * 1000:
+ pretty_rate["unit"] = "mbits/sec"
+ pretty_rate["rate"] = rate / (1000 * 1000)
+ elif rate < 1000 * 1000 * 1000 * 1000:
+ pretty_rate["unit"] = "gbits/sec"
+ pretty_rate["rate"] = rate / (1000 * 1000 * 1000)
+ elif rate < 1000 * 1000 * 1000 * 1000 * 1000:
pretty_rate["unit"] = "tbits/sec"
- pretty_rate["rate"] = rate / (1024 * 1024 * 1024 * 1024)
+ pretty_rate["rate"] = rate / (1000 * 1000 * 1000 * 1000)
else:
if unit == "bits/sec":
pretty_rate["unit"] = "bits/sec"
@@ -366,15 +366,27 @@ class Netperf(TestGeneric):
elif unit == "Kbits/sec":
pretty_rate["unit"] = "Kbits/sec"
pretty_rate["rate"] = rate / 1024
+ elif unit == "kbits/sec":
+ pretty_rate["unit"] = "kbits/sec"
+ pretty_rate["rate"] = rate / 1000
elif unit == "Mbits/sec":
pretty_rate["unit"] = "Mbits/sec"
pretty_rate["rate"] = rate / (1024 * 1024)
+ elif unit == "mbits/sec":
+ pretty_rate["unit"] = "mbits/sec"
+ pretty_rate["rate"] = rate / (1000 * 1000)
elif unit == "Gbits/sec":
pretty_rate["unit"] = "Gbits/sec"
pretty_rate["rate"] = rate / (1024 * 1024 * 1024)
+ elif unit == "gbits/sec":
+ pretty_rate["unit"] = "gbits/sec"
+ pretty_rate["rate"] = rate / (1000 * 1000 * 1000)
elif unit == "Tbits/sec":
pretty_rate["unit"] = "Tbits/sec"
- pretty_rate["rate"] = rate / (1024 * 1024 * 1024)
+ pretty_rate["rate"] = rate / (1024 * 1024 * 1024 * 1024)
+ elif unit == "tbits/sec":
+ pretty_rate["unit"] = "tbits/sec"
+ pretty_rate["rate"] = rate / (1000 * 1000 * 1000 * 1000)
return pretty_rate
--
2.4.11
7 years, 6 months
[PATCH] SlavePool: warn user when Slave pool dir does not exist
by Jiri Prochazka
When pool is defined in config but the directory entered there does not
exist, lnst-ctl ends in OSError exception. This patch prevents that with
warning user that on entered path no directory exists and skips
processing it.
Fixes #173
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/SlavePool.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 02715ed..ddd4168 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -65,7 +65,14 @@ class SlavePool:
dir_path))
pool = self._pools[pool_name]
- dentries = os.listdir(dir_path)
+ try:
+ dentries = os.listdir(dir_path)
+ except OSError:
+ logging.warn("Directory '%s' does not exist for pool '%s'" %
+ (dir_path,
+ pool_name))
+ return
+
for dirent in dentries:
m_id, m = self.add_file(pool_name, dir_path, dirent)
if m_id != None and m != None:
--
2.4.11
7 years, 6 months
[PATCH v6 1/7] SlavePool: add get method for _pools attribute
by Jiri Prochazka
This will be used in list_pools action for accessing dictionary
with available pools.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/SlavePool.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index e825998..02715ed 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -57,6 +57,9 @@ class SlavePool:
self._mapper.set_pools(self._pools)
logging.info("Finished loading pools.")
+ def get_pools(self):
+ return self._pools
+
def add_dir(self, pool_name, dir_path):
logging.info("Processing pool '%s', directory '%s'" % (pool_name,
dir_path))
--
2.4.11
7 years, 6 months
[PATCH 1/2] LoggingCtl: add get_index and prepend option to set_recipe
by Jiri Prochazka
Method get_index() serves for creating index prefixes for log subfolder
name. Counter for indices is only incremented for the first match of
individual runs.
set_recipe() has been expanded with option prepend, which if is True it
prepends recipe_path with index number in format %02d (00, 01, ...).
With this implementation, every dir name is unique, and is no longer
overriden when one recipe file is specified multiple times in command
line arguments. This also enables alphabetical listing of folders.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Common/Logs.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py
index 80bedf3..3209bfc 100644
--- a/lnst/Common/Logs.py
+++ b/lnst/Common/Logs.py
@@ -99,6 +99,7 @@ class LoggingCtl:
recipe_log_path = ""
slaves = {}
transmit_handler = None
+ _id_seq = 0
def __init__(self, debug=False, log_dir=None, log_subdir="", colours=True):
#clear any previously set handlers
@@ -138,10 +139,21 @@ class LoggingCtl:
logger.setLevel(logging.NOTSET)
logger.addHandler(self.display_handler)
- def set_recipe(self, recipe_path, clean=True, expand=""):
+ def _gen_index(self, increment=True):
+ if increment:
+ self._id_seq += 1
+ return "%02d" % self._id_seq
+
+ def set_recipe(self, recipe_path, clean=True, prepend=False, expand=""):
recipe_name = os.path.splitext(os.path.split(recipe_path)[1])[0]
if expand != "":
recipe_name += "_" + expand
+ if prepend:
+ if expand == "match_1":
+ recipe_name = self._gen_index() + "_" + recipe_name
+ else:
+ recipe_name = self._gen_index(increment=False) + "_" + recipe_name
+
self.recipe_log_path = os.path.join(self.log_folder, recipe_name)
if clean:
self._clean_folder(self.recipe_log_path)
--
2.4.11
7 years, 6 months
[PATCH 1/3] ModuleWrap: add backgroud option to ping wrappers
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit adds a 'bg' function parameter to the ping wrapper
functions. This allows us to run multiple parallel pings at the same
time.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/RecipeCommon/ModuleWrap.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lnst/RecipeCommon/ModuleWrap.py b/lnst/RecipeCommon/ModuleWrap.py
index de3babb..2df953c 100644
--- a/lnst/RecipeCommon/ModuleWrap.py
+++ b/lnst/RecipeCommon/ModuleWrap.py
@@ -12,7 +12,7 @@ olichtne(a)redhat.com (Ondrej Lichtner)
from lnst.Controller.Task import ctl
-def ping(src, dst, options={}, expect="pass"):
+def ping(src, dst, options={}, expect="pass", bg=False):
""" Perform an IcmpPing from source to destination
Keyword arguments:
@@ -56,9 +56,9 @@ def ping(src, dst, options={}, expect="pass"):
ping_mod = ctl.get_module("IcmpPing",
options = options)
- return h1.run(ping_mod, expect=expect)
+ return h1.run(ping_mod, expect=expect, bg=bg)
-def ping6(src, dst, options={}, expect="pass"):
+def ping6(src, dst, options={}, expect="pass", bg=False):
""" Perform an Icmp6Ping from source to destination
Keyword arguments:
@@ -102,7 +102,7 @@ def ping6(src, dst, options={}, expect="pass"):
ping_mod = ctl.get_module("Icmp6Ping",
options = options)
- return h1.run(ping_mod, expect=expect)
+ return h1.run(ping_mod, expect=expect, bg=bg)
def netperf(src, dst, server_opts={}, client_opts={}, baseline={}, timeout=60):
""" Start a Netserver on the given machine and ip address
--
2.8.3
7 years, 6 months
[PATCH v4 1/6] SlavePool: add get method for _pools attribute
by Jiri Prochazka
This will be used in list_pools action for accessing dictionary
with available pools.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/SlavePool.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index e825998..02715ed 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -57,6 +57,9 @@ class SlavePool:
self._mapper.set_pools(self._pools)
logging.info("Finished loading pools.")
+ def get_pools(self):
+ return self._pools
+
def add_dir(self, pool_name, dir_path):
logging.info("Processing pool '%s', directory '%s'" % (pool_name,
dir_path))
--
2.4.11
7 years, 6 months