Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Replace version-based test gating with feature detection

Aperta
#3,178 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
linux, python, rust

Direzione di ricerca

Start in tests/integration/testlib/env.py and locate the version helpers nm_minor_version(), nm_libreswan_version_int(), and kernel_newer_than(), then inspect their roughly 30 uses across the integration tests. First establish how the tests currently probe and skip for each capability; the issue proposes, but does not specify, the feature-detection API. Done means replacing the version gates with reliable capability checks across the listed build environments.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Tests currently use nm_minor_version(), nm_libreswan_version_int(), and kernel_newer_than() (defined in tests/integration/testlib/env.py) to skip tests via @pytest.mark.skipif. These checks compare against hard-coded version thresholds — for example:

@pytest.mark.skipif(
    nm_minor_version() < 51,
    reason="IPVLAN is only supported by NetworkManager 1.51+",
)

There are ~30 such version-gated checks spread across the integration tests, covering three categories:

Check Usage sites Example
nm_minor_version() ~15 sites (ipvlan, vlan, dns, bridge, hsr, gen_conf, etc.) nm_minor_version() < 51
nm_libreswan_version_int() ~11 sites (ipsec_test.py) < version_str_to_int("1.2.22")
kernel_newer_than() ~3 sites (ethtool, hsr) kernel_newer_than(6, 19)

The version is obtained by querying the RPM (rpm -q NetworkManager --qf %{VERSION}), which means:

  • It relies on RPM packaging being present (won't work for source builds).
  • A downstream backport build may carry a lower version number but include the feature.
  • A custom or pre-release build (e.g., 1.58~rc1) may or may not include the feature.

Proposal

Instead of checking version numbers, the test runner should probe for the actual capability. For example, rather than nm_minor_version() < 51 to gate IPVLAN tests, the runner could check whether NM reports IPVLAN as a supported device type (e.g., via D-Bus introspection, nmcli output, or attempting a minimal config and checking the error).

Each test or test group would declare the NM/nmstate/kernel features it requires, and the runner would verify those features are available before executing.

Scope

This requires:

  1. Defining a feature-detection API (how to probe for each capability).
  2. Converting all ~30 existing version checks to feature probes.
  3. Ensuring the detection mechanism itself is reliable across RPM-built, source-built, and containerized environments.

This initial investigation and report was created by Claude on behalf of Rahul Rajesh.

Lingua principale
Rust
Stelle
396
Fork
121
Merge medio
3g 11h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nmstate/nmstate

Tutte le issue di nmstate/nmstate

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.