15
0
forked from pool/python-dpkt
Files
python-dpkt/skip-BE-tests.patch

64 lines
2.1 KiB
Diff

---
dpkt/loopback.py | 5 +++++
dpkt/pcapng.py | 7 +++++++
2 files changed, 12 insertions(+)
--- a/dpkt/loopback.py
+++ b/dpkt/loopback.py
@@ -3,6 +3,9 @@
"""Platform-dependent loopback header."""
from __future__ import absolute_import
+import sys
+from unittest import SkipTest
+
from . import dpkt
from . import ethernet
from . import ip
@@ -39,6 +42,8 @@ class Loopback(dpkt.Packet):
def test_ethernet_unpack():
+ if sys.byteorder == 'big':
+ raise SkipTest('This test is known to fail on big endian processors. gh#kbandla/dpkt#505')
buf = b'\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x08\x00'
hdr = b'\x00\x02\x00\x02'
--- a/dpkt/pcapng.py
+++ b/dpkt/pcapng.py
@@ -9,6 +9,7 @@ from __future__ import absolute_import
from struct import pack as struct_pack, unpack as struct_unpack
from time import time
import sys
+from unittest import SkipTest
from . import dpkt
from .compat import BytesIO, intround
@@ -1118,6 +1119,8 @@ def test_idb_opt_err():
def test_custom_read_write():
"""Test a full pcapng file with 1 ICMP packet"""
+ if sys.byteorder == 'big':
+ raise SkipTest('This test is known to fail on big endian processors. gh#kbandla/dpkt#505')
buf = define_testdata().valid_pcapng
fobj = BytesIO(buf)
@@ -1162,6 +1165,8 @@ def test_custom_read_write():
def test_multi_idb_writer():
"""Test writing multiple interface description blocks into pcapng and read it"""
+ if sys.byteorder == 'big':
+ raise SkipTest('This test is known to fail on big endian processors. gh#kbandla/dpkt#505')
fobj = BytesIO()
shb, idb, epb = define_testdata().shb_idb_epb_le
@@ -1189,6 +1194,8 @@ def test_writer_validate_instance():
@pre_test
def test_writepkt_epb_ts():
"""writepkt should assign ts_high/low for epb if they are 0"""
+ if sys.byteorder == 'big':
+ raise SkipTest('This test is known to fail on big endian processors. gh#kbandla/dpkt#505')
global time
shb, idb, epb = define_testdata().shb_idb_epb_le
writer = Writer(fobj, shb=shb, idb=idb) # noqa