-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcontrol-plane.yaml
More file actions
234 lines (213 loc) · 9.05 KB
/
control-plane.yaml
File metadata and controls
234 lines (213 loc) · 9.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
# Control Plane Validation - Canonical Configuration
#
# THE canonical control plane test suite. Provider configs import this
# file and override commands with platform-specific stubs.
#
# Architecture:
# - Scripts: Platform-specific (YOU implement these) - CRUD operations
# - Validations: Platform-agnostic (provided) - just check JSON output
#
# Contract:
# Each script MUST print a JSON object to stdout. The validations
# only inspect that JSON. As long as your scripts output the right
# fields, the validations pass regardless of which cloud you use.
#
# Test groups:
# 1. API Health - Authentication and service connectivity
# 2. Access Key Lifecycle - Create, authenticate, disable, verify rejection, delete
# 3. Tenant Lifecycle - Create, list, get info, delete
#
# Quick start (new provider):
# 1. Create your provider folder: mkdir -p isvctl/configs/providers/my-isv/
# 2. Create providers/my-isv/control-plane.yaml with: import: ../../tests/control-plane.yaml
# 3. Override commands with your platform stubs
# 4. Run: uv run isvctl test run -f isvctl/configs/providers/my-isv/control-plane.yaml
#
# See also:
# - AWS reference implementation: ../aws/control-plane.yaml + ../stubs/aws/control-plane/
# - JSON schemas: isvctl/src/isvctl/config/output_schemas.py
version: "1.0"
commands:
control_plane:
phases: ["setup", "test", "teardown"]
steps:
# ═══════════════════════════════════════════════════════════════
# SETUP: API Health Check
# ═══════════════════════════════════════════════════════════════
# YOUR SCRIPT must output JSON with at minimum:
# {
# "success": true,
# "platform": "control_plane",
# "account_id": "<account-id>",
# "tests": {"auth": {"passed": true}, "service_name": {"passed": true}}
# }
- name: check_api
phase: setup
command: "python3 ../stubs/control-plane/check_api.py"
args: ["--region", "{{region}}", "--services", "{{services}}"]
timeout: 120
# ═══════════════════════════════════════════════════════════════
# SETUP: Create Resources
# ═══════════════════════════════════════════════════════════════
# Access key output:
# {
# "success": true,
# "platform": "control_plane",
# "username": "...",
# "access_key_id": "...",
# "secret_access_key": "..."
# }
- name: create_access_key
phase: setup
command: "python3 ../stubs/control-plane/create_access_key.py"
args: ["--region", "{{region}}"]
timeout: 60
# Tenant output:
# {
# "success": true,
# "platform": "control_plane",
# "tenant_name": "...",
# "tenant_id": "..."
# }
- name: create_tenant
phase: setup
command: "python3 ../stubs/control-plane/create_tenant.py"
args: ["--region", "{{region}}"]
timeout: 60
# ═══════════════════════════════════════════════════════════════
# TEST: Access Key Lifecycle
# ═══════════════════════════════════════════════════════════════
- name: test_access_key
phase: test
command: "python3 ../stubs/control-plane/test_access_key.py"
args:
- "--access-key-id"
- "{{steps.create_access_key.access_key_id}}"
- "--secret-access-key"
- "{{steps.create_access_key.secret_access_key}}"
- "--region"
- "{{region}}"
sensitive_args: ["--secret-access-key"]
timeout: 120
- name: disable_access_key
phase: test
command: "python3 ../stubs/control-plane/disable_access_key.py"
args:
- "--username"
- "{{steps.create_access_key.username}}"
- "--access-key-id"
- "{{steps.create_access_key.access_key_id}}"
- "--region"
- "{{region}}"
timeout: 60
- name: verify_key_rejected
phase: test
command: "python3 ../stubs/control-plane/verify_key_rejected.py"
args:
- "--access-key-id"
- "{{steps.create_access_key.access_key_id}}"
- "--secret-access-key"
- "{{steps.create_access_key.secret_access_key}}"
- "--region"
- "{{region}}"
sensitive_args: ["--secret-access-key"]
timeout: 120
# ═══════════════════════════════════════════════════════════════
# TEST: Tenant Lifecycle
# ═══════════════════════════════════════════════════════════════
- name: list_tenants
phase: test
command: "python3 ../stubs/control-plane/list_tenants.py"
args:
- "--region"
- "{{region}}"
- "--target-group"
- "{{steps.create_tenant.tenant_name}}"
timeout: 60
- name: get_tenant
phase: test
command: "python3 ../stubs/control-plane/get_tenant.py"
args:
- "--group-name"
- "{{steps.create_tenant.tenant_name}}"
- "--region"
- "{{region}}"
timeout: 60
# ═══════════════════════════════════════════════════════════════
# TEARDOWN: Cleanup Resources
# ═══════════════════════════════════════════════════════════════
- name: delete_access_key
phase: teardown
command: "python3 ../stubs/control-plane/delete_access_key.py"
args:
- "--username"
- "{{steps.create_access_key.username}}"
- "--access-key-id"
- "{{steps.create_access_key.access_key_id}}"
timeout: 60
output_schema: teardown
- name: delete_tenant
phase: teardown
command: "python3 ../stubs/control-plane/delete_tenant.py"
args:
- "--group-name"
- "{{steps.create_tenant.tenant_name}}"
- "--region"
- "{{region}}"
timeout: 60
output_schema: teardown
tests:
platform: control_plane
cluster_name: "control-plane-validation"
description: "Control plane: API health, access key lifecycle, tenant lifecycle"
settings:
# Provider-specific -- override in your provider config
region: ""
services: ""
# ─── Validations ─────────────────────────────────────────────────
# These are PROVIDER-AGNOSTIC. They only check JSON field names/values.
validations:
api_health:
step: check_api
checks:
FieldExistsCheck:
fields: ["account_id", "tests"]
FieldValueCheck:
field: "success"
expected: true
setup_checks:
checks:
AccessKeyCreatedCheck:
step: create_access_key
TenantCreatedCheck:
step: create_tenant
access_key_lifecycle:
checks:
AccessKeyAuthenticatedCheck:
step: test_access_key
AccessKeyDisabledCheck:
step: disable_access_key
AccessKeyRejectedCheck:
step: verify_key_rejected
tenant_lifecycle:
checks:
TenantListedCheck:
step: list_tenants
TenantInfoCheck:
step: get_tenant
teardown_checks:
checks:
StepSuccessCheck-delete_access_key:
step: delete_access_key
StepSuccessCheck-delete_tenant:
step: delete_tenant
exclude:
markers: []