From 77a1ebe17ea08b73c6413dc89a5f14ada2cd52fc Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Fri, 13 Sep 2024 11:29:59 -0300 Subject: [PATCH] Add gating.yml and gating tests. Signed-off-by: Rafael Guterres Jeffman --- gating.yaml | 7 +++++++ tests/test_ifaddr.py | 14 ++++++++++++++ tests/tests.yml | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 gating.yaml create mode 100644 tests/test_ifaddr.py create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..e512ce9 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +# recipients: abokovoy, frenaud, kaleem, ftrivino, rjeffman +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/test_ifaddr.py b/tests/test_ifaddr.py new file mode 100644 index 0000000..a70a4e0 --- /dev/null +++ b/tests/test_ifaddr.py @@ -0,0 +1,14 @@ +import pytest + +import ifaddr + + +def test_get_adapters(): + """Test 'get_adapters' against 'lo' interface.""" + lo_ips = [ + n.ip if not isinstance(n.ip, tuple) else n.ip[0] + for a in ifaddr.get_adapters() if a.name == "lo" + for n in a.ips + ] + assert "127.0.0.1" in lo_ips + assert "::1" in lo_ips diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..884d27d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-basic + required_packages: + - python-ifaddr + - python3-pytest + tests: + - unittests: + dir: "." + run: pytest-3 test_ifaddr.py