Documentation
¶
Index ¶
- Constants
- func CheckSummaryForVulnerabilities(session *gexec.Session, expectedCount int)
- func CompareActualSarifOutputWithGoldenSummaryRegex(session *gexec.Session, goldenFileAbsPath string)
- func CompareActualWithGolden(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
- func CompareActualWithGoldenConfigOnlyRegex(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
- func CompareActualWithGoldenJSON(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
- func CompareActualWithGoldenJSONString(session *gexec.Session, golden string, isStdOut bool)
- func CompareActualWithGoldenSummaryRegex(session *gexec.Session, goldenFileAbsPath string, isJunitXML, isStdOut bool)
- func CompareActualWithGoldenXML(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
- func CompareActualWithGoldenYAML(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
- func CompareSummaryAndViolations(sessionEngineOutput, fileDataEngineOutput policy.EngineOutput)
- func ContainsDirScanErrorSubString(session *gexec.Session, errSubString string)
- func ContainsErrorSubString(session *gexec.Session, errSubString string)
- func DoesNotContainsErrorSubString(session *gexec.Session, errSubString string)
- func GetAbsoluteFilePathForSarif(resourcePath, filePath string) (string, error)
- func GetByteData(session *gexec.Session, goldenFileAbsPath string, isStdOut bool) ([]byte, []byte)
- func GetTerrascanBinaryPath() string
- func RunCommand(path string, outWriter, errWriter io.Writer, args ...string) *gexec.Session
- func RunCommandDir(path, workDir string, outWriter, errWriter io.Writer, args ...string) *gexec.Session
- func ValidateDirectoryExists(path string)
- func ValidateExitCode(session *gexec.Session, timeout, exitCode int)
Constants ¶
const ( // ExitCodeZero represents command exit code 0 ExitCodeZero = iota // ExitCodeOne represents command exit code 1 ExitCodeOne // ExitCodeThree represents command exit code 3 ExitCodeThree = iota + 1 // ExitCodeFour represents command exit code 4 ExitCodeFour // ExitCodeFive represents command exit code 5 ExitCodeFive )
Variables ¶
This section is empty.
Functions ¶
func CheckSummaryForVulnerabilities ¶
CheckSummaryForVulnerabilities is a helper function to check vulnerabilies exists
func CompareActualSarifOutputWithGoldenSummaryRegex ¶
func CompareActualSarifOutputWithGoldenSummaryRegex(session *gexec.Session, goldenFileAbsPath string)
CompareActualSarifOutputWithGoldenSummaryRegex compares actual string with contents of golden file passed as parameter ignores specified regex patterns from the actual and golden text
func CompareActualWithGolden ¶
CompareActualWithGolden compares actual string with contents of golden file path passed as parameter
func CompareActualWithGoldenConfigOnlyRegex ¶
func CompareActualWithGoldenConfigOnlyRegex(session *gexec.Session, goldenFileAbsPath string, isStdOut bool)
CompareActualWithGoldenConfigOnlyRegex compares actual string with contents of golden file path passed as parameter
func CompareActualWithGoldenJSON ¶
CompareActualWithGoldenJSON compares actual data with contents of golden file passed as parameter
func CompareActualWithGoldenJSONString ¶
CompareActualWithGoldenJSONString compares actual data with golden json string passed as parameter
func CompareActualWithGoldenSummaryRegex ¶
func CompareActualWithGoldenSummaryRegex(session *gexec.Session, goldenFileAbsPath string, isJunitXML, isStdOut bool)
CompareActualWithGoldenSummaryRegex compares actual string with contents of golden file passed as parameter ignores specified regex patterns from the actual and golden text
func CompareActualWithGoldenXML ¶
CompareActualWithGoldenXML compares actual data with contents of golden file passed as parameter
func CompareActualWithGoldenYAML ¶
CompareActualWithGoldenYAML compares actual data with contents of golden file passed as parameter
func CompareSummaryAndViolations ¶
func CompareSummaryAndViolations(sessionEngineOutput, fileDataEngineOutput policy.EngineOutput)
CompareSummaryAndViolations is a helper function to compare actual and expected, summary and violations
func ContainsDirScanErrorSubString ¶
ContainsDirScanErrorSubString will assert if dir error substring is part of scan output
func ContainsErrorSubString ¶
ContainsErrorSubString will assert if error string is part of error output
func DoesNotContainsErrorSubString ¶
DoesNotContainsErrorSubString will assert that a string is not part of the error output
func GetAbsoluteFilePathForSarif ¶
GetAbsoluteFilePathForSarif helper for sarif path
func GetByteData ¶
GetByteData is a helper function to get data in byte slice from session and golden file
func GetTerrascanBinaryPath ¶
func GetTerrascanBinaryPath() string
GetTerrascanBinaryPath returns the terrascan binary path
func RunCommand ¶
RunCommand will initialise the command to run and return session
func RunCommandDir ¶
func RunCommandDir(path, workDir string, outWriter, errWriter io.Writer, args ...string) *gexec.Session
RunCommandDir will initialise the command to run in a specific directory and return session
func ValidateDirectoryExists ¶
func ValidateDirectoryExists(path string)
ValidateDirectoryExists validates that a directory exists at the provided path
func ValidateExitCode ¶
ValidateExitCode validates the exit code of a gexec.Session
Types ¶
This section is empty.