diff --git a/Makefile b/Makefile index 203451e..8aebacb 100644 --- a/Makefile +++ b/Makefile @@ -349,8 +349,9 @@ test-ci: ## Test if all containers start up docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml build docker-compose -f $(DOCKERCOMPOSE_FILE) up -d docker-compose -f $(DOCKERCOMPOSE_FILE) ps - docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml run test || (docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml down -v; exit 1) + docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml run test || (docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml ps; exit 1) docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml stop 2>/dev/null + docker ps --filter name=kopano_test* -aq | xargs docker rm -f test-security: ## Scan containers with Trivy for known security risks (not part of CI workflow for now). cat $(TAG_FILE) | xargs -I % sh -c 'trivy --exit-code 0 --severity HIGH --quiet --auto-refresh %' diff --git a/tests/startup-test/Dockerfile b/tests/startup-test/Dockerfile index db1b6f0..d3baf73 100644 --- a/tests/startup-test/Dockerfile +++ b/tests/startup-test/Dockerfile @@ -1,10 +1,5 @@ -FROM alpine:3.9 - -ENV DOCKERIZE_VERSION v0.6.1 - -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz +ARG docker_repo=zokradonh +FROM ${docker_repo}/kopano_scheduler COPY test.sh /start.sh diff --git a/tests/startup-test/test.sh b/tests/startup-test/test.sh index d691ea4..952c14b 100755 --- a/tests/startup-test/test.sh +++ b/tests/startup-test/test.sh @@ -1,7 +1,10 @@ -#!/bin/sh +#!/bin/bash + +set -ex + # waits for key events in various containers # e.g. kopano_server:236 signals succesful start of kopano-server process -exec dockerize \ +dockerize \ -wait file://var/run/kopano/grapi/notify.sock \ -wait file://var/run/kopano/server.sock \ -wait http://kopano_konnect:8777/.well-known/openid-configuration \ @@ -17,3 +20,8 @@ exec dockerize \ -wait tcp://kopano_webapp:9080 \ -wait tcp://kopano_zpush:80 \ -timeout 120s + +#docker exec kopano_server kopano-cli --sync +docker exec kopano_server kopano-admin -l +docker exec kopano_zpush z-push-admin -a list +docker exec kopano_zpush z-push-gabsync -a sync diff --git a/tests/test-container.yml b/tests/test-container.yml index 4db62eb..a1db920 100644 --- a/tests/test-container.yml +++ b/tests/test-container.yml @@ -4,6 +4,8 @@ services: test: build: context: tests/startup-test + args: + docker_repo: ${docker_repo:-zokradonh} networks: - kopano-net - ldap-net @@ -12,5 +14,6 @@ services: - kopanodata/:/kopano/data - kopanossl/:/kopano/ssl - kopanosocket/:/run/kopano + - /var/run/docker.sock:/var/run/docker.sock:ro environment: - KCCONF_SERVER_MYSQL_HOST=${MYSQL_HOST}