Add gating definition for RHEL 9
Related: rhbz#1947473 Signed-off-by: Kaleemullah Siddiqui <ksiddiqu@redhat.com>
This commit is contained in:
parent
dd83215c46
commit
921a3a8837
|
@ -0,0 +1,7 @@
|
||||||
|
# recipients: abokovoy, frenaud, kaleem, ftrivino, fcami
|
||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-9
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue