Replace version-based test gating with feature detection
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- networking, testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 396
- Fork
- 121
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nmstate/nmstate
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 4 ngày
-
apply fails with ipv6.dns: this property is not allowed for 'method=disabled' when the active profile stores an IPv6 DNS serverCó thể đã có người làm @NopeCharon đã nhận 5 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
nmstate/nmstate#3251 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
nmstate/nmstate#3242 · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Possible allocator mismatch: Go binding frees its own C.CString buffers with nmstate_cstring_free (CString::from_raw)Có thể đã có người làm @cvas22 đã nhận 7 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
nmstate/nmstate#3241 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của nmstate/nmstate
Issue tương tự
-
Add a just recipe that runs the workflow linters locallyCó thể đã có người làm @sgamelin đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
good first issue security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Status bar: a progress line that keeps the same text (import at 0%) ages out after 8 s and blinksĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
transit-audio/transit#216 ·
-
area: effects devices enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
suhina-daw/suhina-daw#1060 ·
Maintainer thường phản hồi trong vòng 1 ngày