Пример #1
0
 def test_failure_message_packs(self):
     expected_packed_message = build_byte_string(
         "000000000001001906eab88c888e0100000404ff0004")
     message = FailureMessage(
         src_mac=MacAddress.from_string("00:19:06:ea:b8:8c"),
         message_id=255)
     packed_message = MessagePacker.pack(
         message, MacAddress.from_string("00:00:00:00:00:01"))
     self.assertEqual(expected_packed_message, packed_message)
Пример #2
0
    def test_failure2(self):
        self.test_md5_challenge_response()
        message = FailureMessage(self.src_mac, 3)
        self.sm.event(EventRadiusMessageReceived(message, None))

        self.assertEqual(self.sm.state, self.sm.FAILURE2)
        self.assertEqual(self.eap_output_queue.qsize(), 1)
        self.assertIsInstance(self.eap_output_queue.get_nowait()[0],
                              FailureMessage)
        self.assertEqual(self.radius_output_queue.qsize(), 0)
Пример #3
0
 def build_failure(self):
     """Creates an EAP Failure Packet. Returns an EAP packet"""
     return FailureMessage(self.src_mac, self.current_id)