Skip to content

Commit

Permalink
tests: Add scenario to test Admin static user password change
Browse files Browse the repository at this point in the history
Use CSC to change the password for the Admin static user and test login
with this new password on Dex

Refs: #2569
  • Loading branch information
TeddyAndrieux committed May 27, 2020
1 parent ff9066c commit 119a88d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/post/features/service_configuration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@ Feature: Cluster and Services Configurations
And we have a 'metalk8s-dex-config' CSC in namespace 'metalk8s-auth'
When we update the CSC 'spec.deployment.replicas' to '3'
Then we have '3' at 'status.available_replicas' for 'dex' Deployment in namespace 'metalk8s-auth'

Scenario: Update Admin static user password
Given the Kubernetes API is available
And we have a 'metalk8s-dex-config' CSC in namespace 'metalk8s-auth'
# NOTE: Consider that admin user is the first of the userlist
# Update password to "new-password"
When we update the CSC 'spec.localuserstore.userlist.0.hash' to '$2y$14$pDe0vj917rR3XJQ5iEZvhuSGoWkZg2/qBN/mMLqwFSz9S7EYcbIpO'
Then the control-plane Ingress path '/oidc' is available
And pods with label 'app.kubernetes.io/name=dex' are 'Ready'
And we are not able to login to Dex as '[email protected]' using password 'password'
And we are able to login to Dex as '[email protected]' using password 'new-password'
6 changes: 6 additions & 0 deletions tests/post/steps/test_service_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def test_service_config_propagation(host):
pass


@scenario('../features/service_configuration.feature',
'Update Admin static user password')
def test_static_user_change(host):
pass


# }}}
# Given {{{

Expand Down

0 comments on commit 119a88d

Please sign in to comment.