(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestRunGlobal_noExtension(t *testing.T) { |
| 94 | |
| 95 | // Create an expectedResults array |
| 96 | expectedResults := []plugin.ExpectedResult{ |
| 97 | {ResultType: "systemd_logs", NodeName: "global"}, |
| 98 | } |
| 99 | |
| 100 | withAggregator(t, expectedResults, func(aggr *aggregation.Aggregator, srv *authtest.Server) { |
| 101 | url, err := aggregation.GlobalResultURL(srv.URL, "systemd_logs") |
| 102 | if err != nil { |
| 103 | t.Fatalf("unexpected error getting global result url %v", err) |
| 104 | } |
| 105 | withTempDir(t, func(tmpdir string) { |
| 106 | os.WriteFile(filepath.Join(tmpdir, "systemd_logs"), []byte("{}"), 0755) |
| 107 | os.WriteFile(filepath.Join(tmpdir, "done"), []byte(filepath.Join(tmpdir, "systemd_logs")), 0755) |
| 108 | err := GatherResults(filepath.Join(tmpdir, "done"), url, srv.Client(), nil) |
| 109 | if err != nil { |
| 110 | t.Fatalf("Got error running agent: %v", err) |
| 111 | } |
| 112 | |
| 113 | ensureExists(t, filepath.Join(aggr.OutputDir, "systemd_logs", "results")) |
| 114 | }) |
| 115 | }) |
| 116 | } |
| 117 | |
| 118 | func TestRunGlobalCleanup(t *testing.T) { |
| 119 |
nothing calls this directly
no test coverage detected