mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-16 12:45:18 +03:00
33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
The test fails to connect to a go-audit socket.
|
|
|
|
diff --git a/client_test.go b/client_test.go
|
|
index 440fd23..97d252c 100644
|
|
--- a/client_test.go
|
|
+++ b/client_test.go
|
|
@@ -87,26 +87,6 @@ func TestNetlinkClient_SendReceive(t *testing.T) {
|
|
assert.Equal(t, "socket operation on non-socket", err.Error(), "Error was incorrect")
|
|
}
|
|
|
|
-func TestNewNetlinkClient(t *testing.T) {
|
|
- lb, elb := hookLogger()
|
|
- defer resetLogger()
|
|
-
|
|
- n, err := NewNetlinkClient(1024)
|
|
-
|
|
- assert.Nil(t, err)
|
|
- if n == nil {
|
|
- t.Fatal("Expected a netlink client but had an error instead!")
|
|
- } else {
|
|
- assert.True(t, (n.fd > 0), "No file descriptor")
|
|
- assert.True(t, (n.address != nil), "Address was nil")
|
|
- assert.Equal(t, uint32(0), n.seq, "Seq should start at 0")
|
|
- assert.True(t, MAX_AUDIT_MESSAGE_LENGTH >= len(n.buf), "Client buffer is too small")
|
|
-
|
|
- assert.Equal(t, "Socket receive buffer size: ", lb.String()[:28], "Expected some nice log lines")
|
|
- assert.Equal(t, "", elb.String(), "Did not expect any error messages")
|
|
- }
|
|
-}
|
|
-
|
|
// Helper to make a client listening on a unix socket
|
|
func makeNelinkClient(t *testing.T) *NetlinkClient {
|
|
os.Remove("go-audit.test.sock")
|