From: Jiri Pirko <jiri(a)mellanox.com>
This is dependency for "Custom" test module. Allows it to get all
available single-value options.
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>
---
v1->v2:
- no change
---
lnst/Common/TestsCommon.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py
index e29a609..4d5a0ed 100644
--- a/lnst/Common/TestsCommon.py
+++ b/lnst/Common/TestsCommon.py
@@ -127,6 +127,15 @@ class TestGeneric(NetTestCommandGeneric):
'''
return self.get_multi_opt(name, mandatory=True, opt_type=opt_type)
+ def get_single_opts(self):
+ opts = {}
+ for key in self._command["options"]:
+ item = self._command["options"][key]
+ if len(item) == 1:
+ print item[0]["value"]
+ opts[key] = item[0]["value"]
+ return opts
+
def _format_cmd_res_header(self):
cmd_val = self._command["module"]
cmd_type = self._command["type"]
--
2.4.3
Show replies by date