============================= test session starts ==============================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /build/python-ethtool/src/ethtool-0.15
collecting ... collected 15 items

tests/test_ethtool.py::EthtoolTests::test_etherinfo_objects PASSED       [  6%]
tests/test_ethtool.py::EthtoolTests::test_get_active_devices FAILED      [ 13%]
tests/test_ethtool.py::EthtoolTests::test_get_interface_info_active PASSED [ 20%]
tests/test_ethtool.py::EthtoolTests::test_get_interface_info_all PASSED  [ 26%]
tests/test_ethtool.py::EthtoolTests::test_get_interface_info_invalid PASSED [ 33%]
tests/test_ethtool.py::EthtoolTests::test_invalid_devices FAILED         [ 40%]
tests/test_scripts.py::ScriptsTests::test_driver_eth PASSED              [ 46%]
tests/test_scripts.py::ScriptsTests::test_driver_lo PASSED               [ 53%]
tests/test_scripts.py::ScriptsTests::test_flags2str PASSED               [ 60%]
tests/test_scripts.py::ScriptsTests::test_show_coalesce_eth FAILED       [ 66%]
tests/test_scripts.py::ScriptsTests::test_show_coalesce_lo PASSED        [ 73%]
tests/test_scripts.py::ScriptsTests::test_show_offload_eth PASSED        [ 80%]
tests/test_scripts.py::ScriptsTests::test_show_offload_lo FAILED         [ 86%]
tests/test_scripts.py::ScriptsTests::test_show_ring_eth FAILED           [ 93%]
tests/test_scripts.py::ScriptsTests::test_show_ring_lo PASSED            [100%]

=================================== FAILURES ===================================
_____________________ EthtoolTests.test_get_active_devices _____________________

self = <tests.test_ethtool.EthtoolTests testMethod=test_get_active_devices>
fn = <built-in function get_businfo>, args = ('lo',)
errmsg = '[Errno 95] Operation not supported'

    def assertRaisesIOError(self, fn, args, errmsg):
        """
        Verify that an IOError is raised, and that the errno and message are
        as expected
    
        (Python 2.6 and earlier's assertRaises doesn't allow us to check the
        details of the exception that is raised)
        """
        try:
>           fn(*args)
E           OSError: [Errno 38] Function not implemented

tests/test_ethtool.py:62: OSError

During handling of the above exception, another exception occurred:

self = <tests.test_ethtool.EthtoolTests testMethod=test_get_active_devices>

    def test_get_active_devices(self):
        for devname in ethtool.get_active_devices():
            # Skip these test on tun and wg devices
            if devname.startswith('tun') or devname.startswith('wg'):
                continue
>           self._functions_accepting_devnames(devname)

