Skip to content

Commit 113ff84

Browse files
committed
Fernet rotation kuttl tests
1 parent 7c4dbd6 commit 113ff84

File tree

10 files changed

+44
-0
lines changed

10 files changed

+44
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
4+
alias openstack="oc exec -tn $NAMESPACE openstackclient -- openstack"
5+
6+
export OS_TOKEN=$(openstack token issue -f value -c id)
7+
8+
echo $OS_TOKEN > /tmp/temporary_test_token
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -e
3+
4+
export OS_TOKEN=$(cat /tmp/temporary_test_token)
5+
6+
alias openstack="oc exec -tn $NAMESPACE openstackclient -- env OS_TOKEN=$OS_TOKEN openstack --os-auth-type token "
7+
8+
openstack endpoint list > /dev/null
9+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/assert_sample_deployment.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/keystoneapi_deploy.yaml
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# create a test token, save it in /tmp/
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
commands:
5+
- script: $KEYSTONE_KUTTL_DIR/../common/scripts/create_test_token.sh
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# validate that token saved in previous step works
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
namespaced: true
5+
commands:
6+
- script: $KEYSTONE_KUTTL_DIR/../common/scripts/validate_test_token.sh
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- script: |
5+
oc create -n $NAMESPACE job --from cronjob/keystone-fernet-cronjob rotation-job-test1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# check job executed successfully
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
namespaced: true
5+
commands:
6+
- script: |
7+
oc wait -n $NAMESPACE --for=condition=complete --timeout=30s job/rotation-job-test1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/cleanup-keystone.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/errors_cleanup_keystone.yaml

0 commit comments

Comments
 (0)