Compare commits

...

No commits in common. "imports/c8-beta/python-netifaces-0.10.6-4.el8" and "c8s" have entirely different histories.

7 changed files with 54 additions and 2 deletions

5
.gitignore vendored
View File

@ -1 +1,4 @@
SOURCES/netifaces-0.10.6.tar.gz
/netifaces-0.5.tar.gz
/netifaces-0.10.4.tar.gz
/netifaces-0.10.5.tar.gz
/netifaces-0.10.6.tar.gz

View File

@ -1 +0,0 @@
e318ebb83b9eba92e168cba2d9d7251b21bceb85 SOURCES/netifaces-0.10.6.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (netifaces-0.10.6.tar.gz) = 2c892062286007a8330c2cddc148ea21d1fd24aec32b5f25b8fe905933c651f8c532596f523f0bb7edb3a143e9a491ec49d60f75efad4407273ac2647b579b1e

30
tests/test_netifaces.py Normal file
View File

@ -0,0 +1,30 @@
import netifaces
import pytest
def test_interfaces():
ifaces = netifaces.interfaces()
assert isinstance(ifaces, list)
assert "lo" in ifaces
@pytest.mark.parametrize(
"iface,af,expected",
[
("lo", netifaces.AF_INET, "127.0.0.1"),
("lo", netifaces.AF_INET6, "::1"),
],
)
def test_ifaddresses_lo(iface, af, expected):
addrs = netifaces.ifaddresses(iface)
assert addrs[af][0]["addr"] == expected
def test_invalid():
with pytest.raises(ValueError):
netifaces.ifaddresses("invalid interface")
def test_gateways():
gw = netifaces.gateways()
assert "default" in gw

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
required_packages:
- python3-netifaces
- python3-pytest
tests:
- unittests:
dir: "."
run: pytest-3 test_netifaces.py