Skip to content

Commit 3de4a7a

Browse files
committed
E2E: Expose more BMC fields
This makes it possible to specify the rootDeviceHints in the "BMCs" config file for e2e tests. It is necessary when running the tests against real hardware that may have different disk devices. It also adds bootMode and disableCertificateVerification that may be needed depending on the hardware. Signed-off-by: Lennart Jern <[email protected]>
1 parent 6c9cf0e commit 3de4a7a

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

test/e2e/bmc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package e2e
66
import (
77
"os"
88

9+
metal3api "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
910
"gopkg.in/yaml.v2"
1011
)
1112

@@ -18,8 +19,12 @@ type BMC struct {
1819
Password string `yaml:"password,omitempty"`
1920
// Address of the BMC, e.g. "redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-1".
2021
Address string `yaml:"address,omitempty"`
22+
// DisableCertificateVerification indicates whether to disable certificate verification for the BMC connection.
23+
DisableCertificateVerification bool `yaml:"disableCertificateVerification,omitempty"`
2124
// BootMacAddress is the MAC address of the VMs network interface.
2225
BootMacAddress string `yaml:"bootMacAddress,omitempty"`
26+
// BootMode is the boot mode for the BareMetalHost, e.g. "UEFI" or "legacy".
27+
BootMode metal3api.BootMode `yaml:"bootMode,omitempty"`
2328
// Name of the machine associated with this BMC.
2429
Name string `yaml:"name,omitempty"`
2530
// NetworkName is the name of the network that the new VM should be attached to
@@ -28,6 +33,8 @@ type BMC struct {
2833
// This will be paired with the MAC address in the DHCP configuration.
2934
// Example: 192.168.222.122
3035
IPAddress string `yaml:"ipAddress,omitempty"`
36+
// RootDeviceHints provides guidance for where to write the disk image.
37+
RootDeviceHints metal3api.RootDeviceHints `yaml:"rootDeviceHints,omitempty"`
3138
}
3239

3340
func LoadBMCConfig(configPath string) ([]BMC, error) {

test/e2e/config/bmcs-ipmi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
bootMacAddress: "00:60:2f:31:81:01"
55
name: "bmo-e2e-0"
66
ipAddress: "192.168.222.122"
7+
rootDeviceHints:
8+
deviceName: "/dev/vda"
79
- user: admin
810
password: password
911
address: "ipmi://192.168.222.1:16231"
1012
bootMacAddress: "00:60:2f:31:81:02"
1113
name: "bmo-e2e-1"
1214
ipAddress: "192.168.222.123"
15+
rootDeviceHints:
16+
deviceName: "/dev/vda"

test/e2e/config/bmcs-redfish-virtualmedia.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
bootMacAddress: "00:60:2f:31:81:01"
55
name: "bmo-e2e-0"
66
ipAddress: "192.168.222.122"
7+
rootDeviceHints:
8+
deviceName: "/dev/vda"
79
- user: admin
810
password: password
911
address: "redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-1"
1012
bootMacAddress: "00:60:2f:31:81:02"
1113
name: "bmo-e2e-1"
1214
ipAddress: "192.168.222.123"
15+
rootDeviceHints:
16+
deviceName: "/dev/vda"

test/e2e/config/bmcs-redfish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
bootMacAddress: "00:60:2f:31:81:01"
55
name: "bmo-e2e-0"
66
ipAddress: "192.168.222.122"
7+
rootDeviceHints:
8+
deviceName: "/dev/vda"
79
- user: admin
810
password: password
911
address: "redfish+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-1"
1012
bootMacAddress: "00:60:2f:31:81:02"
1113
name: "bmo-e2e-1"
1214
ipAddress: "192.168.222.123"
15+
rootDeviceHints:
16+
deviceName: "/dev/vda"

test/e2e/provisioning_and_annotation_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ var _ = Describe("Provision, detach, recreate from status and deprovision", Labe
8686
Checksum: e2eConfig.GetVariable("IMAGE_CHECKSUM"),
8787
ChecksumType: metal3api.AutoChecksum,
8888
}
89-
bmh.Spec.RootDeviceHints = &metal3api.RootDeviceHints{
90-
DeviceName: "/dev/vda",
91-
}
89+
bmh.Spec.RootDeviceHints = &bmc.RootDeviceHints
9290
// The ssh check is not possible in all situations (e.g. fixture) so it can be skipped
9391
if e2eConfig.GetVariable("SSH_CHECK_PROVISIONED") == "true" {
9492
userDataSecretName := "user-data"
@@ -216,9 +214,7 @@ var _ = Describe("Provision, detach, recreate from status and deprovision", Labe
216214
URL: e2eConfig.GetVariable("IMAGE_URL"),
217215
Checksum: e2eConfig.GetVariable("IMAGE_CHECKSUM"),
218216
},
219-
RootDeviceHints: &metal3api.RootDeviceHints{
220-
DeviceName: "/dev/vda",
221-
},
217+
RootDeviceHints: &bmc.RootDeviceHints,
222218
},
223219
}
224220

0 commit comments

Comments
 (0)