forgedhallpass b55f59ec26 Show the command line for the integration/regression tests when the debug option is enabled.
* minor code cleanup and code duplication removal
2021-10-01 18:23:06 +03:00

29 lines
590 B
Go

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