Hello community,
here is the log from the commit of package python-ethtool for openSUSE:Factory checked in at 2019-03-01 16:49:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ethtool (Old)
and /work/SRC/openSUSE:Factory/.python-ethtool.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ethtool"
Fri Mar 1 16:49:51 2019 rev:5 rq:680454 version:0.14
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ethtool/python-ethtool.changes 2017-11-03 16:26:26.120749097 +0100
+++ /work/SRC/openSUSE:Factory/.python-ethtool.new.28833/python-ethtool.changes 2019-03-01 16:49:54.797742754 +0100
@@ -1,0 +2,11 @@
+Fri Mar 1 10:55:25 UTC 2019 - Tomáš Chvátal
+
+- Update to 0.14:
+ * Declared project as bugfix only from now on
+ * Support Python 3.7
+ * Fix important issues reported by static analysis
+ * Fix installation on non-UTF-8 locales on Python 3.5 and 3.6
+ * Added set_gso(), get_gro() and set_gro() functions
+ * Added installation instructions
+
+-------------------------------------------------------------------
Old:
----
ethtool-0.13.tar.gz
New:
----
ethtool-0.14.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ethtool.spec ++++++
--- /var/tmp/diff_new_pack.FgnL88/_old 2019-03-01 16:49:55.193742605 +0100
+++ /var/tmp/diff_new_pack.FgnL88/_new 2019-03-01 16:49:55.197742604 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,27 +12,28 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global pypi_name ethtool
-
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-%{pypi_name}
-Version: 0.13
+Version: 0.14
Release: 0
Summary: Ethernet settings Python bindings
-License: GPL-2.0
+License: GPL-2.0-only
Group: Development/Languages/Python
-Url: https://github.com/fedora-python/%{name}
+URL: https://github.com/fedora-python/%{name}
Source: https://files.pythonhosted.org/packages/source/e/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
+BuildRequires: fdupes
BuildRequires: libnl3-devel
+# needs ifconfig for tests (to check feature parity)
+BuildRequires: net-tools-deprecated
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%python_subpackages
%description
@@ -44,21 +45,23 @@
%setup -q -n %{pypi_name}-%{version}
%build
-export LANG=C.UTF-8
export CFLAGS="%{optflags}"
%python_build
%install
-export LANG=C.UTF-8
%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitearch}
-mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_mandir}/man8
+mkdir -p %{buildroot}%{_sbindir}
mv %{buildroot}{%{_bindir},%{_sbindir}}/pifconfig
mv %{buildroot}{%{_bindir},%{_sbindir}}/pethtool
+%check
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m unittest discover -v
+
%files %{python_files}
-%defattr(-,root,root)
-%doc README.rst CHANGES.rst COPYING
+%license COPYING
+%doc README.rst CHANGES.rst
%{python_sitearch}/
%python3_only %{_sbindir}/pethtool
%python3_only %{_sbindir}/pifconfig
++++++ ethtool-0.13.tar.gz -> ethtool-0.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/CHANGES.rst new/ethtool-0.14/CHANGES.rst
--- old/ethtool-0.13/CHANGES.rst 2017-06-13 17:21:13.000000000 +0200
+++ new/ethtool-0.14/CHANGES.rst 2018-09-13 11:16:52.000000000 +0200
@@ -1,6 +1,17 @@
Changelog
=========
+0.14
+----
+Wed Sep 12 2018 Miro Hrončok
+
+- Declared project as bugfix only from now on
+- Support Python 3.7
+- Fix important issues reported by static analysis
+- Fix installation on non-UTF-8 locales on Python 3.5 and 3.6
+- Added set_gso(), get_gro() and set_gro() functions
+- Added installation instructions
+
0.13
----
Tue Jun 13 2017 Miro Hrončok
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/PKG-INFO new/ethtool-0.14/PKG-INFO
--- old/ethtool-0.13/PKG-INFO 2017-06-13 17:21:37.000000000 +0200
+++ new/ethtool-0.14/PKG-INFO 2018-09-13 11:19:03.000000000 +0200
@@ -1,21 +1,50 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: ethtool
-Version: 0.13
+Version: 0.14
Summary: Python module to interface with ethtool
Home-page: https://github.com/fedora-python/python-ethtool
-Author: Lumír Balhar, Miro Hrončok, Charalampos Stratakis, Sanqui
-Author-email: python-maint@redhat.com
+Author: Harald Hoyer, Arnaldo Carvalho de Melo, David Sommerseth
+Author-email: davids@redhat.com
+Maintainer: Lumír Balhar, Miro Hrončok, Charalampos Stratakis, Sanqui
+Maintainer-email: python-maint@redhat.com
License: GPL-2.0
Description: Python ethtool module
=====================
*Python bindings for the ethtool kernel interface*
- The Python ``ethtool`` module allows querying and changing of ethernet card settings,
- such as speed, port, autonegotiation, and PCI locations.
+ The Python ``ethtool`` module allows querying and partially controlling network
+ interfaces, driver, and hardware settings.
+
+ .. warning::
+ This is the new upstream for python-ethtool maintained by Fedora's
+ Python SIG. We ported it to Python 3 and only maintain it for the current
+ tools to keep working. **No new development is happening. This is a
+ deprecated package.** If you are considering to start using this, please
+ don't. We recommend `netifaces https://pypi.org/project/netifaces/`_ instead.
+
+ Installation
+ ------------
+
+ The easiest way to install ``ethtool`` is to use your distribution packages
+ repositories. For example:
+
+ **Fedora**: ``sudo dnf install python3-ethtool`` or ``sudo dnf install python2-ethtool``
+
+ **Ubuntu**: ``sudo apt install python-ethtool``
+
+ In order to install ``ethtool`` from source or PyPI install its dependencies first:
+
+ **Fedora**: ``sudo dnf install libnl3-devel gcc redhat-rpm-config python3-devel``
+
+ **Ubuntu**: ``sudo apt install python3 python3-setuptools libpython3.6-dev libnl-route-3-dev``
+
+ And then install ``ethtool``:
+
+ **from PyPI**: ``pip3 install ethtool``
+
+ **from source**: ``python3 setup.py install``
- **This is the new upstream for python-ethtool maintained by Fedora's
- Python SIG.**
Usage
-----
@@ -112,6 +141,17 @@
Changelog
=========
+ 0.14
+ ----
+ Wed Sep 12 2018 Miro Hrončok
+
+ - Declared project as bugfix only from now on
+ - Support Python 3.7
+ - Fix important issues reported by static analysis
+ - Fix installation on non-UTF-8 locales on Python 3.5 and 3.6
+ - Added set_gso(), get_gro() and set_gro() functions
+ - Added installation instructions
+
0.13
----
Tue Jun 13 2017 Miro Hrončok
@@ -221,6 +261,7 @@
Keywords: network networking ethernet tool ethtool
Platform: UNKNOWN
+Classifier: Development Status :: 7 - Inactive
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
@@ -231,6 +272,7 @@
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/README.rst new/ethtool-0.14/README.rst
--- old/ethtool-0.13/README.rst 2017-05-30 12:26:02.000000000 +0200
+++ new/ethtool-0.14/README.rst 2018-09-12 15:38:50.000000000 +0200
@@ -3,11 +3,38 @@
*Python bindings for the ethtool kernel interface*
-The Python ``ethtool`` module allows querying and changing of ethernet card settings,
-such as speed, port, autonegotiation, and PCI locations.
+The Python ``ethtool`` module allows querying and partially controlling network
+interfaces, driver, and hardware settings.
+
+.. warning::
+ This is the new upstream for python-ethtool maintained by Fedora's
+ Python SIG. We ported it to Python 3 and only maintain it for the current
+ tools to keep working. **No new development is happening. This is a
+ deprecated package.** If you are considering to start using this, please
+ don't. We recommend `netifaces https://pypi.org/project/netifaces/`_ instead.
+
+Installation
+------------
+
+The easiest way to install ``ethtool`` is to use your distribution packages
+repositories. For example:
+
+**Fedora**: ``sudo dnf install python3-ethtool`` or ``sudo dnf install python2-ethtool``
+
+**Ubuntu**: ``sudo apt install python-ethtool``
+
+In order to install ``ethtool`` from source or PyPI install its dependencies first:
+
+**Fedora**: ``sudo dnf install libnl3-devel gcc redhat-rpm-config python3-devel``
+
+**Ubuntu**: ``sudo apt install python3 python3-setuptools libpython3.6-dev libnl-route-3-dev``
+
+And then install ``ethtool``:
+
+**from PyPI**: ``pip3 install ethtool``
+
+**from source**: ``python3 setup.py install``
-**This is the new upstream for python-ethtool maintained by Fedora's
-Python SIG.**
Usage
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/ethtool.egg-info/PKG-INFO new/ethtool-0.14/ethtool.egg-info/PKG-INFO
--- old/ethtool-0.13/ethtool.egg-info/PKG-INFO 2017-06-13 17:21:37.000000000 +0200
+++ new/ethtool-0.14/ethtool.egg-info/PKG-INFO 2018-09-13 11:19:02.000000000 +0200
@@ -1,21 +1,50 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: ethtool
-Version: 0.13
+Version: 0.14
Summary: Python module to interface with ethtool
Home-page: https://github.com/fedora-python/python-ethtool
-Author: Lumír Balhar, Miro Hrončok, Charalampos Stratakis, Sanqui
-Author-email: python-maint@redhat.com
+Author: Harald Hoyer, Arnaldo Carvalho de Melo, David Sommerseth
+Author-email: davids@redhat.com
+Maintainer: Lumír Balhar, Miro Hrončok, Charalampos Stratakis, Sanqui
+Maintainer-email: python-maint@redhat.com
License: GPL-2.0
Description: Python ethtool module
=====================
*Python bindings for the ethtool kernel interface*
- The Python ``ethtool`` module allows querying and changing of ethernet card settings,
- such as speed, port, autonegotiation, and PCI locations.
+ The Python ``ethtool`` module allows querying and partially controlling network
+ interfaces, driver, and hardware settings.
+
+ .. warning::
+ This is the new upstream for python-ethtool maintained by Fedora's
+ Python SIG. We ported it to Python 3 and only maintain it for the current
+ tools to keep working. **No new development is happening. This is a
+ deprecated package.** If you are considering to start using this, please
+ don't. We recommend `netifaces https://pypi.org/project/netifaces/`_ instead.
+
+ Installation
+ ------------
+
+ The easiest way to install ``ethtool`` is to use your distribution packages
+ repositories. For example:
+
+ **Fedora**: ``sudo dnf install python3-ethtool`` or ``sudo dnf install python2-ethtool``
+
+ **Ubuntu**: ``sudo apt install python-ethtool``
+
+ In order to install ``ethtool`` from source or PyPI install its dependencies first:
+
+ **Fedora**: ``sudo dnf install libnl3-devel gcc redhat-rpm-config python3-devel``
+
+ **Ubuntu**: ``sudo apt install python3 python3-setuptools libpython3.6-dev libnl-route-3-dev``
+
+ And then install ``ethtool``:
+
+ **from PyPI**: ``pip3 install ethtool``
+
+ **from source**: ``python3 setup.py install``
- **This is the new upstream for python-ethtool maintained by Fedora's
- Python SIG.**
Usage
-----
@@ -112,6 +141,17 @@
Changelog
=========
+ 0.14
+ ----
+ Wed Sep 12 2018 Miro Hrončok
+
+ - Declared project as bugfix only from now on
+ - Support Python 3.7
+ - Fix important issues reported by static analysis
+ - Fix installation on non-UTF-8 locales on Python 3.5 and 3.6
+ - Added set_gso(), get_gro() and set_gro() functions
+ - Added installation instructions
+
0.13
----
Tue Jun 13 2017 Miro Hrončok
@@ -221,6 +261,7 @@
Keywords: network networking ethernet tool ethtool
Platform: UNKNOWN
+Classifier: Development Status :: 7 - Inactive
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX :: Linux
@@ -231,6 +272,7 @@
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/python-ethtool/ethtool-copy.h new/ethtool-0.14/python-ethtool/ethtool-copy.h
--- old/ethtool-0.13/python-ethtool/ethtool-copy.h 2017-04-07 15:36:15.000000000 +0200
+++ new/ethtool-0.14/python-ethtool/ethtool-copy.h 2018-02-14 14:36:14.000000000 +0100
@@ -290,6 +290,8 @@
#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (e.v.) */
#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (e.v.) */
#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (e.v.) */
+#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (e.v.) */
+#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (e.v.) */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/python-ethtool/ethtool.c new/ethtool-0.14/python-ethtool/ethtool.c
--- old/ethtool-0.13/python-ethtool/ethtool.c 2017-04-12 13:38:36.000000000 +0200
+++ new/ethtool-0.14/python-ethtool/ethtool.c 2018-09-12 15:38:50.000000000 +0200
@@ -94,6 +94,7 @@
ret = fgets(buffer, 256, fd);
ret = fgets(buffer, 256, fd);
if (!ret) {
+ fclose(fd);
return PyErr_SetFromErrno(PyExc_OSError);
}
@@ -592,8 +593,7 @@
if (dev_set_int_value(ETHTOOL_STSO, args) < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *get_ufo(PyObject *self __unused, PyObject *args)
@@ -616,6 +616,32 @@
return Py_BuildValue("b", value);
}
+static PyObject *set_gso(PyObject *self __unused, PyObject *args)
+{
+ if (dev_set_int_value(ETHTOOL_SGSO, args) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *get_gro(PyObject *self __unused, PyObject *args)
+{
+ int value = 0;
+
+ if (get_dev_int_value(ETHTOOL_GGRO, args, &value) < 0)
+ return NULL;
+
+ return Py_BuildValue("b", value);
+}
+
+static PyObject *set_gro(PyObject *self __unused, PyObject *args)
+{
+ if (dev_set_int_value(ETHTOOL_SGRO, args) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
static PyObject *get_sg(PyObject *self __unused, PyObject *args)
{
int value = 0;
@@ -637,7 +663,8 @@
/* Setup our request structure. */
memset(&iwr, 0, sizeof(iwr));
- strncpy(iwr.ifr_name, devname, IFNAMSIZ);
+ strncpy(iwr.ifr_name, devname, IFNAMSIZ-1);
+ iwr.ifr_name[IFNAMSIZ-1] = 0;
/* Open control socket. */
fd = socket(AF_INET, SOCK_DGRAM, 0);
@@ -700,7 +727,7 @@
PyObject *dict = PyDict_New();
if (dict == NULL)
- goto out;
+ return NULL;
for (i = 0; i < nr_entries; ++i) {
struct struct_desc *d = &table[i];
@@ -713,21 +740,21 @@
break;
}
- if (objval == NULL)
- goto free_dict;
+ if (objval == NULL) {
+ Py_DECREF(dict);
+ return NULL;
+ }
if (PyDict_SetItemString(dict, d->name, objval) != 0) {
Py_DECREF(objval);
- goto free_dict;
+ Py_DECREF(dict);
+ return NULL;
}
Py_DECREF(objval);
}
-out:
+
return dict;
-free_dict:
- goto out;
- dict = NULL;
}
#define struct_desc_create_dict(table, values) \
@@ -796,8 +823,7 @@
if (send_command(ETHTOOL_SCOALESCE, devname, &coal))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
struct struct_desc ethtool_ringparam_desc[] = {
@@ -836,8 +862,7 @@
if (send_command(ETHTOOL_SRINGPARAM, devname, &ring))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static struct PyMethodDef PyEthModuleMethods[] = {
@@ -929,6 +954,21 @@
.ml_flags = METH_VARARGS,
},
{
+ .ml_name = "set_gso",
+ .ml_meth = (PyCFunction)set_gso,
+ .ml_flags = METH_VARARGS,
+ },
+ {
+ .ml_name = "get_gro",
+ .ml_meth = (PyCFunction)get_gro,
+ .ml_flags = METH_VARARGS,
+ },
+ {
+ .ml_name = "set_gro",
+ .ml_meth = (PyCFunction)set_gro,
+ .ml_flags = METH_VARARGS,
+ },
+ {
.ml_name = "get_sg",
.ml_meth = (PyCFunction)get_sg,
.ml_flags = METH_VARARGS,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/scripts/pethtool new/ethtool-0.14/scripts/pethtool
--- old/ethtool-0.13/scripts/pethtool 2017-04-12 13:38:36.000000000 +0200
+++ new/ethtool-0.14/scripts/pethtool 2018-02-14 14:36:14.000000000 +0100
@@ -211,10 +211,16 @@
except IOError:
gso = 'not supported'
+ try:
+ gro = ethtool.get_gro(interface) and 'on' or 'off'
+ except IOError:
+ gro = 'not supported'
+
printtab('scatter-gather: %s' % sg)
printtab('tcp segmentation offload: %s' % tso)
printtab('udp fragmentation offload: %s' % ufo)
printtab('generic segmentation offload: %s' % gso)
+ printtab('generic receive offload: %s' % gro)
def set_offload(interface, args):
@@ -226,6 +232,18 @@
ethtool.set_tso(interface, value)
except:
pass
+ elif cmd == 'gso':
+ value = value == 'on' and 1 or 0
+ try:
+ ethtool.set_gso(interface, value)
+ except:
+ pass
+ elif cmd == 'gro':
+ value = value == 'on' and 1 or 0
+ try:
+ ethtool.set_gro(interface, value)
+ except:
+ pass
ethtool_ringparam_msgs = (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/scripts/pifconfig new/ethtool-0.14/scripts/pifconfig
--- old/ethtool-0.13/scripts/pifconfig 2017-04-12 13:38:36.000000000 +0200
+++ new/ethtool-0.14/scripts/pifconfig 2018-02-14 14:36:14.000000000 +0100
@@ -63,7 +63,7 @@
ipaddr = ethtool.get_ipaddr(device)
netmask = ethtool.get_netmask(device)
flags = ethtool.get_flags(device)
- print('%-9.9s' % device)
+ print('%s' % device)
if not (flags & ethtool.IFF_LOOPBACK):
print('\tHWaddr %s' % ethtool.get_hwaddr(device))
print('\tinet addr:%s' % ipaddr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/setup.py new/ethtool-0.14/setup.py
--- old/ethtool-0.13/setup.py 2017-06-13 17:21:13.000000000 +0200
+++ new/ethtool-0.14/setup.py 2018-09-13 11:16:52.000000000 +0200
@@ -5,13 +5,14 @@
from setuptools import setup, Extension
import sys
+from io import open
try:
import commands
except ImportError:
import subprocess as commands
-version = '0.13'
+version = '0.14'
class PkgConfigExtension(Extension):
@@ -90,10 +91,10 @@
pass
-with open('README.rst') as f:
+with open('README.rst', encoding='utf-8') as f:
long_description = f.read()
-with open('CHANGES.rst') as f:
+with open('CHANGES.rst', encoding='utf-8') as f:
long_description += '\n\n'
long_description += f.read()
@@ -113,6 +114,7 @@
keywords='network networking ethernet tool ethtool',
classifiers=[
+ 'Development Status :: 7 - Inactive',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: POSIX :: Linux',
@@ -123,6 +125,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Networking',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/tests/parse_ifconfig.py new/ethtool-0.14/tests/parse_ifconfig.py
--- old/ethtool-0.13/tests/parse_ifconfig.py 2017-04-07 15:36:15.000000000 +0200
+++ new/ethtool-0.14/tests/parse_ifconfig.py 2018-09-12 15:38:50.000000000 +0200
@@ -113,6 +113,11 @@
curdev._parse_rest_of_first_line_old(mo.group(2))
continue
+ # If we don't have current device yet, doesn't make sense to
+ # read the rest of output lines
+ if curdev is None:
+ continue
+
if self.oldFormat:
curdev._parse_line_old(line)
else:
@@ -540,8 +545,6 @@
return
- raise ValueError('parser could not handle line: %r' % line)
-
# ifconfig = IfConfig()
# for dev in ifconfig.devices:
# print(dev)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/tests/test_ethtool.py new/ethtool-0.14/tests/test_ethtool.py
--- old/ethtool-0.13/tests/test_ethtool.py 2017-04-07 15:36:15.000000000 +0200
+++ new/ethtool-0.14/tests/test_ethtool.py 2018-09-12 15:38:50.000000000 +0200
@@ -121,6 +121,7 @@
if not ifconfig.oldFormat:
self.assertEqual(ethtool.get_flags(devname), scraped.flagsint)
self.assertIsInt(ethtool.get_gso(devname))
+ self.assertIsInt(ethtool.get_gro(devname))
self.assertIsString(ethtool.get_hwaddr(devname))
self.assertEqualHwAddr(ethtool.get_hwaddr(devname),
scraped.hwaddr)
@@ -144,7 +145,13 @@
'[Errno 95] Operation not supported')
self.assertIsInt(ethtool.get_sg(devname))
- self.assertIsInt(ethtool.get_ufo(devname))
+
+ try:
+ self.assertIsInt(ethtool.get_ufo(devname))
+ except (OSError, IOError):
+ # This test may fail due to insufficient privileges
+ # That's IOError on 2.7, OSError (PermissionError) on 3
+ pass
self.assertIsInt(ethtool.get_tso(devname))
@@ -154,6 +161,10 @@
# TODO: self.assertIsString(ethtool.set_tso(devname))
+ # TODO: self.assertIsString(ethtool.set_gso(devname))
+
+ # TODO: self.assertIsString(ethtool.set_gro(devname))
+
def _verify_etherinfo_object(self, ei):
self.assertTrue(isinstance(ei, ethtool.etherinfo))
self.assertIsString(ei.device)
@@ -196,14 +207,15 @@
# Verify sane handling of non-existant devices
get_fns = ('get_broadcast', 'get_businfo', 'get_coalesce', 'get_flags',
- 'get_gso', 'get_hwaddr', 'get_ipaddr', 'get_module',
- 'get_netmask', 'get_ringparam', 'get_sg', 'get_tso',
- 'get_ufo')
+ '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)
- set_fns = ('set_coalesce', 'set_ringparam', 'set_tso')
+ set_fns = ('set_coalesce', 'set_ringparam', 'set_tso', 'set_gso',
+ 'set_gro')
for fnname in set_fns:
# Currently this fails, with an IOError from
# ethtool.c:__struct_desc_from_dict
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-0.13/tests/test_scripts.py new/ethtool-0.14/tests/test_scripts.py
--- old/ethtool-0.13/tests/test_scripts.py 2017-04-12 17:11:52.000000000 +0200
+++ new/ethtool-0.14/tests/test_scripts.py 2018-09-12 15:38:50.000000000 +0200
@@ -72,12 +72,21 @@
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: on
+udp fragmentation offload: {expected_ufo}
generic segmentation offload: on
-'''
+generic receive offload: on
+'''.format(expected_ufo=expected_ufo)
)
# Tests for another device