MCPcopy Create free account
hub / github.com/activecm/rita / TestProxyRolling

Function TestProxyRolling

integration/proxy_rolling_test.go:21–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19type ProxyRollingTestSuite ValidDatasetTestSuite
20
21func TestProxyRolling(t *testing.T) {
22 proxyRollingSuite := new(ProxyRollingTestSuite)
23
24 // set up file system interface
25 afs := afero.NewOsFs()
26
27 cfg, err := config.ReadFileConfig(afs, ConfigPath)
28 require.NoError(t, err)
29
30 cfg.Env.DBConnection = dockerInfo.clickhouseConnection
31
32 require.True(t, cfg.Filtering.FilterExternalToInternal)
33
34 // // import data
35 results, err := cmd.RunImportCmd(time.Now(), cfg, afs, "../test_data/proxy_rolling", "proxy_rolling", false, true)
36 require.NoError(t, err)
37 proxyRollingSuite.importResults = results
38
39 // connect to database
40 db, err := database.ConnectToDB(context.Background(), "proxy_rolling", cfg, nil)
41 require.NoError(t, err)
42
43 // determine which max timestamp to use for relative time calculations
44 _, maxTimestamp, _, err := db.GetBeaconMinMaxTimestamps()
45 require.NoError(t, err)
46
47 proxyRollingSuite.maxTimestamp = maxTimestamp
48 // proxyRollingSuite.useCurrentTime = useCurrentTime
49 proxyRollingSuite.db = db
50 proxyRollingSuite.cfg = cfg
51 suite.Run(t, proxyRollingSuite)
52}
53
54func (it *ProxyRollingTestSuite) TestRollingThreats() {
55 t := it.T()

Callers

nothing calls this directly

Calls 4

ReadFileConfigFunction · 0.92
RunImportCmdFunction · 0.92
ConnectToDBFunction · 0.92

Tested by

no test coverage detected