helpsystems / pcapy

Pcapy is a Python extension module that interfaces with the libpcap packet capture library.
Other
383 stars 105 forks source link

0.11.5: test suite is failing #72

Open kloczek opened 2 years ago

kloczek commented 2 years ago

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

I found tests/pcapytests.py which looks lioke some unittest test suite however looks like it fails

+ cd pcapy-0.11.5
+ cd tests
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pcapy-0.11.5-2.fc35.x86_64//usr/lib64/python3.8/site-packages
+ /usr/bin/python3 pcapytests.py
testBPFFilter (__main__.TestPcapy)
#3 test offline BPFFilter ... pcapytests.py:61: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, pkt = r.next()
pcapytests.py:63: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  f = bpf.filter(pkt)
pcapytests.py:65: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, pkt = r.next()
ok
testClose (__main__.TestPcapy)
#7 Test the close method ... pcapytests.py:133: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, body = r.next()
ok
testContextManager (__main__.TestPcapy)
#8 Test the context manager support ... pcapytests.py:144: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, body = r.next()
ok
testEOFValue (__main__.TestPcapy)
#2 empty string is returned as packet body at end of file ... pcapytests.py:44: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, pkt = r.next()
pcapytests.py:46: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, pkt = r.next()
FAIL
testPacketDumper (__main__.TestPcapy)
#6 test that the dumper writes correct payload ... pcapytests.py:100: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, body = r.next()
pcapytests.py:103: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  dumper.dump(hdr, body)
pcapytests.py:105: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  hdr, body = r.next()
pcapytests.py:115: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  h1, b1 = r.next()
pcapytests.py:116: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  h2, b2 = r2.next()
pcapytests.py:119: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  h1, b1 = r.next()
pcapytests.py:120: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  h2, b2 = r2.next()
ok
testPacketHeaderRefCount (__main__.TestPcapy)
#1: when next() creates a pkthdr it makes one extra reference ... pcapytests.py:31: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  sys.getrefcount(r.next()[0]),
ok
test_get_bpf (__main__.TestPcapy) ... ok

======================================================================
FAIL: testEOFValue (__main__.TestPcapy)
#2 empty string is returned as packet body at end of file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pcapytests.py", line 52, in testEOFValue
    self.assertEqual(refNone, sys.getrefcount(None))
AssertionError: 6873 != 6871

----------------------------------------------------------------------
Ran 7 tests in 0.003s

FAILED (failures=1)
kloczek commented 1 year ago

gentle ping .. 🤔