[lnst] TaskAPI: Add command description to host.run args
by Jiří Pírko
commit 64cbd76986a2f24e81fa97d7cb242ca3948672e5
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Jun 30 12:13:34 2014 +0200
TaskAPI: Add command description to host.run args
This patch adds 'desc' argument into HostAPI's run method.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Task.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 315b099..ad7fb68 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -165,6 +165,8 @@ class HostAPI(object):
else:
msg = "Argument 'tool' not valid when running modules."
raise TaskError(msg)
+ elif arg == "desc":
+ cmd["desc"] = argval
else:
msg = "Argument '%s' not recognised by the run() method." % arg
raise TaskError(msg)
9 years, 5 months
[lnst] Controller: Fix command description reference
by Jiří Pírko
commit 6f9c5d395a282c02467806caceb8402103fea6c6
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Jun 30 12:12:13 2014 +0200
Controller: Fix command description reference
There's a bug in handling command description 'desc' parameter. Code
references variable 'desc' but instead we have to use 'desc' key of
command dictionary.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestController.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 527c640..3c33d68 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -660,7 +660,7 @@ class NetTestController:
logging.info("Executing command: [%s]", str_command(command))
if "desc" in command:
- logging.info("Cmd description: %s", desc)
+ logging.info("Cmd description: %s", command["desc"])
if command["type"] == "ctl_wait":
sleep(command["seconds"])
9 years, 5 months
[PATCH] TaskAPI: Add command description to host.run args
by Jan Tluka
This patch adds 'desc' argument into HostAPI's run method.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/Task.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 315b099..ad7fb68 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -165,6 +165,8 @@ class HostAPI(object):
else:
msg = "Argument 'tool' not valid when running modules."
raise TaskError(msg)
+ elif arg == "desc":
+ cmd["desc"] = argval
else:
msg = "Argument '%s' not recognised by the run() method." % arg
raise TaskError(msg)
--
1.8.1.4
9 years, 5 months
[PATCH] Controller: Fix command description reference
by Jan Tluka
There's a bug in handling command description 'desc' parameter. Code
references variable 'desc' but instead we have to use 'desc' key of
command dictionary.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/NetTestController.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 527c640..3c33d68 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -660,7 +660,7 @@ class NetTestController:
logging.info("Executing command: [%s]", str_command(command))
if "desc" in command:
- logging.info("Cmd description: %s", desc)
+ logging.info("Cmd description: %s", command["desc"])
if command["type"] == "ctl_wait":
sleep(command["seconds"])
--
1.8.1.4
9 years, 5 months
[lnst] Iperf: Fix typo in rate limit evaluation
by Jiří Pírko
commit 88aa28389fcb2d7f3d816118784d648ca3351a5e
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri Jun 27 11:49:07 2014 +0200
Iperf: Fix typo in rate limit evaluation
There's a typo in rate evaluation. The rate_units should be used instead
of rate_val for the comparison.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
test_modules/Iperf.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/test_modules/Iperf.py b/test_modules/Iperf.py
index 2982cff..74fa9b6 100644
--- a/test_modules/Iperf.py
+++ b/test_modules/Iperf.py
@@ -56,7 +56,7 @@ class Iperf(TestGeneric):
rate_val *= 1000
elif rate_units == 'M':
rate_val *= 1000*1000
- elif rate_val == 'G':
+ elif rate_units == 'G':
rate_val *= 1000*1000*1000
# divide by k or M or G if present
9 years, 5 months
[lnst] IcmpPing: Fix string typos in ping test modules
by Jiří Pírko
commit 5f81681cc571a83e505a45f1bd642167a5981de2
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri Jun 27 10:55:25 2014 +0200
IcmpPing: Fix string typos in ping test modules
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
test_modules/Icmp6Ping.py | 2 +-
test_modules/IcmpPing.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/test_modules/Icmp6Ping.py b/test_modules/Icmp6Ping.py
index 3c5c994..5e05e90 100644
--- a/test_modules/Icmp6Ping.py
+++ b/test_modules/Icmp6Ping.py
@@ -64,7 +64,7 @@ class Icmp6Ping(TestGeneric):
res_data["rtt_max"] = tmax
if rate < limit_rate :
- res_data["msg"] = "rate is lower that limit"
+ res_data["msg"] = "rate is lower than limit"
return self.set_fail(res_data)
return self.set_pass(res_data)
diff --git a/test_modules/IcmpPing.py b/test_modules/IcmpPing.py
index 6f7380c..5dfc5b2 100644
--- a/test_modules/IcmpPing.py
+++ b/test_modules/IcmpPing.py
@@ -62,7 +62,7 @@ class IcmpPing(TestGeneric):
res_data["rtt_max"] = tmax
if rate < limit_rate:
- res_data["msg"] = "rate is lower that limit"
+ res_data["msg"] = "rate is lower than limit"
return self.set_fail(res_data)
return self.set_pass(res_data)
9 years, 5 months
[PATCH] Iperf: Fix typo in rate limit evaluation
by Jan Tluka
There's a typo in rate evaluation. The rate_units should be used instead
of rate_val for the comparison.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Iperf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_modules/Iperf.py b/test_modules/Iperf.py
index 2982cff..74fa9b6 100644
--- a/test_modules/Iperf.py
+++ b/test_modules/Iperf.py
@@ -56,7 +56,7 @@ class Iperf(TestGeneric):
rate_val *= 1000
elif rate_units == 'M':
rate_val *= 1000*1000
- elif rate_val == 'G':
+ elif rate_units == 'G':
rate_val *= 1000*1000*1000
# divide by k or M or G if present
--
1.8.1.4
9 years, 5 months
[PATCH] IcmpPing: Fix string typos in ping test modules
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
test_modules/Icmp6Ping.py | 2 +-
test_modules/IcmpPing.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test_modules/Icmp6Ping.py b/test_modules/Icmp6Ping.py
index 3c5c994..5e05e90 100644
--- a/test_modules/Icmp6Ping.py
+++ b/test_modules/Icmp6Ping.py
@@ -64,7 +64,7 @@ class Icmp6Ping(TestGeneric):
res_data["rtt_max"] = tmax
if rate < limit_rate :
- res_data["msg"] = "rate is lower that limit"
+ res_data["msg"] = "rate is lower than limit"
return self.set_fail(res_data)
return self.set_pass(res_data)
diff --git a/test_modules/IcmpPing.py b/test_modules/IcmpPing.py
index 6f7380c..5dfc5b2 100644
--- a/test_modules/IcmpPing.py
+++ b/test_modules/IcmpPing.py
@@ -62,7 +62,7 @@ class IcmpPing(TestGeneric):
res_data["rtt_max"] = tmax
if rate < limit_rate:
- res_data["msg"] = "rate is lower that limit"
+ res_data["msg"] = "rate is lower than limit"
return self.set_fail(res_data)
return self.set_pass(res_data)
--
1.8.1.4
9 years, 5 months
[lnst] TaskAPI: don't use kwargs for passing options to test module
by Jiří Pírko
commit c7be51d1d49cab86ce72b0d20b5ca682b185afbf
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Jun 25 16:02:31 2014 +0200
TaskAPI: don't use kwargs for passing options to test module
Currently the TaskAPI uses kwargs to pass options to a test module. If a
user decides to run test module from XML there are no limitations on the
name of an option. But when the user uses TaskAPI get_module method the
option names are limited because of Python reserved words [1]. Developer
of a test might want to use e.g. 'if' for a variable containing an interface
to use for testing. To be consistent between the two approaches I'm sending
a patch that uses parameter 'options' of type dictionary for passing the
test module options.
Example:
Old: my_mod = ctl.get_module("Multicast",
setup="send_simple",
duration=10,
condition="status == 'pass'")
New: my_mod = ctl.get_module("Multicast", options={
"setup": "send_simple",
"duration": 10,
"condition": "status == 'pass'"})
I have tested the patch using Multicast test module and it works fine.
[1] https://docs.python.org/2/reference/lexical_analysis.html#keywords
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Task.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 59f17c5..315b099 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -53,7 +53,7 @@ class ControllerAPI(object):
host = self._hosts[host_id]
return HostAPI(self, host_id, host)
- def get_module(self, name, **kwargs):
+ def get_module(self, name, options={}):
"""
Initialize a module to be run on a host.
@@ -63,7 +63,7 @@ class ControllerAPI(object):
:return: The module handle.
:rtype: ModuleAPI
"""
- return ModuleAPI(name, kwargs)
+ return ModuleAPI(name, options)
def wait(self, seconds):
"""
9 years, 5 months