mirror of
https://github.com/corundum/corundum.git
synced 2025-01-30 08:32:52 +08:00
Add frame length asserts to gigabit MAC testbench
This commit is contained in:
parent
d489468776
commit
08dd43defc
@ -320,6 +320,7 @@ def bench():
|
|||||||
print(hex(eth_frame.eth_fcs))
|
print(hex(eth_frame.eth_fcs))
|
||||||
print(hex(eth_frame.calc_fcs()))
|
print(hex(eth_frame.calc_fcs()))
|
||||||
|
|
||||||
|
assert len(eth_frame.payload.data) == 46
|
||||||
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
||||||
assert eth_frame.eth_dest_mac == test_frame.eth_dest_mac
|
assert eth_frame.eth_dest_mac == test_frame.eth_dest_mac
|
||||||
assert eth_frame.eth_src_mac == test_frame.eth_src_mac
|
assert eth_frame.eth_src_mac == test_frame.eth_src_mac
|
||||||
|
@ -196,6 +196,7 @@ def bench():
|
|||||||
print(hex(eth_frame.eth_fcs))
|
print(hex(eth_frame.eth_fcs))
|
||||||
print(hex(eth_frame.calc_fcs()))
|
print(hex(eth_frame.calc_fcs()))
|
||||||
|
|
||||||
|
assert len(eth_frame.payload.data) == max(payload_len, 46)
|
||||||
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
||||||
assert eth_frame.eth_dest_mac == test_frame.eth_dest_mac
|
assert eth_frame.eth_dest_mac == test_frame.eth_dest_mac
|
||||||
assert eth_frame.eth_src_mac == test_frame.eth_src_mac
|
assert eth_frame.eth_src_mac == test_frame.eth_src_mac
|
||||||
@ -248,6 +249,7 @@ def bench():
|
|||||||
print(hex(eth_frame.eth_fcs))
|
print(hex(eth_frame.eth_fcs))
|
||||||
print(hex(eth_frame.calc_fcs()))
|
print(hex(eth_frame.calc_fcs()))
|
||||||
|
|
||||||
|
assert len(eth_frame.payload.data) == max(payload_len, 46)
|
||||||
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
||||||
assert eth_frame.eth_dest_mac == test_frame1.eth_dest_mac
|
assert eth_frame.eth_dest_mac == test_frame1.eth_dest_mac
|
||||||
assert eth_frame.eth_src_mac == test_frame1.eth_src_mac
|
assert eth_frame.eth_src_mac == test_frame1.eth_src_mac
|
||||||
@ -264,6 +266,7 @@ def bench():
|
|||||||
print(hex(eth_frame.eth_fcs))
|
print(hex(eth_frame.eth_fcs))
|
||||||
print(hex(eth_frame.calc_fcs()))
|
print(hex(eth_frame.calc_fcs()))
|
||||||
|
|
||||||
|
assert len(eth_frame.payload.data) == max(payload_len, 46)
|
||||||
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
||||||
assert eth_frame.eth_dest_mac == test_frame2.eth_dest_mac
|
assert eth_frame.eth_dest_mac == test_frame2.eth_dest_mac
|
||||||
assert eth_frame.eth_src_mac == test_frame2.eth_src_mac
|
assert eth_frame.eth_src_mac == test_frame2.eth_src_mac
|
||||||
@ -324,6 +327,7 @@ def bench():
|
|||||||
print(hex(eth_frame.eth_fcs))
|
print(hex(eth_frame.eth_fcs))
|
||||||
print(hex(eth_frame.calc_fcs()))
|
print(hex(eth_frame.calc_fcs()))
|
||||||
|
|
||||||
|
assert len(eth_frame.payload.data) == max(payload_len, 46)
|
||||||
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
assert eth_frame.eth_fcs == eth_frame.calc_fcs()
|
||||||
assert eth_frame.eth_dest_mac == test_frame2.eth_dest_mac
|
assert eth_frame.eth_dest_mac == test_frame2.eth_dest_mac
|
||||||
assert eth_frame.eth_src_mac == test_frame2.eth_src_mac
|
assert eth_frame.eth_src_mac == test_frame2.eth_src_mac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user