Skip to content

Commit 49644d4

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 5a5b70f commit 49644d4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,23 @@ 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+
./kbs-client --url http://127.0.0.1:8080 admin-login default_admin "$ADMIN_PASSWORD"
5758
5859
- name: Set Resource
5960
working-directory: target/release/
6061
run: |
6162
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
63+
./kbs-client --url http://127.0.0.1:8080 config set-resource --path "$TEST_SECRET_PATH" --resource-file test-secret
6364
6465
- name: Get Resource (negative)
6566
working-directory: target/release/
@@ -68,7 +69,7 @@ jobs:
6869
6970
- name: Update policy
7071
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"
72+
run: ./kbs-client --url http://127.0.0.1:8080 config set-resource-policy --policy-file "$policy_path"
7273
env:
7374
policy_path: ../../kbs/test/data/policy_2.rego
7475

0 commit comments

Comments
 (0)