MCPcopy
hub / github.com/projectdiscovery/uncover / Execute

Method Execute

integration-tests/source-test.go:38–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36type shodanTestcases struct{}
37
38func (h shodanTestcases) Execute() error {
39 token := os.Getenv("SHODAN_API_KEY")
40 if token == "" {
41 return errors.New("missing shodan api key")
42 }
43 shodanToken := fmt.Sprintf(`shodan: [%s]`, token)
44 _ = os.WriteFile(ConfigFile, []byte(shodanToken), 0644)
45 defer func() {
46 _ = os.RemoveAll(ConfigFile)
47 }()
48 results, err := testutils.RunUncoverAndGetResults(debug, "-shodan", "'title:\"Grafana\"'")
49 if err != nil {
50 return err
51 }
52 err = expectResultsGreaterThanCount(results, 0)
53 if err != nil {
54 return err
55 }
56 results, err = testutils.RunUncoverAndGetResults(debug, "-shodan", "'org:\"Something, Inc.\"'")
57 if err != nil {
58 return err
59 }
60 return expectResultsGreaterThanCount(results, 1)
61}
62
63type zoomeyeTestcases struct{}
64

Callers

nothing calls this directly

Calls 2

RunUncoverAndGetResultsFunction · 0.92

Tested by

no test coverage detected