Lines Matching full:assert
12 assert GRE in pkt
14 assert gre.chksum_present == 0
15 assert gre.routing_present == 0
16 assert gre.key_present == 0
17 assert gre.seqnum_present == 0
18 assert gre.strict_route_source == 0
19 assert gre.recursion_control == 0
20 assert gre.flags == 0
21 assert gre.version == 0
22 assert gre.proto == 0x800
30 assert GRE_PPTP in pkt
32 assert gre_pptp.chksum_present == 0
33 assert gre_pptp.routing_present == 0
34 assert gre_pptp.key_present == 1
35 assert gre_pptp.seqnum_present == 1
36 assert gre_pptp.strict_route_source == 0
37 assert gre_pptp.recursion_control == 0
38 assert gre_pptp.acknum_present == 0
39 assert gre_pptp.flags == 0
40 assert gre_pptp.version == 1
41 assert gre_pptp.proto == 0x880b
42 assert gre_pptp.payload_len == 28
43 assert gre_pptp.call_id == 39925
44 assert gre_pptp.seqence_number == 0x0
46 assert HDLC in pkt
47 assert PPP in pkt
48 assert PPP_LCP_Configure in pkt
59 assert (pkt_data == pkt_data_ref)
61 assert IP in pkt
62 assert GRE_PPTP in pkt
63 assert HDLC in pkt
64 assert PPP in pkt
65 assert PPP_LCP_Echo in pkt
67 assert pkt[IP].proto == 47
68 assert pkt[GRE_PPTP].chksum_present == 0
69 assert pkt[GRE_PPTP].routing_present == 0
70 assert pkt[GRE_PPTP].key_present == 1
71 assert pkt[GRE_PPTP].seqnum_present == 1
72 assert pkt[GRE_PPTP].acknum_present == 1
73 assert pkt[GRE_PPTP].seqence_number == 47
74 assert pkt[GRE_PPTP].ack_number == 42
75 assert pkt[PPP].proto == 0xc021
76 assert pkt[PPP_LCP_Echo].code == 9
77 assert pkt[PPP_LCP_Echo].id == 42
78 assert pkt[PPP_LCP_Echo].magic_number == 4242
79 assert pkt[PPP_LCP_Echo].data == b'abcdef'
91 assert lcp_echo_reply_pkt.answers(lcp_echo_request_pkt)
92 assert not lcp_echo_request_pkt.answers(lcp_echo_reply_pkt)
97 assert not lcp_echo_non_reply_pkt.answers(lcp_echo_request_pkt)
102 assert not lcp_echo_non_reply_pkt.answers(lcp_echo_request_pkt)
110 assert raw(conf_req) == conf_req_ref_data
114 assert PPP_LCP_Configure in conf_req_pkt
115 assert conf_req_pkt[PPP_LCP_Configure].code == 1
116 assert conf_req_pkt[PPP_LCP_Configure].id == 42
117 assert len(conf_req_pkt[PPP_LCP_Configure].options) == 1
118 assert isinstance(conf_req_pkt[PPP_LCP_Configure].options[0], PPP_LCP_Magic_Number_Option)
119 assert conf_req_pkt[PPP_LCP_Configure].options[0].magic_number == 4242
128 assert (raw(conf_ack) == conf_ack_ref_data)
132 assert PPP_LCP_Configure in conf_ack_pkt
133 assert conf_ack_pkt[PPP_LCP_Configure].code == 2
134 assert conf_ack_pkt[PPP_LCP_Configure].id == 42
135 assert len(conf_ack_pkt[PPP_LCP_Configure].options) == 1
136 assert isinstance(conf_ack_pkt[PPP_LCP_Configure].options[0], PPP_LCP_Magic_Number_Option)
137 assert conf_ack_pkt[PPP_LCP_Configure].options[0].magic_number == 4242
141 assert conf_ack_pkt.answers(conf_req_pkt)
142 assert not conf_req_pkt.answers(conf_ack_pkt)
151 assert(raw(conf_nak) == conf_nak_ref_data)
155 assert PPP_LCP_Configure in conf_nak_pkt
156 assert conf_nak_pkt[PPP_LCP_Configure].code == 3
157 assert conf_nak_pkt[PPP_LCP_Configure].id == 42
158 assert len(conf_nak_pkt[PPP_LCP_Configure].options) == 2
159 assert isinstance(conf_nak_pkt[PPP_LCP_Configure].options[0], PPP_LCP_MRU_Option)
160 assert conf_nak_pkt[PPP_LCP_Configure].options[0].max_recv_unit == 1500
161 assert isinstance(conf_nak_pkt[PPP_LCP_Configure].options[1], PPP_LCP_ACCM_Option)
162 assert conf_nak_pkt[PPP_LCP_Configure].options[1].accm == 0xffff0000
166 assert conf_nak_pkt.answers(conf_req_pkt)
167 assert not conf_req_pkt.answers(conf_nak_pkt)
177 assert(raw(conf_reject) == conf_reject_ref_data)
181 assert PPP_LCP_Configure in conf_reject_pkt
182 assert conf_reject_pkt[PPP_LCP_Configure].code == 4
183 assert conf_reject_pkt[PPP_LCP_Configure].id == 42
184 assert len(conf_reject_pkt[PPP_LCP_Configure].options) == 1
185 assert isinstance(conf_reject_pkt[PPP_LCP_Configure].options[0], PPP_LCP_Callback_Option)
186 assert conf_reject_pkt[PPP_LCP_Configure].options[0].operation == 2
187 assert conf_reject_pkt[PPP_LCP_Configure].options[0].message == b'test'
191 assert conf_reject_pkt.answers(conf_req_pkt)
192 assert not conf_req_pkt.answers(conf_reject_pkt)
205 assert(raw(conf_req) == conf_req_ref_data)
209 assert PPP_LCP_Configure in conf_req_pkt
211 assert len(options) == 6
212 assert isinstance(options[0], PPP_LCP_MRU_Option)
213 assert options[0].max_recv_unit == 5000
214 assert isinstance(options[1], PPP_LCP_ACCM_Option)
215 assert options[1].accm == 0xf0f0f0f0
216 assert isinstance(options[2], PPP_LCP_Auth_Protocol_Option)
217 assert options[2].auth_protocol == 0xc023
218 assert isinstance(options[3], PPP_LCP_Quality_Protocol_Option)
219 assert options[3].quality_protocol == 0xc025
220 assert options[3].data == b'test'
221 assert isinstance(options[4], PPP_LCP_Magic_Number_Option)
222 assert options[4].magic_number == 4242
223 assert isinstance(options[5], PPP_LCP_Callback_Option)
224 assert options[5].operation == 4
225 assert options[5].message == b'test'
233 assert(raw(pap) == pap_ref_data)
236 assert isinstance(pap_pkt, PPP_LCP_Auth_Protocol_Option)
237 assert pap_pkt.auth_protocol == 0xc023
242 assert raw(chap_sha1) == chap_sha1_ref_data
245 assert isinstance(chap_sha1_pkt, PPP_LCP_Auth_Protocol_Option)
246 assert chap_sha1_pkt.auth_protocol == 0xc223
247 assert chap_sha1_pkt.algorithm == 6
252 assert raw(eap) == eap_ref_data
255 assert isinstance(eap_pkt, PPP_LCP_Auth_Protocol_Option)
256 assert eap_pkt.auth_protocol == 0xc227
257 assert eap_pkt.data == b'test'
265 assert raw(code_reject) == code_reject_ref_data
268 assert PPP_LCP_Code_Reject in code_reject_pkt
269 assert code_reject_pkt[PPP_LCP_Code_Reject].id == 42
270 assert isinstance(code_reject_pkt[PPP_LCP_Code_Reject].rejected_packet, PPP_LCP)
271 assert code_reject[PPP_LCP_Code_Reject].rejected_packet.code == 42
272 assert code_reject[PPP_LCP_Code_Reject].rejected_packet.id == 7
273 assert code_reject[PPP_LCP_Code_Reject].rejected_packet.data == b'unknown_data'
282 assert raw(protocol_reject) == protocol_reject_ref_data
285 assert PPP_LCP_Protocol_Reject in protocol_reject_pkt
286 assert protocol_reject_pkt[PPP_LCP_Protocol_Reject].id == 42
287 assert protocol_reject_pkt[PPP_LCP_Protocol_Reject].rejected_protocol == 0x8039
288 assert len(protocol_reject_pkt[PPP_LCP_Protocol_Reject].rejected_information) == 5
296 assert raw(discard_request) == discard_request_ref_data
299 assert PPP_LCP_Discard_Request in discard_request_pkt
300 assert discard_request_pkt[PPP_LCP_Discard_Request].id == 7
301 assert discard_request_pkt[PPP_LCP_Discard_Request].magic_number == 4242
302 assert discard_request_pkt[PPP_LCP_Discard_Request].data == b'test'
310 assert raw(terminate_request) == terminate_request_ref_data
313 assert PPP_LCP_Terminate in terminate_request_pkt
314 assert terminate_request_pkt[PPP_LCP_Terminate].code == 5
315 assert terminate_request_pkt[PPP_LCP_Terminate].id == 7
316 assert terminate_request_pkt[PPP_LCP_Terminate].data == b'test'
321 assert raw(terminate_ack) == terminate_ack_ref_data
324 assert PPP_LCP_Terminate in terminate_ack_pkt
325 assert terminate_ack_pkt[PPP_LCP_Terminate].code == 6
326 assert terminate_ack_pkt[PPP_LCP_Terminate].id == 7
328 assert terminate_ack_pkt.answers(terminate_request_pkt)
329 assert not terminate_request_pkt.answers(terminate_ack_pkt)
337 assert raw(pap_request) == pap_request_ref_data
340 assert PPP_PAP_Request in pap_request_pkt
341 assert pap_request_pkt[PPP_PAP_Request].code == 1
342 assert pap_request_pkt[PPP_PAP_Request].id == 42
343 assert pap_request_pkt[PPP_PAP_Request].username == b'administrator'
344 assert pap_request_pkt[PPP_PAP_Request].password == b'secret_password'
345 assert pap_request_pkt[PPP_PAP_Request].summary() in ['PAP-Request username=\'administrator\' passw…
353 assert raw(pap_response) == pap_response_ref_data
356 assert PPP_PAP_Response in pap_response_pkt
357 assert pap_response_pkt[PPP_PAP_Response].code == 2
358 assert pap_response_pkt[PPP_PAP_Response].id == 42
359 assert pap_response_pkt[PPP_PAP_Response].msg_len == 0
360 assert pap_response_pkt[PPP_PAP_Response].message == b''
361 assert pap_response_pkt[PPP_PAP_Response].summary() == 'PAP-Ack'
364 assert pap_response_pkt.answers(pap_request_pkt)
365 assert not pap_request_pkt.answers(pap_response_pkt)
372 assert raw(pap_response) == pap_response_ref_data
375 assert PPP_PAP_Response in pap_response_pkt
376 assert pap_response_pkt[PPP_PAP_Response].code == 3
377 assert pap_response_pkt[PPP_PAP_Response].id == 42
378 assert pap_response_pkt[PPP_PAP_Response].msg_len == len('Bad password')
379 assert pap_response_pkt[PPP_PAP_Response].message == b'Bad password'
380 assert pap_response_pkt[PPP_PAP_Response].summary() in ['PAP-Nak msg=\'Bad password\'', 'PAP-Nak ms…
383 assert pap_response_pkt.answers(pap_request_pkt)
384 assert not pap_request_pkt.answers(pap_response_pkt)
393 assert raw(chap_challenge) == chap_challenge_ref_data
396 assert PPP_CHAP_ChallengeResponse in chap_challenge_pkt
397 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].code == 1
398 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].id == 47
399 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].value_size == 7
400 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].value == b'B' * 7
401 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].optional_name == b'server'
402 assert chap_challenge_pkt[PPP_CHAP_ChallengeResponse].summary() in ['CHAP challenge=0x4242424242424…
410 assert raw(chap_response) == chap_response_ref_data
413 assert PPP_CHAP_ChallengeResponse in chap_response_pkt
414 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].code == 2
415 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].id == 47
416 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].value_size == 16
417 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].value == b'\x00' * 16
418 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].optional_name == b'client'
419 assert chap_response_pkt[PPP_CHAP_ChallengeResponse].summary() in ['CHAP response=0x000000000000000…
424 assert chap_response.answers(chap_challenge)
425 assert not chap_challenge.answers(chap_response)
433 assert raw(chap_success) == chap_success_ref_data
436 assert PPP_CHAP in chap_success_pkt
437 assert chap_success_pkt[PPP_CHAP].code == 3
438 assert chap_success_pkt[PPP_CHAP].id == 47
439 assert chap_success_pkt[PPP_CHAP].data == b''
440 assert chap_success_pkt[PPP_CHAP].summary() in ['CHAP Success message=\'\'', 'CHAP Success message=…
444 assert chap_success_pkt.answers(chap_response_pkt)
445 assert not chap_response_pkt.answers(chap_success_pkt)
452 assert raw(chap_failure) == chap_failure_ref_data
455 assert PPP_CHAP in chap_failure_pkt
456 assert chap_failure_pkt[PPP_CHAP].code == 4
457 assert chap_failure_pkt[PPP_CHAP].id == 47
458 assert chap_failure_pkt[PPP_CHAP].data == b'Go away'
459 assert chap_failure_pkt[PPP_CHAP].summary() in ['CHAP Failure message=\'Go away\'', 'CHAP Failure m…
463 assert chap_failure_pkt.answers(chap_response_pkt)
464 assert not chap_failure_pkt.answers(chap_success_pkt)
482 assert raw(start_control_connection) == start_control_connection_ref_data
486 assert isinstance(start_control_connection_pkt, PPTPStartControlConnectionRequest)
487 assert start_control_connection_pkt.magic_cookie == 0x1a2b3c4d
488 assert start_control_connection_pkt.protocol_version == 1
489 assert start_control_connection_pkt.framing_capabilities == 1
490 assert start_control_connection_pkt.bearer_capabilities == 2
491 assert start_control_connection_pkt.maximum_channels == 42
492 assert start_control_connection_pkt.firmware_revision == 47
493 assert start_control_connection_pkt.host_name == b'test host name' + b'\0' * (64-len('test host nam…
494 assert start_control_connection_pkt.vendor_string == b'test vendor string' + b'\0' * (64-len('test …
510 assert raw(start_control_connection_reply) == start_control_connection_reply_ref_data
514 assert isinstance(start_control_connection_reply_pkt, PPTPStartControlConnectionReply)
515 assert start_control_connection_reply_pkt.magic_cookie == 0x1a2b3c4d
516 assert start_control_connection_reply_pkt.protocol_version == 1
517 assert start_control_connection_reply_pkt.result_code == 2
518 assert start_control_connection_reply_pkt.error_code == 1
519 assert start_control_connection_reply_pkt.framing_capabilities == 2
520 assert start_control_connection_reply_pkt.bearer_capabilities == 1
521 assert start_control_connection_reply_pkt.host_name == b'linux' + b'\0' * (64-len('linux'))
522 assert start_control_connection_reply_pkt.vendor_string == b'vendor' + b'\0' * (64-len('vendor'))
526 assert start_control_connection_reply_pkt.answers(start_control_connection_request)
527 assert not start_control_connection_request.answers(start_control_connection_reply_pkt)
534 assert raw(stop_control_connection) == stop_control_connection_ref_data
538 assert isinstance(stop_control_connection_pkt, PPTPStopControlConnectionRequest)
539 assert stop_control_connection_pkt.magic_cookie == 0x1a2b3c4d
540 assert stop_control_connection_pkt.reason == 3
547 assert raw(stop_control_connection_reply) == stop_control_connection_reply_ref_data
551 assert isinstance(stop_control_connection_reply_pkt, PPTPStopControlConnectionReply)
552 assert stop_control_connection_reply_pkt.magic_cookie == 0x1a2b3c4d
553 assert stop_control_connection_reply_pkt.result_code == 2
554 assert stop_control_connection_reply_pkt.error_code == 6
558 assert stop_control_connection_reply_pkt.answers(stop_control_connection_request)
559 assert not stop_control_connection_request.answers(stop_control_connection_reply_pkt)
566 assert raw(echo_request) == echo_request_ref_data
570 assert isinstance(echo_request_pkt, PPTPEchoRequest)
571 assert echo_request_pkt.magic_cookie == 0x1a2b3c4d
572 assert echo_request_pkt.identifier == 42
579 assert raw(echo_reply) == echo_reply_ref_data
583 assert isinstance(echo_reply_pkt, PPTPEchoReply)
584 assert echo_reply_pkt.magic_cookie == 0x1a2b3c4d
585 assert echo_reply_pkt.identifier == 42
586 assert echo_reply_pkt.result_code == 1
587 assert echo_reply_pkt.error_code == 0
591 assert echo_reply_pkt.answers(echo_request)
592 assert not echo_request.answers(echo_reply)
596 assert not echo_reply_pkt.answers(echo_request_incorrect)
597 assert not echo_request_incorrect.answers(echo_reply_pkt)
614 assert raw(outgoing_call) == outgoing_call_ref_data
618 assert isinstance(outgoing_call_pkt, PPTPOutgoingCallRequest)
619 assert outgoing_call_pkt.magic_cookie == 0x1a2b3c4d
620 assert outgoing_call_pkt.call_id == 4242
621 assert outgoing_call_pkt.call_serial_number == 47
622 assert outgoing_call_pkt.minimum_bps == 1000
623 assert outgoing_call_pkt.maximum_bps == 10000
624 assert outgoing_call_pkt.bearer_type == 2
625 assert outgoing_call_pkt.framing_type == 3
626 assert outgoing_call_pkt.pkt_window_size == 16
627 assert outgoing_call_pkt.pkt_proc_delay == 1
628 assert outgoing_call_pkt.phone_number_len == 9
629 assert outgoing_call_pkt.phone_number == b'123456789' + b'\0' * (64-len('123456789'))
630 assert outgoing_call_pkt.subaddress == b'test' + b'\0' * (64-len('test'))
641 assert raw(outgoing_call_reply) == outgoing_call_reply_ref_data
645 assert isinstance(outgoing_call_reply_pkt, PPTPOutgoingCallReply)
646 assert outgoing_call_reply_pkt.magic_cookie == 0x1a2b3c4d
647 assert outgoing_call_reply_pkt.call_id == 4243
648 assert outgoing_call_reply_pkt.peer_call_id == 4242
649 assert outgoing_call_reply_pkt.result_code == 4
650 assert outgoing_call_reply_pkt.error_code == 4
651 assert outgoing_call_reply_pkt.cause_code == 42
652 assert outgoing_call_reply_pkt.connect_speed == 5000
653 assert outgoing_call_reply_pkt.pkt_window_size == 32
654 assert outgoing_call_reply_pkt.pkt_proc_delay == 3
655 assert outgoing_call_reply_pkt.channel_id == 42
659 assert outgoing_call_reply_pkt.answers(outgoing_call_request)
660 assert not outgoing_call_request.answers(outgoing_call_reply_pkt)
664 assert not outgoing_call_reply_pkt.answers(outgoing_call_request_incorrect)
665 assert not outgoing_call_request_incorrect.answers(outgoing_call_reply_pkt)
680 assert raw(incoming_call) == incoming_call_ref_data
684 assert isinstance(incoming_call_pkt, PPTPIncomingCallRequest)
685 assert incoming_call_pkt.magic_cookie == 0x1a2b3c4d
686 assert incoming_call_pkt.call_id == 4242
687 assert incoming_call_pkt.call_serial_number == 47
688 assert incoming_call_pkt.bearer_type == 2
689 assert incoming_call_pkt.channel_id == 12
690 assert incoming_call_pkt.dialed_number_len == 9
691 assert incoming_call_pkt.dialing_number_len == 10
692 assert incoming_call_pkt.dialed_number == b'123456789' + b'\0' * (64-len('123456789'))
693 assert incoming_call_pkt.dialing_number == b'0123456789' + b'\0' * (64-len('0123456879'))
694 assert incoming_call_pkt.subaddress == b'test' + b'\0' * (64-len('test'))
702 assert raw(incoming_call_reply) == incoming_call_reply_ref_data
705 assert isinstance(incoming_call_reply_pkt, PPTPIncomingCallReply)
706 assert incoming_call_reply_pkt.magic_cookie == 0x1a2b3c4d
707 assert incoming_call_reply_pkt.call_id == 4243
708 assert incoming_call_reply_pkt.peer_call_id == 4242
709 assert incoming_call_reply_pkt.result_code == 1
710 assert incoming_call_reply_pkt.error_code == 0
711 assert incoming_call_reply_pkt.pkt_window_size == 16
712 assert incoming_call_reply_pkt.pkt_transmit_delay == 42
716 assert incoming_call_reply_pkt.answers(incoming_call_req)
717 assert not incoming_call_req.answers(incoming_call_reply)
720 assert not incoming_call_reply_pkt.answers(incoming_call_req_incorrect)
721 assert not incoming_call_req_incorrect.answers(incoming_call_reply_pkt)
730 assert raw(incoming_call_connected) == incoming_call_connected_ref_data
733 assert isinstance(incoming_call_connected_pkt, PPTPIncomingCallConnected)
734 assert incoming_call_connected_pkt.magic_cookie == 0x1a2b3c4d
735 assert incoming_call_connected_pkt.peer_call_id == 4242
736 assert incoming_call_connected_pkt.connect_speed == 47474747
737 assert incoming_call_connected_pkt.pkt_window_size == 16
738 assert incoming_call_connected_pkt.pkt_transmit_delay == 7
739 assert incoming_call_connected_pkt.framing_type == 3
743 assert incoming_call_connected_pkt.answers(incoming_call_reply)
744 assert not incoming_call_reply.answers(incoming_call_connected_pkt)
748 assert not incoming_call_connected_pkt.answers(incoming_call_reply_incorrect)
749 assert not incoming_call_reply_incorrect.answers(incoming_call_connected_pkt)
756 assert raw(call_clear_request) == call_clear_request_ref_data
760 assert isinstance(call_clear_request_pkt, PPTPCallClearRequest)
761 assert call_clear_request_pkt.magic_cookie == 0x1a2b3c4d
762 assert call_clear_request_pkt.call_id == 4242
774 assert raw(call_disconnect_notify) == call_disconnect_notify_ref_data
778 assert isinstance(call_disconnect_notify_pkt, PPTPCallDisconnectNotify)
779 assert call_disconnect_notify_pkt.magic_cookie == 0x1a2b3c4d
780 assert call_disconnect_notify_pkt.call_id == 4242
781 assert call_disconnect_notify_pkt.result_code == 3
782 assert call_disconnect_notify_pkt.error_code == 0
783 assert call_disconnect_notify_pkt.cause_code == 47
784 assert call_disconnect_notify_pkt.call_statistic == b'some description' + b'\0' * (128-len('some de…
793 assert raw(wan_error_notify) == wan_error_notify_ref_data
797 assert isinstance(wan_error_notify_pkt, PPTPWANErrorNotify)
798 assert wan_error_notify_pkt.magic_cookie == 0x1a2b3c4d
799 assert wan_error_notify_pkt.peer_call_id == 4242
800 assert wan_error_notify_pkt.crc_errors == 1
801 assert wan_error_notify_pkt.framing_errors == 2
802 assert wan_error_notify_pkt.hardware_overruns == 3
803 assert wan_error_notify_pkt.buffer_overruns == 4
810 assert raw(set_link_info) == set_link_info_ref_data
814 assert isinstance(set_link_info_pkt, PPTPSetLinkInfo)
815 assert set_link_info_pkt.magic_cookie == 0x1a2b3c4d
816 assert set_link_info_pkt.peer_call_id == 4242
817 assert set_link_info_pkt.send_accm == 0x0f0f0f0f
818 assert set_link_info_pkt.receive_accm == 0xf0f0f0f0