tests/test_ethtool.py:260: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_ethtool.py:115: in _functions_accepting_devnames
    self.assertIsStringExceptForLoopback(ethtool.get_businfo, devname,
tests/test_ethtool.py:75: in assertIsStringExceptForLoopback
    self.assertRaisesIOError(fn, (devname, ), errmsg)
tests/test_ethtool.py:66: in assertRaisesIOError
    self.assertEqual('[Errno {}] {}'.format(enum, emsg), errmsg)
E   AssertionError: '[Errno 38] Function not implemented' != '[Errno 95] Operation not supported'
E   - [Errno 38] Function not implemented
E   + [Errno 95] Operation not supported
______________________ EthtoolTests.test_invalid_devices _______________________

self = <tests.test_ethtool.EthtoolTests testMethod=test_invalid_devices>
fn = <built-in function get_businfo>, args = ('I am not a valid device name',)
errmsg = '[Errno 19] No such device'

    def assertRaisesIOError(self, fn, args, errmsg):
        """
        Verify that an IOError is raised, and that the errno and message are
        as expected
    
        (Python 2.6 and earlier's assertRaises doesn't allow us to check the
        details of the exception that is raised)
        """
        try:
>           fn(*args)
E           OSError: [Errno 38] Function not implemented

tests/test_ethtool.py:62: OSError

During handling of the above exception, another exception occurred:

self = <tests.test_ethtool.EthtoolTests testMethod=test_invalid_devices>

    def test_invalid_devices(self):
        # Verify sane handling of non-existant devices
    
        get_fns = ('get_broadcast', 'get_businfo', 'get_coalesce', 'get_flags',
                   'get_gso', 'get_gso', 'get_hwaddr', 'get_ipaddr',
                   'get_module', 'get_netmask', 'get_ringparam', 'get_sg',
                   'get_tso', 'get_ufo')
        for fnname in get_fns:
>           self.assertRaisesNoSuchDevice(getattr(ethtool, fnname),
                                          INVALID_DEVICE_NAME)

tests/test_ethtool.py:217: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_ethtool.py:71: in assertRaisesNoSuchDevice
    self.assertRaisesIOError(fn, args, '[Errno 19] No such device')
tests/test_ethtool.py:66: in assertRaisesIOError
    self.assertEqual('[Errno {}] {}'.format(enum, emsg), errmsg)
E   AssertionError: '[Errno 38] Function not implemented' != '[Errno 19] No such device'
E   - [Errno 38] Function not implemented
E   + [Errno 19] No such device
_____________________ ScriptsTests.test_show_coalesce_eth ______________________

self = <tests.test_scripts.ScriptsTests testMethod=test_show_coalesce_eth>

    @unittest.skipIf('TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true',
                     'Skipping this test on Travis CI because show '
                     'coalesce is not supported on ethernet device in VM.')
    def test_show_coalesce_eth(self):
        self.assertIsNone(peth.show_coalesce(device))
        expected_lines_start = ['Coalesce parameters for',
                                'Adaptive RX:',
                                'stats-block-usecs:',
                                'sample-interval:',
                                'pkt-rate-low:',
                                'pkt-rate-high:',
                                'rx-usecs:',
                                'rx-frames:',
                                'rx-usecs-irq:',
                                'rx-frames-irq:',
                                'tx-usecs:',
                                'tx-frames:',
                                'tx-usecs-irq:',
                                'tx-frames-irq:',
                                'rx-usecs-low:',
                                'rx-frame-low:',
                                'tx-usecs-low:',
                                'tx-frame-low:',
                                'rx-usecs-high:',
                                'rx-frame-high:',
                                'tx-usecs-high:',
                                'tx-frame-high:']
    
        lines = self._output().split('\n')
        for expected_start, line in zip(expected_lines_start, lines):
>           self.assertTrue(line.startswith(expected_start))
E           AssertionError: False is not true

tests/test_scripts.py:141: AssertionError
______________________ ScriptsTests.test_show_offload_lo _______________________

self = <tests.test_scripts.ScriptsTests testMethod=test_show_offload_lo>

        def test_show_offload_lo(self):
            self.assertIsNone(peth.show_offload(loopback))
    
            # Check if we have rights to obtain ufo and set proper expected output
            try:
                ethtool.get_ufo(loopback)
                expected_ufo = 'on'
            except (OSError, IOError):
                expected_ufo = 'not supported'
    
>           self.assertEqual(self._output(),
                             '''scatter-gather: on
    tcp segmentation offload: on
    udp fragmentation offload: {expected_ufo}
    generic segmentation offload: on
    generic receive offload: on
    '''.format(expected_ufo=expected_ufo)
                             )
E                            AssertionError: 'scatter-gather: not supported\ntcp segmentation offload: [138 chars]ed\n' != 'scatter-gather: on\ntcp segmentation offload: on\nudp fra[94 chars]on\n'
E                            - scatter-gather: not supported
E                            + scatter-gather: on
E                            - tcp segmentation offload: not supported
E                            ?                            ------------
E                            + tcp segmentation offload: on
E                            ?                           +
E                              udp fragmentation offload: not supported
E                            - generic segmentation offload: not supported
E                            ?                                ------------
E                            + generic segmentation offload: on
E                            ?                               +
E                            - generic receive offload: not supported
E                            ?                           ------------
E                            + generic receive offload: on
E                            ?                          +

tests/test_scripts.py:83: AssertionError
_______________________ ScriptsTests.test_show_ring_eth ________________________

self = <tests.test_scripts.ScriptsTests testMethod=test_show_ring_eth>

    def test_show_ring_eth(self):
        self.assertIsNone(peth.show_ring(device))
        expected_lines_start = ['Ring parameters for ',
                                'Pre-set maximums:', 'RX:', 'RX Mini:',
                                'RX Jumbo:', 'TX', 'Current hardware settings:',
                                'RX:', 'RX Mini:', 'RX Jumbo:', 'TX:']
        lines = self._output().split('\n')
        for expected_start, line in zip(expected_lines_start, lines):
>           self.assertTrue(line.startswith(expected_start))
E           AssertionError: False is not true

tests/test_scripts.py:109: AssertionError
=============================== warnings summary ===============================
tests/parse_ifconfig.py:36
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:36: DeprecationWarning: invalid escape sequence '\s'
    ws = '\s+'

tests/parse_ifconfig.py:39
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:39: DeprecationWarning: invalid escape sequence '\S'
    group_nonws = '(\S+)'

tests/parse_ifconfig.py:235
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:235: DeprecationWarning: invalid escape sequence '\w'
    m = re.match('Link encap:(\w+ ?\w*)\s*(HWaddr )?(\S*)', text)

tests/parse_ifconfig.py:280
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:280: DeprecationWarning: invalid escape sequence '\('
    + '\((.*)\)', line)

