示例#1
0
 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;
示例#2
0
    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));
示例#3
0
 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
示例#4
0
    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))
示例#5
0
    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);
示例#6
0
    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)