summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2019-02-02 15:37:45 -0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2019-02-02 15:42:21 -0800
commitd6bffad1ce3873c8ac86c664b90651cfbcfe4d01 (patch)
treea71e61c4b74a8a864e9ab60e4dd5e42e7cfea7c5 /dev-python/python-ethtool
parentdev-python/python-ethtool: fix duplicate keywords (diff)
downloadgentoo-d6bffad1ce3873c8ac86c664b90651cfbcfe4d01.tar.gz
gentoo-d6bffad1ce3873c8ac86c664b90651cfbcfe4d01.tar.bz2
gentoo-d6bffad1ce3873c8ac86c664b90651cfbcfe4d01.zip
dev-python/python-ethtool: add tests
Package-Manager: Portage-2.3.59, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-python/python-ethtool')
-rw-r--r--dev-python/python-ethtool/files/test-skip-wg-dev.patch29
-rw-r--r--dev-python/python-ethtool/python-ethtool-0.14.ebuild6
2 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/python-ethtool/files/test-skip-wg-dev.patch b/dev-python/python-ethtool/files/test-skip-wg-dev.patch
new file mode 100644
index 000000000000..435a81ae494d
--- /dev/null
+++ b/dev-python/python-ethtool/files/test-skip-wg-dev.patch
@@ -0,0 +1,29 @@
+From aa18c4a046ed2b508a87161f886e07c6d3716dd3 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Sat, 2 Feb 2019 14:00:52 -0800
+Subject: [PATCH] tests/test_ethtool.py: skip test_get_active_devices for wg
+
+wg is a wireguard interface and this test fails with
+OSError: [Errno 95] Operation not supported
+---
+ tests/test_ethtool.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_ethtool.py b/tests/test_ethtool.py
+index 6162cd3..0ff78b1 100755
+--- a/tests/test_ethtool.py
++++ b/tests/test_ethtool.py
+@@ -254,8 +254,8 @@ class EthtoolTests(unittest.TestCase):
+
+ def test_get_active_devices(self):
+ for devname in ethtool.get_active_devices():
+- # Skip these test on tun devices
+- if devname.startswith('tun'):
++ # Skip these test on tun and wg devices
++ if devname.startswith('tun') or devname.startswith('wg'):
+ continue
+ self._functions_accepting_devnames(devname)
+
+--
+2.20.1
+
diff --git a/dev-python/python-ethtool/python-ethtool-0.14.ebuild b/dev-python/python-ethtool/python-ethtool-0.14.ebuild
index 3fa5a7bf3715..508b2ec1fed8 100644
--- a/dev-python/python-ethtool/python-ethtool-0.14.ebuild
+++ b/dev-python/python-ethtool/python-ethtool-0.14.ebuild
@@ -21,3 +21,9 @@ KEYWORDS="~amd64"
DEPEND="dev-libs/libnl:3"
RDEPEND="${DEPEND}"
BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+PATCHES=( "${FILESDIR}"/test-skip-wg-dev.patch )
+
+python_test() {
+ esetup.py test || die "Tests failed with ${EPYTHON}"
+}