Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Replace version-based test gating with feature detection

Đang mở
#3,178 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ệ
Công nghệ
linux, python, rust
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:

  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.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nmstate/nmstate

Tất cả issue của nmstate/nmstate

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.