Adjust CI tests

This commit is contained in:
cytopia
2022-03-23 11:26:50 +01:00
parent 176f48d063
commit 7041e6ef0a
3 changed files with 141 additions and 95 deletions

View File

@@ -23,76 +23,76 @@ FLAVOUR="${4}"
###
### Debug == 0
###
did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=0" )"
if ! run_fail "docker logs ${did} 2>&1 | grep 'Debug level'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
print_h2 "DEBUG_ENTRYPOINT=0"
if ! name="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=0" )"; then
exit 1
fi
if ! run_fail "docker logs ${name} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run_fail "docker logs ${did} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
if ! run_fail "docker logs ${name} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run_fail "docker logs ${did} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
echo "Failed"
exit 1
fi
docker_stop "${did}"
docker_stop "${name}"
###
### Debug == 1
###
did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=1" )"
if ! run "docker logs ${did} 2>&1 | grep 'Debug level: 1'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
print_h2 "DEBUG_ENTRYPOINT=1"
if ! name="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=1" )"; then
exit 1
fi
if ! run "docker logs ${name} 2>&1 | grep 'Debug level: 1'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run "docker logs ${did} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
if ! run "docker logs ${name} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run_fail "docker logs ${did} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
if ! run_fail "docker logs ${name} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
docker_stop "${did}"
docker_stop "${name}"
###
### Debug == 2
###
did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=2" )"
if ! run "docker logs ${did} 2>&1 | grep 'Debug level: 2'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
print_h2 "DEBUG_ENTRYPOINT=2"
if ! name="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "${ARCH}" "-e DEBUG_ENTRYPOINT=2" )"; then
exit 1
fi
if ! run "docker logs ${name} 2>&1 | grep 'Debug level: 2'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run "docker logs ${did} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
if ! run "docker logs ${name} 2>&1 | grep '\[INFO\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
if ! run_fail "docker logs ${did} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${did}" || true
docker_stop "${did}" || true
if ! run_fail "docker logs ${name} 2>&1 | grep -E '\[(ERR|\?\?\?)\]'"; then
docker_logs "${name}" || true
docker_stop "${name}" || true
echo "Failed"
exit 1
fi
docker_stop "${did}"
docker_stop "${name}"