Skip to content

Commit

Permalink
[tests] allow 409 from add-api-key request
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinAhlberg committed Oct 18, 2024
1 parent d3c34c5 commit 4aa79dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/integration/tests/sda/20_ingest-verify_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ for file in NA12878.bam NA12878_20k_b37.bam NA12878.bai NA12878_20k_b37.bai; do

# Insert key hash after the ingestion of the first file has started
# Makes sure that ingestion works even if the key hash is there
curl -k -L "http://api:8080/key/hashed" -H "Authorization: Bearer $token" -d "{\"hash\": \"$key\", \"description\": \"first key\"}"
response=$(curl -s -w "%{http_code}" -k -L "http://api:8080/key/hashed" -H "Authorization: Bearer $token" -d "{\"hash\": \"$key\", \"description\": \"first key\"}")
# Extract the 3 last characters, ie the status code
status=$(printf "%s" "$response" | tail -c 3)
if [ "$status" -ne "200" ] && [ "$status" -ne "409" ]; then
echo "Could not add key hash to database"
exit 1
fi
done

echo "waiting for verify to complete"
Expand Down

0 comments on commit 4aa79dd

Please sign in to comment.