diff options
author | matthew.hodgins <matthew.hodgins@calxeda.com> | 2013-08-01 12:17:40 -0500 |
---|---|---|
committer | matthew.hodgins <matthew.hodgins@calxeda.com> | 2013-08-01 12:17:40 -0500 |
commit | 88a2f7931baaf5eec666f9d35f2dd97c33884f8b (patch) | |
tree | 70f1b76d6b9245c08016f50017de3322acc105d9 | |
parent | f965e13b5363e89367f7b73da43c57122b21d15f (diff) | |
download | cxmanage-88a2f7931baaf5eec666f9d35f2dd97c33884f8b.tar.gz |
added get_wafer_id to DummyNode
-rw-r--r-- | cxmanage_test/fabric_test.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cxmanage_test/fabric_test.py b/cxmanage_test/fabric_test.py index f2720c9..3333444 100644 --- a/cxmanage_test/fabric_test.py +++ b/cxmanage_test/fabric_test.py @@ -44,6 +44,7 @@ from pyipmi import make_bmc NUM_NODES = 128 ADDRESSES = ["192.168.100.%i" % x for x in range(1, NUM_NODES + 1)] + class FabricTest(unittest.TestCase): """ Test the various Fabric commands """ def setUp(self): @@ -301,7 +302,7 @@ class FabricTest(unittest.TestCase): maps = self.fabric.get_routing_table() for nn, node in self.fabric.nodes.items(): self.assertIn('get_routing_table', node.executed) - + def test_get_depth_chart(self): """Test the depth_chart method""" maps = self.fabric.get_depth_chart() @@ -428,6 +429,9 @@ 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 = [] @@ -435,6 +439,8 @@ 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") @@ -598,6 +604,9 @@ 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 """ |