Skip to content

Commit 4344047

Browse files
committed
add-schema-validations
Signed-off-by: Rafa Porres Molina <rporresm@redhat.com>
1 parent 54110e7 commit 4344047

5 files changed

Lines changed: 185 additions & 0 deletions

File tree

schemas/variables.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ properties:
114114
"$ref": "#/definitions/ipv4Address"
115115
sshPubPath:
116116
"$ref": "#/definitions/nonEmptyString"
117+
ironicHTTPSCACertificate:
118+
type: string
119+
description: PEM-encoded CA certificate for Ironic vmedia HTTPS (for BMC trust)
120+
ironicHTTPSCertificate:
121+
type: string
122+
description: PEM-encoded TLS certificate for Ironic vmedia HTTPS server
123+
ironicHTTPSKey:
124+
type: string
125+
description: PEM-encoded private key for Ironic vmedia HTTPS certificate
117126
sslAPICertificateFullChain:
118127
type: string
119128
description: PEM-encoded full certificate chain for API server
@@ -189,3 +198,17 @@ allOf:
189198
sslIngressCertificateKey:
190199
type: string
191200
minLength: 1
201+
- if:
202+
properties:
203+
ironicHTTPSCertificate:
204+
type: string
205+
minLength: 1
206+
required:
207+
- ironicHTTPSCertificate
208+
then:
209+
required:
210+
- ironicHTTPSKey
211+
properties:
212+
ironicHTTPSKey:
213+
type: string
214+
minLength: 1
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# Invalid fixture: ironicHTTPSCertificate present but ironicHTTPSKey is empty
3+
# Expected failure: variables schema requires ironicHTTPSKey to be non-empty
4+
# when ironicHTTPSCertificate is provided.
5+
workingDir: /home/enclave
6+
baseDomain: enclave-test.nodns.in
7+
clusterName: mgmt
8+
machineNetwork: 192.168.2.0/24
9+
apiVIP: 192.168.2.201
10+
ingressVIP: 192.168.2.202
11+
defaultDNS: 9.30.31.32
12+
defaultGateway: 192.168.2.10
13+
defaultPrefix: 24
14+
rendezvousIP: 192.168.2.24
15+
lzBmcIP: 100.64.1.10
16+
quayUser: admin
17+
quayPassword: password
18+
quayBackend: LocalStorage
19+
blockStorageBackend: lvms
20+
pullSecret: {"auths":{}}
21+
sshPubPath: /home/enclave/.ssh/id_rsa.pub
22+
ironicHTTPSCertificate: |
23+
-----BEGIN CERTIFICATE-----
24+
DUMMY_IRONIC_CERT
25+
-----END CERTIFICATE-----
26+
ironicHTTPSKey: ""
27+
agent_hosts:
28+
- name: mgmt-ctl01
29+
macAddress: 0c:c4:7a:62:fe:ec
30+
ipAddress: 192.168.2.24
31+
redfish: 192.168.1.101
32+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
33+
redfishUser: admin
34+
redfishPassword: password
35+
- name: mgmt-ctl02
36+
macAddress: 0c:c4:7a:62:fe:ed
37+
ipAddress: 192.168.2.25
38+
redfish: 192.168.1.102
39+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
40+
redfishUser: admin
41+
redfishPassword: password
42+
- name: mgmt-ctl03
43+
macAddress: 0c:c4:7a:62:fe:ee
44+
ipAddress: 192.168.2.26
45+
redfish: 192.168.1.103
46+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
47+
redfishUser: admin
48+
redfishPassword: password
49+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# Invalid fixture: ironicHTTPSCertificate present but ironicHTTPSKey omitted
3+
# Expected failure: variables schema requires ironicHTTPSKey when
4+
# ironicHTTPSCertificate is present and non-empty.
5+
workingDir: /home/enclave
6+
baseDomain: enclave-test.nodns.in
7+
clusterName: mgmt
8+
machineNetwork: 192.168.2.0/24
9+
apiVIP: 192.168.2.201
10+
ingressVIP: 192.168.2.202
11+
defaultDNS: 9.30.31.32
12+
defaultGateway: 192.168.2.10
13+
defaultPrefix: 24
14+
rendezvousIP: 192.168.2.24
15+
lzBmcIP: 100.64.1.10
16+
quayUser: admin
17+
quayPassword: password
18+
quayBackend: LocalStorage
19+
blockStorageBackend: lvms
20+
pullSecret: {"auths":{}}
21+
sshPubPath: /home/enclave/.ssh/id_rsa.pub
22+
ironicHTTPSCertificate: |
23+
-----BEGIN CERTIFICATE-----
24+
DUMMY_IRONIC_CERT
25+
-----END CERTIFICATE-----
26+
agent_hosts:
27+
- name: mgmt-ctl01
28+
macAddress: 0c:c4:7a:62:fe:ec
29+
ipAddress: 192.168.2.24
30+
redfish: 192.168.1.101
31+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
32+
redfishUser: admin
33+
redfishPassword: password
34+
- name: mgmt-ctl02
35+
macAddress: 0c:c4:7a:62:fe:ed
36+
ipAddress: 192.168.2.25
37+
redfish: 192.168.1.102
38+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
39+
redfishUser: admin
40+
redfishPassword: password
41+
- name: mgmt-ctl03
42+
macAddress: 0c:c4:7a:62:fe:ee
43+
ipAddress: 192.168.2.26
44+
redfish: 192.168.1.103
45+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
46+
redfishUser: admin
47+
redfishPassword: password
48+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
# Fixture: LocalStorage + lvms with Ironic vmedia HTTPS variables
3+
# Validates that the ironicHTTPSCertificate conditional passes when both
4+
# ironicHTTPSCertificate and ironicHTTPSKey are present.
5+
# ironicHTTPSCACertificate is omitted (always optional).
6+
workingDir: /home/enclave
7+
baseDomain: enclave-test.nodns.in
8+
clusterName: mgmt
9+
machineNetwork: 192.168.2.0/24
10+
apiVIP: 192.168.2.201
11+
ingressVIP: 192.168.2.202
12+
defaultDNS: 9.30.31.32
13+
defaultGateway: 192.168.2.10
14+
defaultPrefix: 24
15+
rendezvousIP: 192.168.2.24
16+
lzBmcIP: 100.64.1.10
17+
quayUser: admin
18+
quayPassword: password
19+
quayBackend: LocalStorage
20+
blockStorageBackend: lvms
21+
pullSecret: {"auths":{}}
22+
sshPubPath: /home/enclave/.ssh/id_rsa.pub
23+
ironicHTTPSCertificate: |
24+
-----BEGIN CERTIFICATE-----
25+
DUMMY_IRONIC_CERT
26+
-----END CERTIFICATE-----
27+
ironicHTTPSKey: |
28+
-----BEGIN DUMMY KEY-----
29+
DUMMY_IRONIC_KEY
30+
-----END DUMMY KEY-----
31+
agent_hosts:
32+
- name: mgmt-ctl01
33+
macAddress: 0c:c4:7a:62:fe:ec
34+
ipAddress: 192.168.2.24
35+
redfish: 192.168.1.101
36+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
37+
redfishUser: admin
38+
redfishPassword: password
39+
- name: mgmt-ctl02
40+
macAddress: 0c:c4:7a:62:fe:ed
41+
ipAddress: 192.168.2.25
42+
redfish: 192.168.1.102
43+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
44+
redfishUser: admin
45+
redfishPassword: password
46+
- name: mgmt-ctl03
47+
macAddress: 0c:c4:7a:62:fe:ee
48+
ipAddress: 192.168.2.26
49+
redfish: 192.168.1.103
50+
rootDisk: /dev/disk/by-path/pci-0000:00:11.4-ata-1.0
51+
redfishUser: admin
52+
redfishPassword: password
53+

test-fixtures/schemas/valid/radosgw-lvms-all-optionals.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ sslIngressCertificateKey: |
6363
-----BEGIN DUMMY KEY-----
6464
DUMMY_INGRESS_KEY
6565
-----END DUMMY KEY-----
66+
ironicHTTPSCertificate: |
67+
-----BEGIN CERTIFICATE-----
68+
DUMMY_IRONIC_CERT
69+
-----END CERTIFICATE-----
70+
ironicHTTPSKey: |
71+
-----BEGIN DUMMY KEY-----
72+
DUMMY_IRONIC_KEY
73+
-----END DUMMY KEY-----
74+
ironicHTTPSCACertificate: |
75+
-----BEGIN CERTIFICATE-----
76+
DUMMY_IRONIC_CA
77+
-----END CERTIFICATE-----
6678
discovery_hosts:
6779
- name: discovery-host-01
6880
macAddress: 0c:c4:7a:62:ff:01

0 commit comments

Comments
 (0)