Page MenuHomeFreeBSD

carp tests: Basic functionality test
ClosedPublic

Authored by kp on Apr 5 2020, 5:01 PM.
Tags
None
Referenced Files
F102447222: D24303.diff
Tue, Nov 12, 9:59 AM
Unknown Object (File)
Sun, Nov 10, 9:28 AM
Unknown Object (File)
Sun, Nov 3, 8:54 AM
Unknown Object (File)
Sat, Oct 19, 8:06 PM
Unknown Object (File)
Sep 30 2024, 5:30 PM
Unknown Object (File)
Sep 27 2024, 5:44 AM
Unknown Object (File)
Sep 25 2024, 1:35 AM
Unknown Object (File)
Sep 25 2024, 1:33 AM

Details

Summary

Set up three vnet jails, bridged together. Run carp between two of them.
Attempt to provoke locking / epoch issues.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30301
Build 28074: arc lint + arc unit

Event Timeline

Remove incorrect sponsorship lines.

LGTM, please see comment inline.

tests/sys/net/if_carp.sh
49

Would it be possible to prefix jail names with the the test name to reduce the possibility of jail name clashes?

This revision is now accepted and ready to land.Apr 6 2020, 10:45 AM
tests/sys/net/if_carp.sh
58

Maybe worth moving this test to netinet/, as it doesn't share any ipv4/ipv6 code?

Would it be possible to add IPv6 counterpart to this test, so both IPv4 and IPv6 control plane parts gets covered?

Generally looks good to me, especially if we just test locking. For genera-purpose testing would be good to test master election, failover, etc.

tests/sys/net/if_carp.sh
59

Shouldn't this have /32 mask? I am curios how it works for routing table with another IP from the same subnet with /29, if it works.

Would it be possible to add IPv6 counterpart to this test, so both IPv4 and IPv6 control plane parts gets covered?

That'll hopefully be pretty straightforward. I'll give that a try.

tests/sys/net/if_carp.sh
49

Possibly, but I'm not sure it'll help. Many of these tests mess with the host system routing table (by keeping epair interfaces in the host vnet, and assigning addresses). So we'd have to do more than just change the jail names.

We'd also want to do that manually (or at least deterministically), because debugging tests with random jail names is painful.

58

Yeah, that makes sense. I'd put it here because it's somewhat similar in nature to the bridge and epair tests, but that code does live in net/.
I'll update the test and move it.

59

I have no idea. I don't pretend to understand carp. I mostly transposed the test script I initially used to trigger the panics this test tries to provoke.
It might make sense to use a different subnet for the real IPs from the carp IP.

Move the test, add IPv6 test

This revision now requires review to proceed.Apr 6 2020, 5:39 PM
tests/sys/netinet/carp.sh
52 ↗(On Diff #70265)

Better to use RFC5737 addresses: 192.0.2.0/24

63 ↗(On Diff #70265)

Why the hard-coded sleep?

tests/sys/netinet/carp.sh
63 ↗(On Diff #70265)

That gives carp a bit of time to come up. Otherwise we risk trying to ping an address that's not there yet.

Fix IP addresses and general cleanup

tests/sys/netinet/carp.sh
63 ↗(On Diff #70265)

It's unnecessarily slow on fast systems, and could potentially cause false negatives on slow systems. Please change it to a polling loop.

tests/sys/net/if_carp.sh
49

Indeed, there are a bunch of tests that changes routing in the host system. Ideally we'd want to reduce the number of such tests or at least not increase it :-) I've changed a bunch of mine tests to use dual jail configuration to avoid changes in the host system and I plan to convert more.

I totally agree that random jail names complicates debugging a lot.
I'm proposing prefixing each jail with a test name, so they're unique and one can easily understand relationship between the jail name and pariticular test piece.

58

Thank you!
One note - my understanding is that we split af-specific tests into netinet/ and netinet6/ , so one can easily test for specific address family.

Replace 'sleep 3' by a polling loop for carp readiness

Wait until one of the two jails has become carp master

Waiting until one of them leaves INIT state is insufficient. There's a
transition period where both carp jails are in BACKUP state, and the carp
address is unreachable.

This revision is now accepted and ready to land.Apr 8 2020, 2:03 PM
This revision was automatically updated to reflect the committed changes.