refactor: nettests is now an internal package (#165)
I'm moving everything into internal packages since this ain't a library. While there, remove typo that was causing a build breakage.
This commit is contained in:
parent
fb2ca32004
commit
a58dff3050
15 changed files with 2 additions and 3 deletions
43
internal/nettests/http_invalid_request_line.go
Normal file
43
internal/nettests/http_invalid_request_line.go
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package nettests
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
// HTTPInvalidRequestLine test implementation
|
||||
type HTTPInvalidRequestLine struct {
|
||||
}
|
||||
|
||||
// Run starts the test
|
||||
func (h HTTPInvalidRequestLine) Run(ctl *Controller) error {
|
||||
builder, err := ctl.Session.NewExperimentBuilder(
|
||||
"http_invalid_request_line",
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ctl.Run(builder, []string{""})
|
||||
}
|
||||
|
||||
// HTTPInvalidRequestLineTestKeys for the test
|
||||
type HTTPInvalidRequestLineTestKeys struct {
|
||||
IsAnomaly bool `json:"-"`
|
||||
}
|
||||
|
||||
// GetTestKeys generates a summary for a test run
|
||||
func (h HTTPInvalidRequestLine) GetTestKeys(tk map[string]interface{}) (interface{}, error) {
|
||||
testKeys := HTTPInvalidRequestLineTestKeys{IsAnomaly: false}
|
||||
|
||||
tampering, ok := tk["tampering"].(bool)
|
||||
if !ok {
|
||||
return testKeys, errors.New("tampering is not bool")
|
||||
}
|
||||
testKeys.IsAnomaly = tampering
|
||||
|
||||
return testKeys, nil
|
||||
}
|
||||
|
||||
// LogSummary writes the summary to the standard output
|
||||
func (h HTTPInvalidRequestLine) LogSummary(s string) error {
|
||||
return nil
|
||||
}
|
||||
Loading…
Reference in a new issue