Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dex.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ config:
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
username: "test-client-oidc"
userID: "73bca0b9-9be6-4e73-a8fb-347c2ac23255"
- email: "test-client-oidc-provisioning@example.com"
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
username: "test-client-oidc-provisioning"
userID: "464d9494-5cc3-44e1-a380-c0403bd31fcb"
- email: "test-exporter-oidc@example.com"
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
username: "test-exporter-oidc"
Expand Down
40 changes: 24 additions & 16 deletions tests.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
setup() {
bats_load_library bats-support
bats_load_library bats-assert

bats_require_minimum_version 1.5.0
}

wait_for_exporter() {
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy
}

@test "can create clients with admin cli" {
Expand Down Expand Up @@ -31,6 +42,11 @@ setup() {
--issuer https://dex.dex.svc.cluster.local:5556 \
--username test-client-oidc@example.com --password password --unsafe

jmp login --client test-client-oidc-provisioning \
--endpoint "$ENDPOINT" --namespace default --name "" \
--issuer https://dex.dex.svc.cluster.local:5556 \
--username test-client-oidc-provisioning@example.com --password password --unsafe

jmp login --client test-client-sa \
--endpoint "$ENDPOINT" --namespace default --name test-client-sa \
--issuer https://dex.dex.svc.cluster.local:5556 \
Expand Down Expand Up @@ -78,17 +94,12 @@ while true; do
done
EOF

kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy

wait_for_exporter
}

@test "can specify client config only using environment variables" {
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
wait_for_exporter

JMP_NAMEPSACE=default \
JMP_NAME=test-exporter-legacy \
Expand All @@ -98,8 +109,7 @@ EOF
}

@test "can operate on leases" {
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
wait_for_exporter

jmp config client use test-client-oidc

Expand All @@ -110,16 +120,14 @@ EOF
}

@test "can lease and connect to exporters" {
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-oidc
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-sa
kubectl -n default wait --for=condition=Online --for=condition=Registered \
exporters.jumpstarter.dev/test-exporter-legacy
wait_for_exporter

jmp shell --client test-client-oidc --selector example.com/board=oidc j power on
jmp shell --client test-client-sa --selector example.com/board=sa j power on
jmp shell --client test-client-legacy --selector example.com/board=legacy j power on

wait_for_exporter
jmp shell --client test-client-oidc-provisioning --selector example.com/board=oidc j power on
}

@test "can get crds with admin cli" {
Expand Down
2 changes: 2 additions & 0 deletions values.kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jumpstarter-controller:
grpc:
mode: "ingress"
config:
provisioning:
enabled: true
authentication:
jwt:
- issuer:
Expand Down
Loading