diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | caronte.go | 2 | ||||
-rw-r--r-- | docker-compose.testing.yml | 6 | ||||
-rw-r--r-- | storage_test.go | 2 | ||||
-rwxr-xr-x | travis_tests.sh | 2 |
7 files changed, 21 insertions, 11 deletions
@@ -7,4 +7,4 @@ # Build file caronte - +coverage.txt
\ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 801a37f..1d66f6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,18 @@ services: before_script: - docker pull eciavatta/caronte-env + - docker pull mongo:4 - docker-compose -f docker-compose.testing.yml up -d --build -script: - - docker logs -f caronte_caronte_1 | grep "travis" | (read status; if $status -eq "travis_tests_fails"; then exit 1; fi) +script: >- + docker ps -a && + docker logs -f $(docker ps -a -q --filter="name=caronte_caronte") | grep "travis" | + (read status; if [[ $status == "travis_tests_fails" ]]; then exit 1; fi) + +after_success: + - docker cp "$(docker ps -a -q --filter='name=caronte_caronte'):/caronte/coverage.txt" coverage.txt + - bash <(curl -s https://codecov.io/bash) after_script: - - docker logs caronte_caronte_1 - - docker-compose down + - docker logs $(docker ps -a -q --filter="name=caronte_caronte") + - docker-compose -f docker-compose.testing.yml down @@ -1,5 +1,8 @@ # [WIP] Caronte +[![Build Status](https://travis-ci.com/eciavatta/caronte.svg?branch=develop)](https://travis-ci.com/eciavatta/caronte) +[![codecov](https://codecov.io/gh/eciavatta/caronte/branch/develop/graph/badge.svg)](https://codecov.io/gh/eciavatta/caronte) + <img align="left" src="https://divinacommedia.weebly.com/uploads/5/5/2/3/5523249/1299707879.jpg"> Caronte is a tool to analyze the network flow during capture the flag events of type attack/defence. It reassembles TCP packets captured in pcap files to rebuild TCP connections, and analyzes each connection to find user-defined patterns. @@ -4,7 +4,7 @@ import ( "fmt" ) -func mainn() { +func main() { // testStorage() storage := NewStorage("localhost", 27017, "testing") err := storage.Connect(nil) diff --git a/docker-compose.testing.yml b/docker-compose.testing.yml index 019628c..51997d6 100644 --- a/docker-compose.testing.yml +++ b/docker-compose.testing.yml @@ -4,7 +4,7 @@ services: mongo: image: mongo:4 networks: - - caronte-net + - acheronet restart: always caronte: @@ -17,11 +17,11 @@ services: depends_on: - mongo networks: - - caronte-net + - acheronet command: "./travis_tests.sh" environment: MONGO_HOST: mongo MONGO_PORT: 27017 networks: - caronte-net: + acheronet: diff --git a/storage_test.go b/storage_test.go index 32a10a6..6b36833 100644 --- a/storage_test.go +++ b/storage_test.go @@ -106,7 +106,7 @@ func TestMain(m *testing.M) { } mongoPort, ok := os.LookupEnv("MONGO_PORT") if !ok { - mongoHost = "27017" + mongoPort = "27017" } uniqueDatabaseName := sha256.Sum256([]byte(time.Now().String())) diff --git a/travis_tests.sh b/travis_tests.sh index cb4363c..5c51823 100755 --- a/travis_tests.sh +++ b/travis_tests.sh @@ -4,7 +4,7 @@ sleep 10 # run tests -go test -v +go test -v -race -coverprofile=coverage.txt -covermode=atomic RET_CODE=$? |