Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bashofmann committed Mar 18, 2024
1 parent 857ba11 commit 778cc7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions test/integration/api_key.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ setup_file() {
[[ "${output}" =~ .*\"status\":\"ok\".* ]]
}

@test "api key authentication fails with key" {
run kubectl exec -n default curl -- curl -s http://qdrant.qdrant-helm-integration:6333/collections
[ "${output}" = "Write access denied" ]
@test "api key authentication fails with no key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections
[ "${output}" = "Must provide an API key or an Authorization bearer token - 403" ]
}

@test "api key authentication fails with wrong key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections -H 'api-key: invalid'
[ "${output}" = "Invalid API key or JWT token - 403" ]
}
11 changes: 8 additions & 3 deletions test/integration/read_only_api_key.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ setup_file() {
[[ "${output}" =~ .*\"status\":\"ok\".* ]]
}

@test "read-only api key authentication fails with key" {
run kubectl exec -n default curl -- curl -s http://qdrant.qdrant-helm-integration:6333/collections
[ "${output}" = "Write access denied" ]
@test "read-only api key authentication fails with no key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections
[ "${output}" = "Must provide an API key or an Authorization bearer token - 403" ]
}

@test "read-only api key authentication fails with wrong key" {
run kubectl exec -n default curl -- curl -s -w " - %{response_code}" http://qdrant.qdrant-helm-integration:6333/collections -H 'api-key: invalid'
[ "${output}" = "Invalid API key or JWT token - 403" ]
}

0 comments on commit 778cc7d

Please sign in to comment.