File tree Expand file tree Collapse file tree
x-pack/osquerybeat/internal/osqd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ func WithBinaryPath(binPath string) Option {
6565
6666func WithConfigRefresh (refreshInterval int ) Option {
6767 return func (q * OSQueryD ) {
68- q .extensionsTimeout = refreshInterval
68+ q .configRefreshInterval = refreshInterval
6969 }
7070}
7171
Original file line number Diff line number Diff line change 1+ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
2+ // or more contributor license agreements. Licensed under the Elastic License;
3+ // you may not use this file except in compliance with the Elastic License.
4+
5+ package osqd
6+
7+ import (
8+ "testing"
9+
10+ "github.com/google/go-cmp/cmp"
11+ )
12+
13+ func TestNew (t * testing.T ) {
14+
15+ socketPath := "/var/run/foobar"
16+
17+ extensionsTimeout := 5
18+ configurationRefreshIntervalSecs := 12
19+ configPluginName := "config_plugin_test"
20+ loggerPluginName := "logger_plugin_test"
21+
22+ osq := New (
23+ socketPath ,
24+ WithExtensionsTimeout (extensionsTimeout ),
25+ WithConfigRefresh (configurationRefreshIntervalSecs ),
26+ WithConfigPlugin (configPluginName ),
27+ WithLoggerPlugin (loggerPluginName ),
28+ )
29+
30+ diff := cmp .Diff (extensionsTimeout , osq .extensionsTimeout )
31+ if diff != "" {
32+ t .Error (diff )
33+ }
34+
35+ diff = cmp .Diff (configurationRefreshIntervalSecs , osq .configRefreshInterval )
36+ if diff != "" {
37+ t .Error (diff )
38+ }
39+ diff = cmp .Diff (configPluginName , osq .configPlugin )
40+ if diff != "" {
41+ t .Error (diff )
42+ }
43+
44+ diff = cmp .Diff (loggerPluginName , osq .loggerPlugin )
45+ if diff != "" {
46+ t .Error (diff )
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments