10 Commits

Author SHA1 Message Date
Vishvananda Abrams
1e35ba25dc test: Improve test reliability with proper cleanup and isolation
Refactors test setup and teardown logic to use `t.Cleanup` instead
of `defer`. This ensures that cleanup functions are correctly scoped
to each subtest's lifecycle, improving test isolation and reliability.

The `setUpNetlinkTest` helper function is also improved to correctly
save and restore the original network namespace, ensuring that tests
do not leak state.

To support this, a `Close()` method that returns an error is added to
the `Handle` struct, allowing for proper cleanup of underlying netlink
sockets. The test helpers are updated to use this new method,
preventing resource leaks between tests.

Additionally, a bug in the `netns` tests is fixed where a large
namespace ID could overflow a 32-bit integer, causing spurious
failures on some systems.
2025-08-27 09:24:17 -07:00
Benjamin Leggett
1f4f72c917 Mimic ipset C code for determining correct default ipset revision
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
2025-05-09 11:39:54 -07:00
major1201
7350a0539f Support ipset test entry existence 2023-04-20 10:46:28 -07:00
Evgeniy Zakharochkin
e0988fd129 Fix adding ipset entry comment 2022-12-12 09:07:43 -08:00
Damien Tournoud
8715fe718d ipset: Expose MaxElements to IpsetCreate 2022-09-15 11:54:47 -07:00
Damien Tournoud
d44b87fd4d ipset: Add support for IPv6 2022-08-12 20:31:58 +02:00
Damien Tournoud
836d892b17 Add IpsetSwap() 2022-06-21 10:43:08 -07:00
Zack Liu
fc21756312 Make IPSet actually support hash set types 2021-09-18 10:50:26 -07:00
Anonymous
3b8f3fd48d Make IPSet actually support IPs, and fix protocol errors for newer kernels 2021-03-27 13:25:07 -07:00
Julian Kornberger
1e3d26b1b3 Add support for ipset 2020-09-24 21:36:22 -04:00