Skip to content

Commit 2ff9079

Browse files
committed
code cleanup
1 parent f2d9cbc commit 2ff9079

File tree

1 file changed

+55
-3
lines changed

1 file changed

+55
-3
lines changed

pytcp/tests/integration/test__packet_handler__icmp4__rx.py

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030

3131
"""
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.
3333
34-
pytcp/tests/unit/test__packet_handler__icmp4__rx.py
34+
pytcp/tests/integration/test__packet_handler__icmp4__rx.py
3535
3636
ver 3.0.4
3737
"""
@@ -49,6 +49,32 @@
4949
{
5050
"_description": "Ethernet/IPv4/ICMPv4 Echo Request",
5151
"_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.
5278
b"\x02\x00\x00\x00\x00\x07\x02\x00\x00\x00\x00\x91\x08\x00\x45\x00"
5379
b"\x00\x5c\x3a\x2f\x40\x00\x40\x01\xea\x10\x0a\x00\x01\x5b\x0a\x00"
5480
b"\x01\x07\x08\x00\xd9\x7d\x00\x07\x00\x0a\x88\x9f\xba\x60\x00\x00"
@@ -58,13 +84,39 @@
5884
b"\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f",
5985
],
6086
"_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.
61113
b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x08\x00\x45\x00"
62114
b"\x00\x5c\x00\x00\x00\x00\x40\x01\x64\x40\x0a\x00\x01\x07\x0a\x00"
63115
b"\x01\x5b\x00\x00\xe1\x7d\x00\x07\x00\x0a\x88\x9f\xba\x60\x00\x00"
64116
b"\x00\x00\x29\xad\x06\x00\x00\x00\x00\x00\x10\x11\x12\x13\x14\x15"
65117
b"\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25"
66118
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",
68120
],
69121
"_expected__packet_stats_rx": PacketStatsRx(
70122
ethernet__pre_parse=1,

0 commit comments

Comments
 (0)