Ejemplo n.º 1
0
    def runTest(self):
        logging.info("Running " + str(self))
        request = malformed_message.malformed_message(version=0, type=0)

        reply, pkt = self.controller.transact(request)
        self.assertTrue(reply is not None, "No response to unsupported hello")
        self.assertTrue(reply.type == ofp.OFPT_ERROR,
                        "reply not an error message")
        self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                        "reply error type is not bad request")
        self.assertTrue(reply.code == ofp.OFPET_HELLO_FAILED,
                        "reply error code is not bad type")
Ejemplo n.º 2
0
    def runTest(self):
        logging.info("Running " + str(self))
        request = malformed_message.malformed_message(version=0, type=0)

        reply, pkt = self.controller.transact(request)
        self.assertTrue(reply is not None, "No response to unsupported hello")
        self.assertTrue(reply.type == ofp.OFPT_ERROR,
                        "reply not an error message")
        self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                        "reply error type is not bad request")
        self.assertTrue(reply.code == ofp.OFPET_HELLO_FAILED,
                        "reply error code is not bad type")
Ejemplo n.º 3
0
    def runTest(self):
        logging.info("Running " + str(self))
        request = malformed_message.malformed_message(version=5, type=10)

        reply, pkt = self.controller.transact(request)
        self.assertTrue(reply is not None,
                        "No response to malformed message version")
        self.assertTrue(reply.type == ofp.OFPT_ERROR,
                        "reply not an error message")
        self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                        "reply error type is not bad request")
        self.assertTrue(reply.code == ofp.OFPBRC_BAD_VERSION,
                        "reply error code is not bad type")
Ejemplo n.º 4
0
    def runTest(self):
        logging.info("Running " + str(self))
        request = malformed_message.malformed_message(version=5, type=10)

        reply, pkt = self.controller.transact(request)
        self.assertTrue(reply is not None,
                        "No response to malformed message version")
        self.assertTrue(reply.type == ofp.OFPT_ERROR,
                        "reply not an error message")
        self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                        "reply error type is not bad request")
        self.assertTrue(reply.code == ofp.OFPBRC_BAD_VERSION,
                        "reply error code is not bad type")
Ejemplo n.º 5
0
    def runTest(self):
        INFO = " 1.1.80 - Malformed Version Number"
        request = malformed_message.malformed_message(version=0, type=0)

        reply, pkt = self.controller.transact(request)
        try:
            self.assertTrue(reply is not None,
                            "No response to malformed version number")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPET_HELLO_FAILED,
                           "Reply error code is not hello failed")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> "+ str(Err))
Ejemplo n.º 6
0
    def runTest(self):
        INFO = " 1.1.70 - Unsupported Version Number"
        request = malformed_message.malformed_message(version=5, type=10)

        try:
            reply, pkt = self.controller.transact(request)
            self.assertTrue(reply is not None,
                            "No response to unsupported version number")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPBRC_BAD_VERSION,
                           "Reply error code is not bad version")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> "+ str(Err))
Ejemplo n.º 7
0
    def runTest(self):
        INFO = " 1.1.60 - Unsupported Message Type"
        request = malformed_message.malformed_message(version=4, type=97)

        reply, pkt = self.controller.transact(request)
        try:
            self.assertTrue(reply is not None,
                            "No response to unsupported message type")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPBRC_BAD_TYPE,
                           "Reply error code is not bad type")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> "+ str(Err))
Ejemplo n.º 8
0
    def runTest(self):
        INFO = " 1.1.80 - Malformed Version Number"
        request = malformed_message.malformed_message(version=0, type=0)

        reply, pkt = self.controller.transact(request)
        try:
            self.assertTrue(reply is not None,
                            "No response to malformed version number")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPET_HELLO_FAILED,
                            "Reply error code is not hello failed")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> " + str(Err))
Ejemplo n.º 9
0
    def runTest(self):
        INFO = " 1.1.70 - Unsupported Version Number"
        request = malformed_message.malformed_message(version=5, type=10)

        try:
            reply, pkt = self.controller.transact(request)
            self.assertTrue(reply is not None,
                            "No response to unsupported version number")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPBRC_BAD_VERSION,
                            "Reply error code is not bad version")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> " + str(Err))
Ejemplo n.º 10
0
    def runTest(self):
        INFO = " 1.1.60 - Unsupported Message Type"
        request = malformed_message.malformed_message(version=4, type=97)

        reply, pkt = self.controller.transact(request)
        try:
            self.assertTrue(reply is not None,
                            "No response to unsupported message type")
            self.assertTrue(reply.type == ofp.OFPT_ERROR,
                            "Reply not an error message")
            self.assertTrue(reply.err_type == ofp.OFPET_BAD_REQUEST,
                            "Reply error type is not bad request")
            self.assertTrue(reply.code == ofp.OFPBRC_BAD_TYPE,
                            "Reply error code is not bad type")
            log.info(PASS + INFO)
        except AssertionError, Err:
            log.info(FAIL + INFO)
            log.info(REASON + " -> " + str(Err))