Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reliability of facts.hardware.NetworkDevices #1098

Merged
merged 4 commits into from
May 12, 2024

Commits on May 12, 2024

  1. facts/NetworkDevices: Fix network device name handling

    Network device names are allowed to contain most characters,
    except for `:`, `/`, and whitespace.
    
    Ref: https://elixir.bootlin.com/linux/v6.8.9/source/net/core/dev.c#L1047
    sudoBash418 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    659b61b View commit details
    Browse the repository at this point in the history
  2. facts/NetworkDevices: Fix incorrect MAC address extraction

    The previous regex was matching some IPv6 addresses.
    Adding a mandatory `ether ` prefix solves this.
    
    Also fixed the erroneous test cases.
    sudoBash418 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    1027487 View commit details
    Browse the repository at this point in the history
  3. facts/NetworkDevices: Improve IP address extraction

    Solves the following issues:
    - `ip`: missing IPv4 address when metric is present
    - both: missing IPv4 address when broadcast address is not present
    
    Additionally:
    - Regexes now use named groups for clarity
    - Minor reorganization and some type hints
    sudoBash418 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    f4f83a2 View commit details
    Browse the repository at this point in the history
  4. facts/NetworkDevices: Add additional test cases

    Based on an Arch Linux machine.
    
    Known issue: the current state parsing behavior is rather imprecise
    and is not consistent between `ip a` and `ifconfig -a`.
    For example, the `wlp6s0` interface in the `linux_ifconfig_multiple`
    test case should have a state of `DOWN`, not `UNKNOWN`.
    sudoBash418 committed May 12, 2024
    Configuration menu
    Copy the full SHA
    a1f073a View commit details
    Browse the repository at this point in the history