From 8a5386db8bb8746cccb13397881c643437330e22 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 6 Dec 2018 14:21:48 +0100 Subject: [PATCH] Integration tests --- .circleci/config.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3de2796..8d73a5a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,11 +36,24 @@ jobs: docker pull adferrand/backuppc || true docker build --pull --cache-from adferrand/backuppc -t adferrand/backuppc . - run: - name: Test container + name: Test container (unit tests) command: | mkdir -p ./bin curl -fsSL https://goss.rocks/install | GOSS_DST=./bin sh GOSS_PATH=./bin/goss GOSS_SLEEP=1 GOSS_FILES_PATH=./tests ./bin/dgoss run -e LETSENCRYPT_STAGING=true adferrand/backuppc + - run: + name: Test container (integration tests) + command: | + docker run --name backuppc-integration --detach adferrand/backuppc + sleep 5 + status=`docker exec backuppc-integration su backuppc -c "/usr/local/BackupPC/bin/BackupPC_serverMesg status"` + pattern="Got reply:"" ok" + echo "Expect following reply => '$pattern'" + grep "$pattern" <(echo $status) + output=`curl http://backuppc:password@localhost:8080/BackupPC_Admin` + echo "Expect the backupp configuration page without errors" + grep "The servers PID is" <(echo $output) + docker rm -f backuppc-integration - run: name: Save container command: |