From dab44e2b738986daedd3f4da60120c38fe4e8adf Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Tue, 13 Aug 2024 10:28:04 +0200 Subject: [PATCH] [integration tests] add simple API admin test --- .github/integration/sda/config.yaml | 2 ++ .github/integration/tests/sda/60_api_admin_test.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 .github/integration/tests/sda/60_api_admin_test.sh diff --git a/.github/integration/sda/config.yaml b/.github/integration/sda/config.yaml index f9a61cb34..b89f0d4a3 100644 --- a/.github/integration/sda/config.yaml +++ b/.github/integration/sda/config.yaml @@ -1,6 +1,8 @@ log: format: "json" level: "debug" +admin: + users: "requester@demo.org" archive: type: s3 url: "http://s3" diff --git a/.github/integration/tests/sda/60_api_admin_test.sh b/.github/integration/tests/sda/60_api_admin_test.sh new file mode 100644 index 000000000..d0e9e5b96 --- /dev/null +++ b/.github/integration/tests/sda/60_api_admin_test.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +token="$(curl http://oidc:8080/tokens | jq -r '.[0]')" +result="$(curl -sk -L "http://api:8080/users/test@dummy.org/files" -H "Authorization: Bearer $token" | jq '. | length')" +if [ "$result" -ne 4 ]; then + echo "wong number of files returned for user test@dummy.org" + echo "expected 4 got $result" + exit 1 +fi \ No newline at end of file