Add unit tests and functional test in CI

* Unit tests Discover 90%

The NmapRun function needs a refacto to make it use adaptors instead of directly calling exec.Command, exec.Command.StdoutPipe, exec.Command.Start, bufio.Scanner.Scan and bufio.Scanner.Err
It makes me uncomfortable to push a test file that covers only 90%, but it's better than none, and the 10 missing %s are not very error-prone so it should be okay to delay this part a bit. For now it's more urgent to test as much of the code as possible

* Unit tests Helpers 100%

* Unit tests Loaders 100% - Attack 85%

Once again, the Attack functions are not as simple as the rest to unit test, so I will refacto all of this to use a CURL adaptor later, but for now the total is of 88.6% of coverage, which is good enough for something I spent 2 hours on

* Add testing to CI validation process

* CI now does functional testing with RTSPATT

* Change travis language to bash
This commit is contained in:
Brendan LE GLAUNEC
2017-09-29 19:22:31 +02:00
committed by Brendan Le Glaunec
parent be63c6a231
commit cb74761675
8 changed files with 1235 additions and 13 deletions
+2 -2
View File
@@ -190,7 +190,7 @@ func AttackCredentials(targets []Stream, credentials Credentials, timeout time.D
}
}
if found == 0 {
return targets, errors.New("No credentials found")
return targets, errors.New("no credentials found")
}
return targets, nil
@@ -225,7 +225,7 @@ func AttackRoute(targets []Stream, routes Routes, timeout time.Duration, log boo
}
}
if found == 0 {
return targets, errors.New("No routes found")
return targets, errors.New("no routes found")
}
return targets, nil