def test_sched(self): """Do a simple directed route discovery of the subnet""" self.guids = set(); sched = rdma.sched.MADSchedule(self.umad) try: sched.run(self.get_node_info(sched,self.local_path)); except rdma.MADError as err: print err err.req.printer(sys.stdout); raise;
def test_except_mad(self): """Check that exceptions flow from the MAD decoder.""" def first(self,sched): inf = yield sched.SubnGet(IBA.SMPNodeInfo,self.local_path); with self.with_assertRaises(rdma.MADError): yield sched.SubnGet(IBA.SMPPortInfo, self.local_path,inf.numPorts+3); sched = rdma.sched.MADSchedule(self.umad); sched.run(first(self,sched));
def test_sched(self): """Do a simple directed route discovery of the subnet""" self.guids = set() sched = rdma.sched.MADSchedule(self.umad) try: sched.run(self.get_node_info(sched, self.local_path)) except rdma.MADError as err: print err err.req.printer(sys.stdout) raise
def test_except_mad(self): """Check that exceptions flow from the MAD decoder.""" def first(self, sched): inf = yield sched.SubnGet(IBA.SMPNodeInfo, self.local_path) with self.with_assertRaises(rdma.MADError): yield sched.SubnGet(IBA.SMPPortInfo, self.local_path, inf.numPorts + 3) sched = rdma.sched.MADSchedule(self.umad) sched.run(first(self, sched))
def test_except(self): """Check that exceptions flow up the coroutine call chain.""" def second(self): self.count = self.count + 1; raise rdma.RDMAError("moo"); def first(self): try: yield second(self); except rdma.RDMAError: self.count = self.count + 1; raise self.count = 0; sched = rdma.sched.MADSchedule(self.umad); with self.with_assertRaises(rdma.RDMAError): sched.run(first(self)); self.assertEqual(self.count,2);
def test_except(self): """Check that exceptions flow up the coroutine call chain.""" def second(self): self.count = self.count + 1 raise rdma.RDMAError("moo") def first(self): try: yield second(self) except rdma.RDMAError: self.count = self.count + 1 raise self.count = 0 sched = rdma.sched.MADSchedule(self.umad) with self.with_assertRaises(rdma.RDMAError): sched.run(first(self)) self.assertEqual(self.count, 2)