Skip to content

Commit

Permalink
Merge pull request #497 from afaranha/barbican_secret_test
Browse files Browse the repository at this point in the history
Remove barbican secret creation on pre_launch.bash
  • Loading branch information
jistr authored Jul 1, 2024
2 parents f698b01 + 00871fa commit 551c9d9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/roles/barbican_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@
until: barbican_responding_result is success
retries: 60
delay: 2

- name: check that Barbican secret payload was migrated successfully
when: prelaunch_barbican_secret|default(false)
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
alias openstack="oc exec -t openstackclient -- openstack"
secret_id=`${BASH_ALIASES[openstack]} secret list | grep testSecret | cut -d'|' -f 2 | xargs`
secret_payload=`${BASH_ALIASES[openstack]} secret get $secret_id --payload -f value`
if [ "$secret_payload" != "TestPayload" ]
then
exit 1
fi
2 changes: 1 addition & 1 deletion tests/roles/development_environment/files/pre_launch.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e

alias openstack="ssh -i ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack"
alias openstack="ssh -q -i ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack"

function wait_for_status() {
local time=0
Expand Down
14 changes: 14 additions & 0 deletions tests/roles/development_environment/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@
{{ shell_header }}
alias openstack="ssh -i {{ edpm_privatekey_path }} root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack"
{{ lookup('ansible.builtin.file', prelaunch_test_instance_script) }}
- name: creates Barbican secret
no_log: "{{ use_no_log }}"
when: prelaunch_test_instance|bool and prelaunch_barbican_secret|default(false)
environment:
INSTALL_YAMLS_PATH: "{{ install_yamls_path }}"
EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}"
OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}"
OS_CLOUD_NAME: "{{ os_cloud_name }}"
ansible.builtin.shell:
cmd: |
{{ shell_header }}
alias openstack="ssh -i {{ edpm_privatekey_path }} root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack"
${BASH_ALIASES[openstack]} secret store --name testSecret --payload 'TestPayload'
6 changes: 6 additions & 0 deletions tests/vars.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ edpm_node_hostname: standalone.localdomain
# This setting should at some point be switched in the CI to standalone.ooo.test
# for all types of jobs and removed entirely afterwards.

# If 'true', this flag will create a Barbican secret before the adoption runs
# and after the adoption it'll be verified with the secret tills exists with
# the same payload. For this flag to work with 'true' value, Barbican should be
# available before the adoption
prelaunch_barbican_secret: false

# Whether to use 'make crc_storage_cleanup; make crc_storage' before the test
reset_crc_storage: true

Expand Down

0 comments on commit 551c9d9

Please sign in to comment.