nuclei/v2/cmd/integration-test/dns.go

29 lines
585 B
Go
Raw Normal View History

2021-02-27 07:03:27 +00:00
package main
import (
"github.com/projectdiscovery/nuclei/v2/pkg/testutils"
2021-02-27 07:03:27 +00:00
)
var dnsTestCases = map[string]testutils.TestCase{
"dns/basic.yaml": &dnsBasic{},
}
type dnsBasic struct{}
2021-09-03 14:25:50 +00:00
// Execute executes a test case and returns an error if occurred
2021-02-27 07:03:27 +00:00
func (h *dnsBasic) Execute(filePath string) error {
var routerErr error
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "one.one.one.one", debug)
2021-02-27 07:03:27 +00:00
if err != nil {
return err
}
if routerErr != nil {
return routerErr
}
if len(results) != 1 {
return errIncorrectResultsCount(results)
}
return nil
}