Skip to content

Conversation

@lkleinax
Copy link
Contributor

@lkleinax lkleinax commented Jan 7, 2026

This pull request enhances the handling of tentative IPv6 addresses in the Linux IP feature, allowing for more flexible retrieval of IPs and improving test coverage. The main change is the addition of a check_tentative parameter to the get_ips method, which controls whether tentative addresses are filtered out. The tests have also been updated and expanded to verify both behaviors.

Feature enhancement

  • Added a check_tentative parameter to the get_ips method in linux.py, enabling callers to choose whether to exclude tentative IP addresses when retrieving IPs.
  • Updated the logic in get_ips to respect the new check_tentative parameter, so tentative addresses are only filtered when desired.

Test improvements

  • Added a new test test_get_ips_tentative to verify that tentative addresses are excluded by default and included when check_tentative=False.
  • Updated the existing test to check both behaviors (excluding and including tentative addresses) using the new parameter.

Copilot AI review requested due to automatic review settings January 7, 2026 17:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a check_tentative parameter to the get_ips method to allow optional filtering of tentative IP addresses, resolving issue #37. By default, tentative IPs are still filtered out (maintaining backward compatibility), but callers can now explicitly request to include them when needed.

Key changes:

  • Added check_tentative boolean parameter with a default value of True to the get_ips method
  • Modified the tentative IP filtering logic to be conditional based on the new parameter
  • Added comprehensive test coverage for both scenarios (with and without tentative IP filtering)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mfd_network_adapter/network_interface/feature/ip/linux.py Added check_tentative parameter to get_ips method and made tentative IP filtering conditional
tests/unit/test_mfd_network_adapter/test_network_interface/test_feature/test_ip/test_ip_linux.py Split existing test into two tests covering both tentative checking scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

super().__init__(connection=connection, interface=interface)

def get_ips(self) -> IPs:
def get_ips(self, check_tentative: bool = True) -> IPs:
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring for get_ips should be updated to document the new check_tentative parameter, including its purpose, type, default value, and behavior when set to True vs False.

Copilot uses AI. Check for mistakes.
@lkleinax lkleinax force-pushed the fix__Add_parameter_to_get_ips_to_avoid_checking_presence_of_tentative_if_needed branch 2 times, most recently from 6dad6c1 to f5e3984 Compare January 8, 2026 10:46
… if needed

Fixes intel#37
Signed-off-by: Łukasz Kleina <lukaszx.kleina@intel.com>
@lkleinax lkleinax force-pushed the fix__Add_parameter_to_get_ips_to_avoid_checking_presence_of_tentative_if_needed branch from f5e3984 to f0354aa Compare January 8, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants