From 0e12adaf0ee1b32cfdef10a94834bf6968a1121f Mon Sep 17 00:00:00 2001 From: jzm369 Date: Thu, 18 Feb 2021 10:34:13 +0800 Subject: [PATCH] enable test and disable test_show_coalesce_eth in VM (cherry picked from commit 02d0f37634a94d76a7623c61f17d684afc89313c) --- disable-test_show_coalesce_eth-in-VM.patch | 27 ++++++++++++++++++++++ python-ethtool.spec | 17 +++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 disable-test_show_coalesce_eth-in-VM.patch diff --git a/disable-test_show_coalesce_eth-in-VM.patch b/disable-test_show_coalesce_eth-in-VM.patch new file mode 100644 index 0000000..e56c34b --- /dev/null +++ b/disable-test_show_coalesce_eth-in-VM.patch @@ -0,0 +1,27 @@ +From 868d740cd4033c87b1d00acd92eac231d98752a5 Mon Sep 17 00:00:00 2001 +From: hexiujun +Date: Thu, 12 Mar 2020 16:15:22 +0800 +Subject: [PATCH] disable test_show_coalesce_eth in VM + +--- + tests/test_scripts.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/tests/test_scripts.py b/tests/test_scripts.py +index 6db3aac..1d91203 100755 +--- a/tests/test_scripts.py ++++ b/tests/test_scripts.py +@@ -108,9 +108,7 @@ generic receive offload: on + for expected_start, line in zip(expected_lines_start, lines): + self.assertTrue(line.startswith(expected_start)) + +- @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.') ++ @unittest.skip('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', +-- +1.8.3.1 + diff --git a/python-ethtool.spec b/python-ethtool.spec index 29b6cd9..6ded3ee 100644 --- a/python-ethtool.spec +++ b/python-ethtool.spec @@ -1,15 +1,15 @@ -%bcond_with tests Name: python-ethtool Version: 0.14 -Release: 3 +Release: 5 Summary: Python bindings for the ethtool kernel interface License: GPLv2 URL: https://pypi.org/project/ethtool/ Source0: https://files.pythonhosted.org/packages/81/41/e6cb9026374771e3bdb4c0fe8ac0c51c693a14b4f72f26275da15f7a4d8b/ethtool-%{version}.tar.gz +Patch9000: disable-test_show_coalesce_eth-in-VM.patch BuildRequires: python2-devel python3-devel python2-setuptools -BuildRequires: gcc libnl3-devel python3-setuptools +BuildRequires: gcc libnl3-devel python3-setuptools net-tools %description Python bindings for the ethtool kernel interface. The Python ethtool @@ -41,7 +41,6 @@ driver, and hardware settings. rm -rf ethtool.egg-info cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %build %py2_build @@ -52,6 +51,8 @@ popd %install %py2_install +rm %{buildroot}%{_bindir}/pifconfig +rm %{buildroot}%{_bindir}/pethtool pushd %{py3dir} %py3_install @@ -64,7 +65,6 @@ install -d %{buildroot}%{_mandir}/man8/ install -p man/*.8.* %{buildroot}%{_mandir}/man8/ rm -rf tests/test_scripts.py -%if %{with tests} %check export PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} tests/parse_ifconfig.py -v @@ -75,7 +75,6 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} tests/parse_ifconfig.py -v %{__python3} -m unittest discover -v popd -%endif %files -n python2-ethtool %doc README.rst @@ -96,6 +95,12 @@ popd %doc %{_mandir}/man* %changelog +* Thu Feb 18 2021 jinzhimin - 0.14-5 +- enable test + +* Thu Feb 18 2021 jinzhimin - 0.14-4 +- disable test_show_coalesce_eth in VM + * Fri Aug 21 2020 fanjiachen - 0.14-3 - Type:rebuild - ID:NA -- Gitee