(t *testing.T)
| 20 | type NetworkIDSuite ValidDatasetTestSuite |
| 21 | |
| 22 | func TestNetworkID(t *testing.T) { |
| 23 | networkIDSuite := new(NetworkIDSuite) |
| 24 | |
| 25 | // set up file system interface |
| 26 | afs := afero.NewOsFs() |
| 27 | |
| 28 | cfg, err := config.ReadFileConfig(afs, ConfigPath) |
| 29 | require.NoError(t, err) |
| 30 | |
| 31 | cfg.Filtering.FilterExternalToInternal = false |
| 32 | |
| 33 | cfg.Env.DBConnection = dockerInfo.clickhouseConnection |
| 34 | require.NoError(t, err, "updating config should not return an error") |
| 35 | |
| 36 | // // import data |
| 37 | results, err := cmd.RunImportCmd(time.Now(), cfg, afs, "../test_data/dnscat2-ja3-strobe-agent", "dnscat2_ja3_strobe_agent", false, false) |
| 38 | require.NoError(t, err) |
| 39 | networkIDSuite.importResults = results |
| 40 | |
| 41 | // connect to database |
| 42 | db, err := database.ConnectToDB(context.Background(), "dnscat2_ja3_strobe_agent", cfg, nil) |
| 43 | require.NoError(t, err) |
| 44 | |
| 45 | // determine which max timestamp to use for relative time calculations |
| 46 | minTimestamp, maxTimestamp, _, err := db.GetBeaconMinMaxTimestamps() |
| 47 | require.NoError(t, err) |
| 48 | |
| 49 | networkIDSuite.maxTimestamp = maxTimestamp |
| 50 | networkIDSuite.minTimestamp = minTimestamp |
| 51 | |
| 52 | // networkIDSuite.useCurrentTime = useCurrentTime |
| 53 | networkIDSuite.db = db |
| 54 | networkIDSuite.cfg = cfg |
| 55 | suite.Run(t, networkIDSuite) |
| 56 | } |
| 57 | |
| 58 | func (it *NetworkIDSuite) TestNetworkIDSeparation() { |
| 59 | t := it.T() |
nothing calls this directly
no test coverage detected