summaryrefslogtreecommitdiff
path: root/validation
diff options
context:
space:
mode:
authorJean-Philippe NOEL2012-12-11 10:11:11 +0100
committerJean-Philippe NOEL2013-02-13 12:01:31 +0100
commitfdcf3f258c22796b4cdf979ae2745471a3454956 (patch)
tree8493d475e6105a5acc56c8cf3d3cddb94f08fa42 /validation
parent01f2f2a49ac1db47042d6e26a11e35d5281b378c (diff)
validation/validlib: modify the version returned by SPC300 plugs, refs #3127
Diffstat (limited to 'validation')
-rw-r--r--validation/validlib/spc300.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/validation/validlib/spc300.py b/validation/validlib/spc300.py
index a884ade712..ad7e726e76 100644
--- a/validation/validlib/spc300.py
+++ b/validation/validlib/spc300.py
@@ -66,15 +66,15 @@ def get_model(key):
"""Gives the model corresponding to a power strip key"""
return config["plugs"][key][3]
-def get_version(key):
+def get_version(key, interface_index = 0):
"""Gives the version corresponding to a power strip key"""
- result = r_execute((key, 0), "cat /proc/net/plc/version\n")
+ result = r_execute((key, interface_index), "cat /proc/net/plc/version\n")
return extract_version(result)
def extract_version(string):
pattern = "PLC Driver: (.*)\nPLC Firmware: (.*)"
(driver, firmware) = re.search(pattern, string).groups()
- return driver.strip("\r") + "/" + firmware.strip("\r")
+ return (driver.strip("\r"), firmware.strip("\r"))
def r_ping(key_origin, key_destination):
"""Ping the plug identified by key_destination from the plug identified by
@@ -261,11 +261,11 @@ if __name__ == "__main__":
"# \n"
"# exit\n")
- assert "eoc-0.7.10/eoc-0.7.11" == extract_version("foo\n"
- "PLC Driver: eoc-0.7.10\r\n"
- "PLC Firmware: eoc-0.7.11\r\n"
- "bar")
- assert "eoc-0.7.10/eoc-0.7.11" == extract_version("foo\n"
- "PLC Driver: eoc-0.7.10\n"
- "PLC Firmware: eoc-0.7.11\n"
- "bar")
+ assert ("eoc-0.7.10", "eoc-0.7.11") == extract_version("foo\n"
+ "PLC Driver: eoc-0.7.10\r\n"
+ "PLC Firmware: eoc-0.7.11\r\n"
+ "bar")
+ assert ("eoc-0.7.10", "eoc-0.7.11") == extract_version("foo\n"
+ "PLC Driver: eoc-0.7.10\n"
+ "PLC Firmware: eoc-0.7.11\n"
+ "bar")