Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ biosVersion: "1.0.0"
biosSettingNoRebootKey: "AssetTag"
biosSettingNoRebootValue: "compat-test-06"
biosSettingNoRebootBaselineValue: "compat-base"
biosSettingRebootKey: "BootMode"
biosSettingRebootValue: "Bios"
biosSettingRebootBaselineValue: "Uefi"
bmcSettingKey: "EmailAlert.1.Address"
bmcSettingValue: "alerts@example.com"
```
Expand Down
13 changes: 13 additions & 0 deletions tests/07-biossettings-reboot/biossettings-baseline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: system.metal.ironcore.dev/v1alpha1
kind: BIOSSettings
metadata:
name: (join('-', ['compatibility', $namespace, 'baseline']))
spec:
serverRef:
name: (join('-', ['compatibility', $namespace, 'system-0']))
version: ($values.biosVersion)
serverMaintenancePolicy: Enforced
settingsFlow:
- name: reboot
priority: 1
settings: (from_items([[($values.biosSettingRebootKey), ($values.biosSettingRebootBaselineValue)]]))
5 changes: 2 additions & 3 deletions tests/07-biossettings-reboot/biossettings-reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
version: ($values.biosVersion)
serverMaintenancePolicy: Enforced
settingsFlow:
- name: boot-mode
- name: reboot
priority: 1
settings:
BootMode: ($values.biosSettingRebootValue)
settings: (from_items([[($values.biosSettingRebootKey), ($values.biosSettingRebootValue)]]))
57 changes: 57 additions & 0 deletions tests/07-biossettings-reboot/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ spec:
name: (join('-', ['compatibility', $namespace, 'system-0']))
status:
state: Available
# Ensure that there is a baseline value set so that a run after an earlier
# successful run does not result in a no-op. The baseline reboots the server,
# so wait for it to become Available again before applying the target.
- name: prepare-baseline
try:
- apply:
file: biossettings-baseline.yaml
- assert:
resource:
apiVersion: system.metal.ironcore.dev/v1alpha1
kind: BIOSSettings
metadata:
name: (join('-', ['compatibility', $namespace, 'baseline']))
status:
state: Applied
- delete:
file: biossettings-baseline.yaml
- assert:
timeout: 15m
resource:
apiVersion: metal.ironcore.dev/v1alpha1
kind: Server
metadata:
name: (join('-', ['compatibility', $namespace, 'system-0']))
(annotations."metal.ironcore.dev/operation" == null): true
status:
state: Available
- name: apply-biossettings
try:
- apply:
Expand All @@ -45,6 +72,10 @@ spec:
name: (join('-', ['compatibility', $namespace, 'reboot']))
status:
state: Applied
(flowState[?name == 'reboot'] | [0]):
flowState: Applied
(conditions[?type == 'SettingsUpdateIssued'] | [0].status): "True"
(conditions[?type == 'RebootIssued'] | [0].status): "True"
- name: assert-server-available-again
try:
- assert:
Expand All @@ -57,3 +88,29 @@ spec:
(annotations."metal.ironcore.dev/operation" == null): true
status:
state: Available
- name: restore-baseline
try:
- delete:
file: biossettings-reboot.yaml
- apply:
file: biossettings-baseline.yaml
- assert:
resource:
apiVersion: system.metal.ironcore.dev/v1alpha1
kind: BIOSSettings
metadata:
name: (join('-', ['compatibility', $namespace, 'baseline']))
status:
state: Applied
- delete:
file: biossettings-baseline.yaml
- assert:
timeout: 15m
resource:
apiVersion: metal.ironcore.dev/v1alpha1
kind: Server
metadata:
name: (join('-', ['compatibility', $namespace, 'system-0']))
(annotations."metal.ironcore.dev/operation" == null): true
status:
state: Available
Loading