Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAllOnce ¶
func CheckAllOnce(logger zap.SugaredLogger, conf CheckerConfig) error
** * Do entire test process flow only once for all challenges. * Process flow means enumerating challs, executing tests, and write results on DB. **
Types ¶
type Challenge ¶
type Challenge struct { Name string `json:"name"` Id int `json:"id"` Default_success bool `json:"default"` Timeout float64 `json:"timeout"` Exploit_dir_name string Result TestResult }
** * Information of challenge. * Used to hold information to execute test. * @Name: challenge name * @Id: challenge ID * @Default_success: if test is not executed due to insufficient info, result becomes `Success` if this is true. * @Result: test result **
type CheckerConfig ¶
type CheckerConfig struct { Single bool `json:"single"` Parallel bool `json:"parallel"` ParallelNum uint `json:"pnum"` Timeout float64 `json:"timeout"` Infofile string `json:"infofile"` Nodb bool `json:"nodb"` ChallsDir string `json:"challs"` Interval uint `json:"interval"` Retries uint `json:"retries"` }
func ReadConf ¶
func ReadConf(filename string) (CheckerConfig, error)
func (*CheckerConfig) ResolveConflict ¶
func (ch *CheckerConfig) ResolveConflict()
func (*CheckerConfig) Validate ¶
func (ch *CheckerConfig) Validate()
type DbResult ¶
type DbResult struct { ChallId int `db:"challid"` Name string `db:"name"` Result TestResult `db:"result"` Timestamp time.Time `db:"timestamp"` }
** * Data schema of test result table. * Note that this is different from `Challenge` structure, which also contains test result. **
type Executer ¶
type Executer struct {
// contains filtered or unexported fields
}
** * Executer of test. * @path: path to challenge directory * @retry_max: maximum # of execution retry * @try_current: # of executed try **
type TestResult ¶
type TestResult int
** * Test result. **
const ( // Test is successful TestSuccess TestResult = iota // Test is not executed due to insufficient info, but defaults to Success TestSuccessWithoutExecution // Test didn't end before timeout TestTimeout // Test is not executed due to insufficient info, and falls into Failure TestNotExecuted // Test is failure TestFailure )
func (TestResult) String ¶
func (tr TestResult) String() string
func (TestResult) ToColor ¶
func (tr TestResult) ToColor() string
func (TestResult) ToMessage ¶
func (tr TestResult) ToMessage() string