|
29 | 29 |
|
30 | 30 |
|
31 | 31 | """ |
32 | | -This module contains unit tests for the Packet Handler ICMPv4 RX operations. |
| 32 | +This module contains integration tests for the Packet Handler ICMPv4 RX operations. |
33 | 33 |
|
34 | | -pytcp/tests/unit/test__packet_handler__icmp4__rx.py |
| 34 | +pytcp/tests/integration/test__packet_handler__icmp4__rx.py |
35 | 35 |
|
36 | 36 | ver 3.0.4 |
37 | 37 | """ |
|
49 | 49 | { |
50 | 50 | "_description": "Ethernet/IPv4/ICMPv4 Echo Request", |
51 | 51 | "_frames_rx": [ |
| 52 | + # Ethernet II |
| 53 | + # Destination MAC : 02:00:00:00:00:07 (our MAC) |
| 54 | + # Source MAC : 02:00:00:00:00:91 |
| 55 | + # Ethertype : 0x0800 (IPv4) |
| 56 | + # Frame length : 106 bytes |
| 57 | + # |
| 58 | + # IPv4 |
| 59 | + # Version / IHL : 4 / 5 |
| 60 | + # DSCP / ECN : 0x00 |
| 61 | + # Total Length : 0x005c (92 bytes) |
| 62 | + # Identification : 0x3a2f |
| 63 | + # Flags / Offset : 0x4000 (DF set) |
| 64 | + # TTL : 64 |
| 65 | + # Protocol : 1 (ICMP) |
| 66 | + # Header Checksum : 0xea10 |
| 67 | + # Source IP : 10.0.1.91 |
| 68 | + # Destination IP : 10.0.1.7 |
| 69 | + # |
| 70 | + # ICMPv4 |
| 71 | + # Type/Code : 8 / 0 (Echo Request) |
| 72 | + # Checksum : 0xd97d |
| 73 | + # Identifier : 0x0007 |
| 74 | + # Sequence : 0x000a |
| 75 | + # Payload : 64 bytes (timestamp + pattern) |
| 76 | + # |
| 77 | + # Summary: Echo request from host A to the stack; expect an echo reply. |
52 | 78 | b"\x02\x00\x00\x00\x00\x07\x02\x00\x00\x00\x00\x91\x08\x00\x45\x00" |
53 | 79 | b"\x00\x5c\x3a\x2f\x40\x00\x40\x01\xea\x10\x0a\x00\x01\x5b\x0a\x00" |
54 | 80 | b"\x01\x07\x08\x00\xd9\x7d\x00\x07\x00\x0a\x88\x9f\xba\x60\x00\x00" |
|
58 | 84 | b"\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", |
59 | 85 | ], |
60 | 86 | "_expected__frames_tx": [ |
| 87 | + # Ethernet II |
| 88 | + # Destination MAC : 02:00:00:00:00:91 |
| 89 | + # Source MAC : 02:00:00:00:00:07 |
| 90 | + # Ethertype : 0x0800 (IPv4) |
| 91 | + # Frame length : 106 bytes |
| 92 | + # |
| 93 | + # IPv4 |
| 94 | + # Version / IHL : 4 / 5 |
| 95 | + # DSCP / ECN : 0x00 |
| 96 | + # Total Length : 0x005c (92 bytes) |
| 97 | + # Identification : 0x0000 |
| 98 | + # Flags / Offset : 0x0000 |
| 99 | + # TTL : 64 |
| 100 | + # Protocol : 1 (ICMP) |
| 101 | + # Header Checksum : 0x6440 |
| 102 | + # Source IP : 10.0.1.7 |
| 103 | + # Destination IP : 10.0.1.91 |
| 104 | + # |
| 105 | + # ICMPv4 |
| 106 | + # Type/Code : 0 / 0 (Echo Reply) |
| 107 | + # Checksum : 0xe17d |
| 108 | + # Identifier : 0x0007 |
| 109 | + # Sequence : 0x000a |
| 110 | + # Payload : 64 bytes mirrored from request |
| 111 | + # |
| 112 | + # Summary: Echo reply to host A matching the request payload and identifiers. |
61 | 113 | b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x08\x00\x45\x00" |
62 | 114 | b"\x00\x5c\x00\x00\x00\x00\x40\x01\x64\x40\x0a\x00\x01\x07\x0a\x00" |
63 | 115 | b"\x01\x5b\x00\x00\xe1\x7d\x00\x07\x00\x0a\x88\x9f\xba\x60\x00\x00" |
64 | 116 | b"\x00\x00\x29\xad\x06\x00\x00\x00\x00\x00\x10\x11\x12\x13\x14\x15" |
65 | 117 | b"\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25" |
66 | 118 | b"\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35" |
67 | | - b"\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" |
| 119 | + b"\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f", |
68 | 120 | ], |
69 | 121 | "_expected__packet_stats_rx": PacketStatsRx( |
70 | 122 | ethernet__pre_parse=1, |
|
0 commit comments