Skip to content

Commit 88e120a

Browse files
committed
tests: fix docker e2e test for password admin backend
The docker e2e test uses the docker compose deployment. Since we changed the docker compose deployment to use the password backend, we need to tweak the flow here. Rather than setting up the admin keypair (which hasn't been needed for a while with docker compose), we find the admin password in the KBS log and use the admin-login interface. Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
1 parent 2ea4778 commit 88e120a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/kbs-docker-e2e.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,24 @@ jobs:
4444
run: |
4545
cargo build --manifest-path tools/kbs-client/Cargo.toml --no-default-features --features sample_only --release
4646
47-
- name: Setup Keys
48-
run: |
49-
openssl genpkey -algorithm ed25519 > kbs/config/private.key
50-
openssl pkey -in kbs/config/private.key -pubout -out kbs/config/public.pub
51-
5247
- name: Build KBS Cluster
5348
run: docker compose build --build-arg BUILDPLATFORM=${{ matrix.build_platform }} --build-arg ARCH=${{ matrix.target_arch }} --build-arg VERIFIER=${{ matrix.verifier }}
5449

5550
- name: Start KBS cluster
56-
run: docker compose up -d
51+
run: docker compose up -d && sleep 5
52+
53+
- name: Admin Login
54+
working-directory: target/release/
55+
run: |
56+
ADMIN_PASSWORD=$(docker compose logs kbs | grep "with password:" | awk '{print $NF}' | tr -d '\n')
57+
echo "$ADMIN_PASSWORD"
58+
./kbs-client --url http://127.0.0.1:8080 admin-login default_admin "$ADMIN_PASSWORD"
5759
5860
- name: Set Resource
5961
working-directory: target/release/
6062
run: |
6163
echo "$TEST_SECRET_CONTENT" > test-secret
62-
./kbs-client --url http://127.0.0.1:8080 config --auth-private-key ../../kbs/config/private.key set-resource --path "$TEST_SECRET_PATH" --resource-file test-secret
64+
./kbs-client --url http://127.0.0.1:8080 config set-resource --path "$TEST_SECRET_PATH" --resource-file test-secret
6365
6466
- name: Get Resource (negative)
6567
working-directory: target/release/
@@ -68,7 +70,7 @@ jobs:
6870
6971
- name: Update policy
7072
working-directory: target/release/
71-
run: ./kbs-client --url http://127.0.0.1:8080 config --auth-private-key ../../kbs/config/private.key set-resource-policy --policy-file "$policy_path"
73+
run: ./kbs-client --url http://127.0.0.1:8080 config ../../kbs/config/private.key set-resource-policy --policy-file "$policy_path"
7274
env:
7375
policy_path: ../../kbs/test/data/policy_2.rego
7476

0 commit comments

Comments
 (0)