message: Fix integration test cleanup
diff: @@ -74,9 +74,9 @@ function fail() {
  function cleanup() {
  status=$?
  - if (($DEBUG != 0)); then
  + if ((DEBUG != 1)); then
  docker-compose --project-name=integrationtest down
  - rm -r ${TMP_STATE_DIR}
  + rm -rf ${TMP_STATE_DIR} || echo "Failed to cleanup files at ${TMP_STATE_DIR}"
  fi
  return $status
  }
  @@ -84,14 +84,14 @@ function cleanup() {
  # Start a subprocess for trap
  (
  set -eu
  - (($DEBUG != 0)) && set -x
  -
  - # Make the certificate
  - source ../scripts/make_test_certificate.sh /tmp
  + ((DEBUG == 1)) && set -x
  # Ensure proper shut down on exit if not in debug mode
  trap "cleanup" EXIT
  + # Make the certificate
  + source ../scripts/make_test_certificate.sh /tmp
  +
  # Sets everything up
  export SB_API_PREFIX=TestApiPrefix
  SB_API_URL=https://shadowbox/${SB_API_PREFIX}
  @@ -105,11 +105,11 @@ function cleanup() {
  # Verify that the client cannot access or even resolve the target
  # Exit code 28 for "Connection timed out".
  - docker exec $CLIENT_CONTAINER curl --silent --connect-timeout 1 $TARGET_IP > /dev/null && \
  + docker exec $CLIENT_CONTAINER curl --silent --connect-timeout 5 $TARGET_IP > /dev/null && \
  fail "Client should not have access to target IP" || (($? == 28))
  # Exit code 6 for "Could not resolve host".
  - docker exec $CLIENT_CONTAINER curl --silent --connect-timeout 1 http://target > /dev/null && \
  + docker exec $CLIENT_CONTAINER curl --silent --connect-timeout 5 http://target > /dev/null && \
  fail "Client should not have access to target host" || (($? == 6))
  # Wait for shadowbox to come up.
  @@ -148,7 +148,7 @@ function cleanup() {
  # Verify we can't access the URL anymore after the key is deleted
  client_curl --insecure -X DELETE ${SB_API_URL}/access-keys/0 > /dev/null
  # Exit code 56 is "Connection reset by peer".
  - client_curl -x socks5h://localhost:$LOCAL_SOCKS_PORT --connect-timeout 1 $INTERNET_TARGET_URL &> /dev/null \
  + client_curl -x socks5h://localhost:$LOCAL_SOCKS_PORT --connect-timeout 5 $INTERNET_TARGET_URL &> /dev/null \
  && fail "Deleted access key is still active" || (($? == 56))
  # Verify that we can change the port for new access keys
  