message: Test key deletion
diff: @@ -112,12 +112,12 @@ function remove_color() {
  # Create new shadowbox user.
  # TODO(bemasc): Verify that the server is using the right certificate
  declare -r NEW_USER_JSON=$(client_curl --insecure -X POST https://shadowbox/${SB_API_PREFIX}/access-keys)
  - [[ ${NEW_USER_JSON} == '{"id":'* ]] || fail "Fail to create user"
  + [[ ${NEW_USER_JSON} == '{"id":"0"'* ]] || fail "Fail to create user"
  declare -r SS_USER_ARGUMENTS=$(ss_arguments_for_user $NEW_USER_JSON)
  # Verify that we handle deletions well
  client_curl --insecure -X POST https://shadowbox/${SB_API_PREFIX}/access-keys > /dev/null
  - client_curl --insecure -X DELETE https://shadowbox/${SB_API_PREFIX}/access-keys/2 > /dev/null
  + client_curl --insecure -X DELETE https://shadowbox/${SB_API_PREFIX}/access-keys/1 > /dev/null
  # Start Shadowsocks client and wait for it to be ready
  declare -r LOCAL_SOCKS_PORT=5555
  @@ -136,6 +136,12 @@ function remove_color() {
  client_curl -x socks5h://localhost:$LOCAL_SOCKS_PORT http://target > $OUTPUT_DIR/actual.html
  diff $OUTPUT_DIR/actual.html target/index.html || fail "Target page by hostname does not match"
  + # Verify we can't access the page anymore after the key is deleted
  + client_curl --insecure -X DELETE https://shadowbox/${SB_API_PREFIX}/access-keys/0 > /dev/null
  + # Exit code 56 is "Connection reset by peer".
  + client_curl -x socks5h://localhost:$LOCAL_SOCKS_PORT --connect-timeout 1 http://target &> /dev/null \
  + && fail "Deleted access key is still active" || (($? == 56))
  +
  # Verify no errors occurred
  docker logs $SHADOWBOX_CONTAINER &> $OUTPUT_DIR/logs.txt
  if cat $OUTPUT_DIR/logs.txt | remove_color | grep --quiet -E "^E|level=error|ERROR:"; then
  