-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env expect | ||
|
||
source ./lib/common.tcl | ||
|
||
set timeout 60 | ||
|
||
set cluster_id "c-appuio-lab-cloudscale-rma-0" | ||
set api_endpoint "https://api.lab-cloudscale-rma-0.appuio.cloud:6443" | ||
|
||
set passphrase [getenv_or_die "E2E_PASSBOLT_PASSPHRASE"] | ||
set private_key [getenv_or_die "E2E_PASSBOLT_PRIVATE_KEY"] | ||
|
||
proc expect_prompt {prompt} { | ||
expect -exact "$prompt" | ||
expect -exact "> " | ||
sleep .5 | ||
} | ||
|
||
# The script assumes vi is used to enter the provate key | ||
set ::env(EDITOR) "vi" | ||
file delete -force config.yaml | ||
file delete -force "em-$cluster_id" | ||
set ::env(EMR_CONFIG_DIR) [pwd] | ||
|
||
log "Starting tool" | ||
set ::env(EMR_PASSPHRASE) "$passphrase" | ||
set ::env(EMR_KUBERNETES_ENDPOINT) "$api_endpoint" | ||
exec -- jq --null-input --arg key "$private_key" {{passbolt_key: $key}} > config.yaml | ||
spawn ../emergency-credentials-receive "$cluster_id" | ||
expect -exact "Welcome" | ||
|
||
log "Expecting to have valid credentials" | ||
expect -exact "2 buckets with credentials found" | ||
expect -exact "Emergency credentials found" | ||
expect eof | ||
|
||
test_kubeconfig "em-$cluster_id" | ||
|
||
log "Test successful" | ||
|
||
file delete -force config.yaml | ||
file delete -force "em-$cluster_id" |