tests/parse_ifconfig.py:294
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:294: DeprecationWarning: invalid escape sequence '\('
    + '\((.*)\)', line)

tests/parse_ifconfig.py:307
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:307: DeprecationWarning: invalid escape sequence '\('
    + '\(.*\)',

tests/parse_ifconfig.py:334
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:334: DeprecationWarning: invalid escape sequence '\('
    + '\(.*\)',

tests/parse_ifconfig.py:512
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:512: DeprecationWarning: invalid escape sequence '\('
    m = re.match(ws + 'RX bytes:' + group_dec + ws + '\(.*\)' + ws

tests/parse_ifconfig.py:513
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:513: DeprecationWarning: invalid escape sequence '\('
    + 'TX bytes:' + group_dec + ws + '\(.*\)',

tests/parse_ifconfig.py:522
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:522: DeprecationWarning: invalid escape sequence '\s'
    m = re.match(ws + 'Interrupt:' + group_dec + '\s*(.*)', line)

tests/parse_ifconfig.py:528
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:528: DeprecationWarning: invalid escape sequence '\s'
    m = re.match('Base address:' + group_o_hex + '\s*(.*)', line)

tests/parse_ifconfig.py:534
  /build/python-ethtool/src/ethtool-0.15/tests/parse_ifconfig.py:534: DeprecationWarning: invalid escape sequence '\s'
    m = re.match('Memory:' + group_hex + '-' + group_hex + '\s*(.*)', line)

tests/test_scripts.py:6
  /build/python-ethtool/src/ethtool-0.15/tests/test_scripts.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    from imp import load_source

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_ethtool.py::EthtoolTests::test_get_active_devices - Asserti...
FAILED tests/test_ethtool.py::EthtoolTests::test_invalid_devices - AssertionE...
FAILED tests/test_scripts.py::ScriptsTests::test_show_coalesce_eth - Assertio...
FAILED tests/test_scripts.py::ScriptsTests::test_show_offload_lo - AssertionE...
FAILED tests/test_scripts.py::ScriptsTests::test_show_ring_eth - AssertionErr...
================== 5 failed, 10 passed, 13 warnings in 0.46s ===================
[1m[31m==> ERROR:[m[1m A failure occurred in check().[m
[1m    Aborting...[m
