Skip to content
Snippets Groups Projects
Commit 658a7ec6 authored by Matevz Erzen's avatar Matevz Erzen
Browse files

Merge CI tests to Master

parent eef54a04
Branches
Tags
No related merge requests found
......@@ -6,4 +6,5 @@ dump.rdb
.git
.cache
.gitignore
.gitlab-ci.yml
\ No newline at end of file
.gitlab-ci.yml
test/
\ No newline at end of file
......@@ -15,7 +15,7 @@ stages:
build:
stage: build
script:
- docker build --no-cache -t $REGISTRY/medina/$SERVICE:$VERSION .
- docker build --no-cache -t $REGISTRY/medina/$SERVICE:$VERSION .
only:
- develop
- master
......@@ -23,7 +23,12 @@ build:
test:
stage: test
script:
- echo "not yet implemented"
- apk add bash
- docker stop $SERVICE || true && docker rm $SERVICE || true
- docker run --name $SERVICE -d $REGISTRY/medina/$SERVICE:$VERSION
- sleep 5
- bash test/test.sh
- docker stop $SERVICE && docker container rm $SERVICE
only:
- develop
- master
......
Copyright (C) 2021 XLAB d.o.o.
Use of this software allowed only to MEDINA partners for the purpose of research in the scope of MEDINA project, as specified in the MEDINA Consortium Agreement.
No commercial use allowed.
This program is distributed without any warranty.
\ No newline at end of file
......@@ -31,7 +31,7 @@ scheduler.cron(
'* * * * * ',
func=wazuh_evidence_collector.run_full_check,
args=[],
repeat=10,
repeat=None,
queue_name=constants['redis']['queue'],
use_local_timezone=False
)
......
#!/bin/bash
logs=$(docker logs $SERVICE 2>&1)
redis1="# oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo"
redis2="Ready to accept connections"
scheduler="Registering birth"
worker1="Worker rq:worker:"
worker2="Subscribing to channel rq:pubsub:"
worker3="Listening on "
if ! [[ $logs =~ $redis1 ]]
then
echo "Redis server not started" 1>&2
exit 1
fi
if ! [[ $logs =~ $redis2 ]]
then
echo "Redis server not started" 1>&2
exit 1
fi
if ! [[ $logs =~ $scheduler ]]
then
echo "Redis queue scheduler not started" 1>&2
exit 1
fi
if ! [[ $logs =~ $worker1 ]]
then
echo "Redis worker not started" 1>&2
exit 1
fi
if ! [[ $logs =~ $worker2 ]]
then
echo "Redis worker not started" 1>&2
exit 1
fi
if ! [[ $logs =~ $worker3 ]]
then
echo "Redis worker not started" 1>&2
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment