def test_success_message_packs(self): expected_packed_message = build_byte_string( "0180c2000003001906eab88c888e0100000403ff0004") message = SuccessMessage( src_mac=MacAddress.from_string("00:19:06:ea:b8:8c"), message_id=255) packed_message = MessagePacker.pack( message, MacAddress.from_string("01:80:c2:00:00:03")) self.assertEqual(expected_packed_message, packed_message)
def test_success2(self): self.test_md5_challenge_response() message = SuccessMessage(self.src_mac, 3) self.sm.event(EventRadiusMessageReceived(message, None)) self.assertEqual(self.sm.state, self.sm.SUCCESS2) self.assertEqual(self.eap_output_queue.qsize(), 1) self.assertIsInstance(self.eap_output_queue.get_nowait()[0], SuccessMessage) self.assertEqual(self.radius_output_queue.qsize(), 0)
def build_success(self): """Creates an EAP Sucecss Pakcet. Returns an EAP packet""" return SuccessMessage(self.src_mac, self.current_id)