Skip to content

Remove most of the iputils from tests #4342

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

Open
Michal-Leszczynski opened this issue Apr 3, 2025 · 0 comments
Open

Remove most of the iputils from tests #4342

Michal-Leszczynski opened this issue Apr 3, 2025 · 0 comments
Assignees
Labels
bug Something isn't working testing

Comments

@Michal-Leszczynski
Copy link
Collaborator

So basically, SM handles IPV6 poorly, as in most places it stores IP addresses in string format and compares them as strings as well.
Since IPV6 does not have a unique string representation, it creates issues.

And what are we doing when a test fails beacuse of mismatch in IPV6 string representation?
We alter the test to use required representation instead of fixing SM implementation...

Functions like:

// ToCanonicalIP replaces ":0:0" in IPv6 addresses with "::"
// ToCanonicalIP("192.168.0.1") -> "192.168.0.1"
// ToCanonicalIP("100:200:0:0:0:0:0:1") -> "100:200::1".
func ToCanonicalIP(host string) string {
	val := net.ParseIP(host)
	if val == nil {
		return host
	}
	return val.String()
}

// ExpandIP expands IPv6 addresses "::" to ":0:0..."
// ToCanonicalIP("192.168.0.1") -> "192.168.0.1"
// ToCanonicalIP("100:200:0:0:0:0:0:1") -> "100:200::1".
func ExpandIP(host string) string {
	if !strings.Contains(host, "::") {
		return host
	}
	expected := 7
	existing := strings.Count(host, ":") - 1
	return strings.Replace(host, "::", strings.Repeat(":0", expected-existing)+":", 1)
}

Needs to be removed from our tests so that we are not hiding problems with IPV6 handling.
Obviously, SM implementation needs to be updated to handle those cases correctly.

@Michal-Leszczynski Michal-Leszczynski added bug Something isn't working testing labels Apr 3, 2025
@Michal-Leszczynski Michal-Leszczynski self-assigned this Apr 3, 2025
Michal-Leszczynski added a commit that referenced this issue Apr 3, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 7, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 7, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 8, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 9, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 9, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 9, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 9, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 9, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 10, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 10, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 10, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 17, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 22, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Michal-Leszczynski added a commit that referenced this issue Apr 22, 2025
…d repair.Target

This commit tries to improve IPV6 handling by storing addr as netip.Addr instead of string.
It does so mainly for scyllaclient.Ring and repair.Target and it adjusts all other
required places in the code.

Ref #4342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

No branches or pull requests

1 participant