Skip to content

Commit e662eec

Browse files
committed
fix: test cases and verified them
1 parent 35d6f71 commit e662eec

4 files changed

Lines changed: 94 additions & 7 deletions

File tree

‎test/kuttl/tests/dataplane-deploy-no-nodes-test/08-ansiblevars-deploy.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Test ansibleVarsFrom ConfigMap/Secret change detection
2+
# First, delete the failed deployment from step 05 to clear the NodeSet error state
3+
# This step can be ignored if we did not want to check the status of the nodeSet
4+
# and verify if that is waiting for deployment.
5+
apiVersion: kuttl.dev/v1beta1
6+
kind: TestStep
7+
commands:
8+
- script: oc delete openstackdataplanedeployment edpm-compute-no-nodes-non-existent-service -n openstack-kuttl-tests --ignore-not-found=true
9+
---
210
# Create ConfigMap and Secret for ansibleVarsFrom
311
apiVersion: v1
412
kind: ConfigMap

‎test/kuttl/tests/dataplane-deploy-no-nodes-test/08-assert.yaml‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,34 @@ status:
1818
reason: Ready
1919
status: "True"
2020
type: Ready
21+
- message: Deployment completed
22+
reason: Ready
23+
status: "True"
24+
type: DeploymentReady
25+
- message: Input data complete
26+
reason: Ready
27+
status: "True"
28+
type: InputReady
29+
- message: NodeSetDNSDataReady ready
30+
reason: Ready
31+
status: "True"
32+
type: NodeSetDNSDataReady
33+
- message: NodeSetIPReservationReady ready
34+
reason: Ready
35+
status: "True"
36+
type: NodeSetIPReservationReady
37+
- message: ServiceAccount created
38+
reason: Ready
39+
status: "True"
40+
type: ServiceAccountReady
41+
- message: Setup complete
42+
reason: Ready
43+
status: "True"
44+
type: SetupReady
2145
configMapHashes:
22-
ansiblevars-test-cm: {}
46+
ansiblevars-test-cm: n5bbhc6h5fdhf8h57bh665h5b9h576h598h7dh5fdh667hch5b5h89h9dh668hc4hc6h669h74h575hf4h596h66dhd5h5f7hb7h689hf9hddh64q
2347
secretHashes:
24-
ansiblevars-test-secret: {}
48+
ansiblevars-test-secret: n5d8h67h5b8hc9h5cfh54bh76h544h66chf7h8bh5fbh59chdch76h96h54bh74h9bh5bh5cdh94h566h699h99hdch65fh5d6h5fbh5bfh586hfcq
2549
---
2650
# Assert deployment completed with hashes
2751
apiVersion: dataplane.openstack.org/v1beta1
@@ -32,6 +56,6 @@ metadata:
3256
status:
3357
deployed: true
3458
configMapHashes:
35-
ansiblevars-test-cm: {}
59+
ansiblevars-test-cm: n5bbhc6h5fdhf8h57bh665h5b9h576h598h7dh5fdh667hch5b5h89h9dh668hc4hc6h669h74h575hf4h596h66dhd5h5f7hb7h689hf9hddh64q
3660
secretHashes:
37-
ansiblevars-test-secret: {}
61+
ansiblevars-test-secret: n5d8h67h5b8hc9h5cfh54bh76h544h66chf7h8bh5fbh59chdch76h96h54bh74h9bh5bh5cdh94h566h699h99hdch65fh5d6h5fbh5bfh586hfcq

‎test/kuttl/tests/dataplane-deploy-no-nodes-test/09-ansiblevars-update.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ metadata:
1212
name: ansiblevars-test-secret
1313
stringData:
1414
secret_var: updated-secret-value
15+
---
16+
# Create deployment to capture the new hashes after content update
17+
apiVersion: dataplane.openstack.org/v1beta1
18+
kind: OpenStackDataPlaneDeployment
19+
metadata:
20+
name: edpm-ansiblevars-deploy-update
21+
spec:
22+
nodeSets:
23+
- edpm-compute-no-nodes
24+
servicesOverride:
25+
- configure-os

‎test/kuttl/tests/dataplane-deploy-no-nodes-test/09-assert.yaml‎

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,58 @@ collectors:
66
command: oc logs -n openstack-operators -l openstack.org/operator-name=openstack
77
name: operator-logs
88
---
9-
# Assert NodeSet is NOT Ready after ConfigMap/Secret content changed
9+
# Assert NodeSet is Ready after deployment with updated ConfigMap/Secret completes
10+
# The hash values will differ from step 08 due to content change
1011
apiVersion: dataplane.openstack.org/v1beta1
1112
kind: OpenStackDataPlaneNodeSet
1213
metadata:
1314
name: edpm-compute-no-nodes
1415
namespace: openstack-kuttl-tests
1516
status:
1617
conditions:
17-
- reason: Requested
18-
status: "False"
18+
- message: NodeSet Ready
19+
reason: Ready
20+
status: "True"
1921
type: Ready
22+
- message: Deployment completed
23+
reason: Ready
24+
status: "True"
25+
type: DeploymentReady
26+
- message: Input data complete
27+
reason: Ready
28+
status: "True"
29+
type: InputReady
30+
- message: NodeSetDNSDataReady ready
31+
reason: Ready
32+
status: "True"
33+
type: NodeSetDNSDataReady
34+
- message: NodeSetIPReservationReady ready
35+
reason: Ready
36+
status: "True"
37+
type: NodeSetIPReservationReady
38+
- message: ServiceAccount created
39+
reason: Ready
40+
status: "True"
41+
type: ServiceAccountReady
42+
- message: Setup complete
43+
reason: Ready
44+
status: "True"
45+
type: SetupReady
46+
configMapHashes:
47+
ansiblevars-test-cm: nd7h5fdh54bh8chb7h5hc8h654hf8h5d5h66bh54dh56fh7bhf5h98h66fh59ch87h9ch5d6h664h668hb7h66fh7fh598h9fh57dhfh5fch655q
48+
secretHashes:
49+
ansiblevars-test-secret: n56hffh656h98hc9h4h79h86h5bfh695hd7h5f9h5d4h87h85h546h7dhc5h98h676h5fh66bh66bhb5h679h77hf8hdbh569h66dhb5h59dq
50+
---
51+
# Assert deployment completed with new hashes
52+
apiVersion: dataplane.openstack.org/v1beta1
53+
kind: OpenStackDataPlaneDeployment
54+
metadata:
55+
name: edpm-ansiblevars-deploy-update
56+
namespace: openstack-kuttl-tests
57+
status:
58+
deployed: true
59+
configMapHashes:
60+
ansiblevars-test-cm: nd7h5fdh54bh8chb7h5hc8h654hf8h5d5h66bh54dh56fh7bhf5h98h66fh59ch87h9ch5d6h664h668hb7h66fh7fh598h9fh57dhfh5fch655q
61+
secretHashes:
62+
ansiblevars-test-secret: n56hffh656h98hc9h4h79h86h5bfh695hd7h5f9h5d4h87h85h546h7dhc5h98h676h5fh66bh66bhb5h679h77hf8hdbh569h66dhb5h59dq
63+

0 commit comments

Comments
 (0)