- Add patch skip-BE-tests.patch skipping failing tests again

(gh#kbandla/dpkt#505).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dpkt?expand=0&rev=24
This commit is contained in:
2021-10-07 13:01:42 +00:00
committed by Git OBS Bridge
parent 2b8e17146f
commit f24fff9ddb
3 changed files with 69 additions and 7 deletions

View File

@@ -56,7 +56,8 @@ Thu Oct 7 10:42:16 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Remove redundant num_compression_methods from TLSClientHello
- Testing improved from 90% coverage to over 99%.
- Remove upstreamed patch fix_s390x_tests.patch
- Skip failing tests again (gh#kbandla/dpkt#505).
- Add patch skip-BE-tests.patch skipping failing tests again
(gh#kbandla/dpkt#505).
-------------------------------------------------------------------
Sun Jan 3 16:55:41 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

@@ -25,6 +25,9 @@ License: BSD-3-Clause
Group: Development/Libraries/Python
URL: https://github.com/kbandla/dpkt
Source: https://github.com/kbandla/dpkt/archive/v%{version}.tar.gz
# PATCH-FIX-UPSTREAM skip-BE-tests.patch gh#kbandla/dpkt#505 mcepl@suse.com
# Skip tests failing on BE architectures
Patch0: skip-BE-tests.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -51,12 +54,7 @@ sed -i -e '/addopts=/d' setup.cfg
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# Skipped because of gh#kbandla/dpkt#505
export SKIPTESTS=""
%ifarch s390x ppc64
export SKIPTESTS="not (test_ethernet_unpack or test_ethernet_unpack or test_writepkt_epb_ts or test_custom_read_write or test_multi_idb_writer)"
%endif
%pytest -k "${SKIPTESTS}" dpkt
%pytest dpkt
%files %{python_files}
%license LICENSE

63
skip-BE-tests.patch Normal file
View File

@@ -0,0 +1,63 @@
---
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