Skip to content

Commit

Permalink
Correct several assertions in the NTP test
Browse files Browse the repository at this point in the history
Fixes:
```
>>> assert (pkt_1.precision.val == precision, pkt_1.precision.val)
Traceback (most recent call last):
  File "/usr/lib64/python3.11/codeop.py", line 153, in __call__
    return _maybe_compile(self.compiler, source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/codeop.py", line 73, in _maybe_compile
    return compiler(source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/codeop.py", line 118, in __call__
    codeob = compile(source, filename, symbol, self.flags, True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<input>", line 2
SyntaxError: assertion is always true, perhaps remove parentheses?
```
  • Loading branch information
evverx authored and gpotter2 committed Mar 26, 2023
1 parent 358f546 commit 6ed050e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/scapy/layers/ntp.uts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,11 +1128,11 @@ assert (isinstance(pkt_1.orig, RawVal)), type(pkt_1.orig)
assert (isinstance(pkt_1.sent, RawVal)), type(pkt_1.sent)
assert (isinstance(pkt_1.recv, RawVal)), type(pkt_1.recv)

assert (pkt_1.precision.val == precision, pkt_1.precision.val)
assert (pkt_1.dispersion.val == dispersion, pkt_1.dispersion.val)
assert (pkt_1.orig.val == time_stamp, pkt_1.orig.val)
assert (pkt_1.sent.val == time_stamp, pkt_1.sent.val)
assert (pkt_1.recv.val == time_stamp, pkt_1.recv.val)
assert pkt_1.precision.val == precision, pkt_1.precision.val
assert pkt_1.dispersion.val == dispersion, pkt_1.dispersion.val
assert pkt_1.orig.val == time_stamp, pkt_1.orig.val
assert pkt_1.sent.val == time_stamp, pkt_1.sent.val
assert pkt_1.recv.val == time_stamp, pkt_1.recv.val

time_stamp_hex = 0x00000000e67d6774
pkt_2 = NTP(
Expand Down

0 comments on commit 6ed050e

Please sign in to comment.