Add gating.yml and gating tests.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
Rafael Guterres Jeffman 2024-09-13 11:29:59 -03:00
parent cf06f3462c
commit 77a1ebe17e
3 changed files with 34 additions and 0 deletions

7
gating.yaml Normal file
View File

@ -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}

14
tests/test_ifaddr.py Normal file
View File

@ -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

13
tests/tests.yml Normal file
View File

@ -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