tests: disable netlink sockets tests by default

It causes random failures on restricted environments.
Use NETLINK_TESTS=1 to launch them.
This commit is contained in:
Gustavo Iñiguez Goia 2023-02-21 00:23:16 +01:00
parent 475ae98702
commit da4d834c15
Failed to generate hash of commit

View file

@ -67,6 +67,12 @@ func setupConnection(proto string, connChan chan *Connection) {
// We also need it if for any reason auditd or ebpf doesn't return the PID of the application.
// TODO: test all the cases described in the GetSocketInfo() description.
func TestNetlinkTCPQueries(t *testing.T) {
// netlink tests disabled by default, they cause random failures on restricted
// environments.
if os.Getenv("NETLINK_TESTS") == "" {
t.Skip("Skipping netlink tests. Use NETLINK_TESTS=1 to launch these tests.")
}
connChan := make(chan *Connection)
go setupConnection("tcp", connChan)
conn := <-connChan