Fix log fetching

This commit is contained in:
MaxJa4 2023-08-22 21:25:34 +02:00
parent 2db707cc33
commit a64c6ab9e1

View File

@ -15,17 +15,15 @@ sleep 5
expect_running_containers "3" expect_running_containers "3"
dvb_logs=$(docker logs dropbox-backup-1 2>&1) dvb_logs=$(docker compose logs backup)
if $dvb_logs | grep "ERROR" if echo "$dvb_logs" | grep -q "ERROR"; then
then
fail "Backup failed, errors reported: $dvb_logs" fail "Backup failed, errors reported: $dvb_logs"
else else
pass "Backup succeeded, no errors reported." pass "Backup succeeded, no errors reported."
fi fi
dbx_logs=$(docker logs dropbox-openapi_mock-1 2>&1) dbx_logs=$(docker compose logs openapi_mock)
if $dbx_logs | grep "ERROR" if echo "$dbx_logs" | grep -q "ERROR"; then
then
fail "Backup failed, errors reported: $dvb_logs" fail "Backup failed, errors reported: $dvb_logs"
else else
pass "Backup succeeded, no errors reported." pass "Backup succeeded, no errors reported."
@ -39,9 +37,8 @@ sleep 5
docker compose exec backup backup docker compose exec backup backup
dvb_logs=$(docker logs dropbox-backup-1 2>&1) dvb_logs=$(docker compose logs backup)
if $dvb_logs | grep "Refusing to do so, please check your configuratio" if echo "$dvb_logs" | grep -q "Refusing to do so, please check your configuration"; then
then
pass "Remote backups have not been deleted." pass "Remote backups have not been deleted."
else else
fail "Remote backups would have been deleted: $dvb_logs" fail "Remote backups would have been deleted: $dvb_logs"