diff options
author | Sheldon Sandbekkhaug <sheldon.sandbekkhaug@calxeda.com> | 2013-08-05 10:53:25 -0500 |
---|---|---|
committer | Sheldon Sandbekkhaug <sheldon.sandbekkhaug@calxeda.com> | 2013-08-05 10:53:25 -0500 |
commit | 2f5821b91a67499d46d76df45fc8162c5f7c12df (patch) | |
tree | 6f64700f744845e121ae1e5413cff0b4e58a86c4 | |
parent | 02da1993902b35fb33afa18f58abdc0511955338 (diff) | |
download | cxmanage-2f5821b91a67499d46d76df45fc8162c5f7c12df.tar.gz |
Moved code from node.get_chip_name() to node.get_versions()
node.get_chip_name() is no longer supported.
Changed fabric_test.py and node_test.py to reflect these changes.
-rw-r--r-- | cxmanage_api/node.py | 36 | ||||
-rw-r--r-- | cxmanage_test/fabric_test.py | 1 | ||||
-rw-r--r-- | cxmanage_test/node_test.py | 3 |
3 files changed, 13 insertions, 27 deletions
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py index e79e039..19066b6 100644 --- a/cxmanage_api/node.py +++ b/cxmanage_api/node.py @@ -931,6 +931,7 @@ class Node(object): """ result = self.bmc.get_info_basic() fwinfo = self.get_firmware_info() + fw_version = result.firmware_version # components maps variables to firmware partition types components = [ @@ -938,12 +939,19 @@ class Node(object): ("stage2_version", "S2_ELF"), ("bootlog_version", "BOOT_LOG") ] - # Use A9 or A15 if on Highbank or Midway, respectively - if self.get_chip_name() == "Highbank": + # Use firmware version to determine the chip type and name + # In the future, we may want to determine the chip name some other way + if fw_version.startswith("ECX-1000"): components.append(("a9boot_version", "A9_EXEC")) - elif self.get_chip_name() == "Midway": + setattr(result, "chip_name", "Highbank") + elif fw_version.startswith("ECX-2000"): # The BMC (and fwinfo) still reference the A15 as an A9 components.append(("a15boot_version", "A9_EXEC")) + setattr(result, "chip_name", "Midway") + else: + # Default to A9 and unknown name + components.append(("a9boot_version", "A9_EXEC")) + setattr(result, "chip_name", "Unknown") components.append(("uboot_version", "A9_UBOOT")) components.append(("ubootenv_version", "UBOOTENV")) components.append(("dtb_version", "DTB")) @@ -1681,27 +1689,5 @@ class Node(object): "Unable to increment SIMG priority, too high") return priority - def get_chip_name(self): - """Returns the name of the "server-side" chip used by this node. - - >>> node.get_chip_name - 'Highbank' - - :rtype: string - - Currently we check the firmware version to determine whether the chip - used by this node is Highbank or Midway. - - """ - result = self.bmc.get_info_basic() - fw_version = result.firmware_version - - if fw_version.startswith("ECX-1000"): - return "Highbank" - elif fw_version.startswith("ECX-2000"): - return "Midway" - else: - return "Unknown" - # End of file: ./node.py diff --git a/cxmanage_test/fabric_test.py b/cxmanage_test/fabric_test.py index e39dc77..83cf9fe 100644 --- a/cxmanage_test/fabric_test.py +++ b/cxmanage_test/fabric_test.py @@ -510,6 +510,7 @@ class DummyNode(object): self.ecme_timestamp = "0" self.a9boot_version = "v0.0.0" self.uboot_version = "v0.0.0" + self.chip_name = "Unknown" return Result() def ipmitool_command(self, ipmitool_args): diff --git a/cxmanage_test/node_test.py b/cxmanage_test/node_test.py index e7c673f..ec3e8cd 100644 --- a/cxmanage_test/node_test.py +++ b/cxmanage_test/node_test.py @@ -326,8 +326,7 @@ class NodeTest(unittest.TestCase): result = node.get_versions() self.assertEqual(node.bmc.executed, ["get_info_basic", - "get_firmware_info", "get_info_basic", - "get_info_basic", "info_card"]) + "get_firmware_info", "info_card"]) for attr in ["iana", "firmware_version", "ecme_version", "ecme_timestamp"]: self.assertTrue(hasattr(result, attr)) |