-
Notifications
You must be signed in to change notification settings - Fork 78
LDAP Adoption tests #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xek
wants to merge
8
commits into
openstack-k8s-operators:main
Choose a base branch
from
xek:ldap-adoption
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+272
−1
Open
LDAP Adoption tests #970
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
78f49e7
LDAP Adoption tests
xek 7351ba4
Add retry and delay on the Test IPA user authentication task
afaranha dce1529
Configure ldap to use svc-ldap instead of admin user
afaranha 0a0f14f
Merge branch 'main' into ldap-adoption
afaranha ceeaf36
Use ldaps instead of ldap
afaranha ec6aba7
Fix lint
afaranha 6385a0e
Fix lint
afaranha 7410e0b
Merge branch 'main' of github.com:openstack-k8s-operators/data-plane-…
afaranha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,138 @@ | ||
| --- | ||
xek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Tasks for testing IPA integration with Keystone | ||
| - name: Check if IPA is enabled | ||
| ansible.builtin.fail: | ||
| msg: "IPA is not enabled (enable_tlse is not true). Skipping IPA tests." | ||
| when: enable_tlse is not defined or not enable_tlse | ||
|
|
||
| - name: Wait for Keystone to be fully operational | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc wait pod --for condition=Ready --selector=service=keystone | ||
| register: keystone_wait_result | ||
| until: keystone_wait_result is success | ||
| retries: 60 | ||
| delay: 2 | ||
|
|
||
| - name: Wait for openstackclient pod to be ready | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc wait pod --for condition=Ready --selector=service=openstackclient | ||
| register: osc_wait_result | ||
| until: osc_wait_result is success | ||
| retries: 60 | ||
| delay: 2 | ||
|
|
||
| - name: Get Keystone route | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc get route keystone-public -n openstack -o jsonpath='{.spec.host}' | ||
| register: keystone_route | ||
|
|
||
| - name: Create files directory if it does not exist | ||
| ansible.builtin.file: | ||
| path: "{{ role_path }}/files" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| - name: Create IPA test user cloudrc file | ||
| ansible.builtin.template: | ||
| src: ipauser.j2 | ||
| dest: "{{ role_path }}/files/ipauser" | ||
| mode: "0600" | ||
| vars: | ||
| auth_url: "https://{{ keystone_route.stdout }}/v3" | ||
| username: "ipauser1" | ||
| password: "{{ ipa_user_password }}" | ||
| domain: "REDHAT" | ||
|
|
||
| - name: Copy IPA test user cloudrc to openstackclient pod | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc cp {{ role_path }}/files/ipauser openstackclient:/home/cloud-admin/ipauser | ||
|
|
||
| - name: Test IPA user authentication | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack token issue -f value -c id > /dev/null && | ||
| echo 'IPA user authentication successful' || | ||
| echo 'IPA user authentication failed'" | ||
| register: ipa_auth_test | ||
| failed_when: "'IPA user authentication failed' in ipa_auth_test.stdout" | ||
| retries: 60 | ||
| delay: 2 | ||
|
|
||
| - name: List IPA users via Keystone | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack user list --domain REDHAT" | ||
| register: ipa_user_list | ||
|
|
||
| - name: Verify IPA users are accessible | ||
| ansible.builtin.assert: | ||
| that: | ||
| - "'ipauser1' in ipa_user_list.stdout" | ||
| - "'ipauser2' in ipa_user_list.stdout" | ||
| - "'ipauser3' in ipa_user_list.stdout" | ||
|
|
||
| - name: List IPA groups via Keystone | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack group list --domain REDHAT" | ||
| register: ipa_group_list | ||
|
|
||
| - name: Verify IPA groups are accessible | ||
| ansible.builtin.assert: | ||
| that: | ||
| - "'grp-openstack' in ipa_group_list.stdout" | ||
| - "'grp-openstack-admin' in ipa_group_list.stdout" | ||
| - "'grp-openstack-demo' in ipa_group_list.stdout" | ||
|
|
||
| - name: Check ipauser1 in grp-openstack-admin | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack group contains user --group-domain REDHAT --user-domain REDHAT grp-openstack-admin ipauser1" | ||
| register: user1_group_result | ||
| failed_when: "'ipauser1 in group grp-openstack-admin' not in user1_group_result.stdout" | ||
|
|
||
| - name: Check ipauser2 in grp-openstack-demo | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack group contains user --group-domain REDHAT --user-domain REDHAT grp-openstack-demo ipauser2" | ||
| register: user2_group_result | ||
| failed_when: "'ipauser2 in group grp-openstack-demo' not in user2_group_result.stdout" | ||
|
|
||
| - name: Check ipauser3 in grp-openstack | ||
| ansible.builtin.shell: | | ||
| {{ shell_header }} | ||
| {{ oc_header }} | ||
| oc exec -t openstackclient -- bash -c " | ||
| source /home/cloud-admin/ipauser && | ||
| export OS_IDENTITY_API_VERSION=3 && | ||
| openstack group contains user --group-domain REDHAT --user-domain REDHAT grp-openstack ipauser3" | ||
| register: user3_group_result | ||
| failed_when: "'ipauser3 in group grp-openstack' not in user3_group_result.stdout" | ||
This file contains hidden or 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,7 @@ | ||
| #!/bin/bash | ||
| unset OS_CLOUD | ||
| export OS_IDENTITY_API_VERSION=3 | ||
| export OS_AUTH_URL="{{ auth_url }}" | ||
| export OS_USER_DOMAIN_NAME="{{ domain }}" | ||
| export OS_USERNAME="{{ username }}" | ||
| export OS_PASSWORD="{{ password }}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.