Use an interface for making tests and reporting test results
This commit is contained in:
parent
f48afca7e8
commit
5bbb306006
6 changed files with 174 additions and 82 deletions
20
cli/main.go
20
cli/main.go
|
|
@ -4,10 +4,15 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"github.com/nemunaire/eyespot/eyespot/cipherts"
|
||||
"github.com/nemunaire/eyespot/eyespot/protocolts"
|
||||
"github.com/nemunaire/eyespot"
|
||||
"github.com/nemunaire/eyespot/testsuite"
|
||||
)
|
||||
|
||||
var tests = []eyespot.Test{
|
||||
testsuite.Protocols{},
|
||||
testsuite.Ciphers{},
|
||||
}
|
||||
|
||||
func main() {
|
||||
var protocol = flag.String("protocol", "tcp", "Protocol to test")
|
||||
var hostname = flag.String("hostname", "localhost", "Hostname to test")
|
||||
|
|
@ -16,6 +21,13 @@ func main() {
|
|||
|
||||
host := fmt.Sprintf("%s:%d", *hostname, *port)
|
||||
|
||||
log.Println(protocolts.Run(*protocol, host))
|
||||
log.Println(cipherts.Run(*protocol, host))
|
||||
for _, t := range tests {
|
||||
log.Println(t.GetTestDescription())
|
||||
|
||||
if res, err := t.Run(*protocol, host); err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
log.Println(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue