()
| 82 | type fofaTestcases struct{} |
| 83 | |
| 84 | func (h fofaTestcases) Execute() error { |
| 85 | token := os.Getenv("FOFA_API_KEY") |
| 86 | if token == "" { |
| 87 | return errors.New("missing fofa api key") |
| 88 | } |
| 89 | fofaToken := fmt.Sprintf(`fofa: [%s]`, token) |
| 90 | _ = os.WriteFile(ConfigFile, []byte(fofaToken), 0644) |
| 91 | defer func() { |
| 92 | _ = os.RemoveAll(ConfigFile) |
| 93 | }() |
| 94 | results, err := testutils.RunUncoverAndGetResults(debug, "-fofa", "'app=Grafana'") |
| 95 | if err != nil { |
| 96 | return err |
| 97 | } |
| 98 | return expectResultsGreaterThanCount(results, 0) |
| 99 | } |
| 100 | |
| 101 | // type hunterTestcases struct{} |
| 102 |
nothing calls this directly
no test coverage detected