diff options
author | matthew.hodgins <matthew.hodgins@calxeda.com> | 2013-08-02 12:03:25 -0500 |
---|---|---|
committer | matthew.hodgins <matthew.hodgins@calxeda.com> | 2013-08-02 12:03:25 -0500 |
commit | d70d2b090dbb2c9646e7b58425f10a9e9c009919 (patch) | |
tree | e05a0c36f623e2da9610fce1ffc62daf73eaeefd | |
parent | ab8f1c150107e421a7dd4ca7a8473a54dbddf7a6 (diff) | |
download | cxmanage-d70d2b090dbb2c9646e7b58425f10a9e9c009919.tar.gz |
removing wafer_id from DummyNode. Added guid to DummyBMC.
-rw-r--r-- | cxmanage_test/fabric_test.py | 7 | ||||
-rw-r--r-- | cxmanage_test/node_test.py | 21 |
2 files changed, 18 insertions, 10 deletions
diff --git a/cxmanage_test/fabric_test.py b/cxmanage_test/fabric_test.py index 3333444..05fe835 100644 --- a/cxmanage_test/fabric_test.py +++ b/cxmanage_test/fabric_test.py @@ -430,8 +430,6 @@ class FabricTest(unittest.TestCase): class DummyNode(object): """ Dummy node for the nodemanager tests """ - wafer_id_unique = 0 - def __init__(self, ip_address, username="admin", password="admin", tftp=None, *args, **kwargs): self.executed = [] @@ -439,8 +437,6 @@ class DummyNode(object): self.tftp = tftp self.bmc = make_bmc(DummyBMC, hostname=ip_address, username=username, password=password, verbose=False) - self.wafer_id = 'FAKEWAFERID%s' % DummyNode.wafer_id_unique - DummyNode.wafer_id_unique += 1 def get_power(self): self.executed.append("get_power") @@ -604,9 +600,6 @@ class DummyNode(object): def set_uplink(self, uplink, iface): self.executed.append(('set_uplink', uplink, iface)) - def get_wafer_id(self): - return self.wafer_id - class DummyFailNode(DummyNode): """ Dummy node that should fail on some commands """ diff --git a/cxmanage_test/node_test.py b/cxmanage_test/node_test.py index b6f860b..2934914 100644 --- a/cxmanage_test/node_test.py +++ b/cxmanage_test/node_test.py @@ -421,6 +421,9 @@ class NodeTest(unittest.TestCase): class DummyBMC(LanBMC): + + GUID_UNIQUE = 0 + """ Dummy BMC for the node tests """ def __init__(self, **kwargs): super(DummyBMC, self).__init__(**kwargs) @@ -435,6 +438,18 @@ class DummyBMC(LanBMC): Partition(6, 11, 1388544, 12288) # ubootenv ] self.ipaddr_base = '192.168.100.1' + self.unique_guid = 'FAKEGUID%s' % DummyBMC.GUID_UNIQUE + DummyBMC.GUID_UNIQUE += 1 + + def guid(self): + """Returns the GUID""" + self.executed.append("guid") + + class Result: + def __init__(self, dummybmc): + self.system_guid = dummybmc.unique_guid + self.time_stamp = None + return Result(self) def set_chassis_power(self, mode): """ Set chassis power """ @@ -594,7 +609,7 @@ class DummyBMC(LanBMC): link_map.append('Link 1: Node 2') link_map.append('Link 3: Node 1') link_map.append('Link 4: Node 3') - + work_dir = tempfile.mkdtemp(prefix="cxmanage_test-") with open('%s/%s' % (work_dir, filename), 'w') as lm_file: for lmap in link_map: @@ -624,7 +639,7 @@ class DummyBMC(LanBMC): routing_table.append('Node 13: rt - 0.2.0.0.1') routing_table.append('Node 14: rt - 0.2.0.0.1') routing_table.append('Node 15: rt - 0.2.0.0.1') - + work_dir = tempfile.mkdtemp(prefix="cxmanage_test-") with open('%s/%s' % (work_dir, filename), 'w') as rt_file: for rtable in routing_table: @@ -663,7 +678,7 @@ class DummyBMC(LanBMC): depth_chart.append('Node 14: Shortest Distance 3 hops via neighbor 10: other hops/neighbors -') depth_chart.append('Node 15: Shortest Distance 4 hops via neighbor 14: other hops/neighbors - 5/12') - + work_dir = tempfile.mkdtemp(prefix="cxmanage_test-") with open('%s/%s' % (work_dir, filename), 'w') as dc_file: for dchart in depth_chart: |