Replace version-based test gating with feature detection
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
- Ambito
- networking, testing
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:
- Defining a feature-detection API (how to probe for each capability).
- Converting all ~30 existing version checks to feature probes.
- 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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nmstate/nmstate
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 4 giorni
-
apply fails with ipv6.dns: this property is not allowed for 'method=disabled' when the active profile stores an IPv6 DNS serverForse già presa @NopeCharon l’ha presa 5 giorni fa. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 55/100
nmstate/nmstate#3251 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
nmstate/nmstate#3242 · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
-
Possible allocator mismatch: Go binding frees its own C.CString buffers with nmstate_cstring_free (CString::from_raw)Forse già presa @cvas22 l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
nmstate/nmstate#3241 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di nmstate/nmstate
Issue simili
-
Add a just recipe that runs the workflow linters locallyForse già presa @sgamelin l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
good first issue security
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Status bar: a progress line that keeps the same text (import at 0%) ages out after 8 s and blinksApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
transit-audio/transit#216 ·
-
area: effects devices enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
suhina-daw/suhina-daw#1060 ·
I maintainer di solito rispondono entro 1 giorno