-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1520 from Nordix/lentzi90/bmo-e2e-virtualmedia
🌱 Test virtualmedia booting
- Loading branch information
Showing
10 changed files
with
87 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ | |
# Description: This script sets up the environment and runs E2E tests for the | ||
# BMO project. It uses either vbmc or sushy-tools based on | ||
# the BMO_E2E_EMULATOR environment variable. | ||
# With sushy-tools, it is also possible to choose between | ||
# redfish-virtualmedia and redfish protocols using the | ||
# SUSHY_TOOLS_PROTOCOL environment variable. | ||
# By default, sushy-tools and redfish-virtualmedia will be used. | ||
# Usage: export BMO_E2E_EMULATOR="vbmc" # Or "sushy-tools" | ||
# ./ci-e2e.sh | ||
# ----------------------------------------------------------------------------- | ||
|
@@ -16,6 +20,8 @@ cd "${REPO_ROOT}" || exit 1 | |
|
||
# BMO_E2E_EMULATOR can be set to either "vbmc" or "sushy-tools" | ||
BMO_E2E_EMULATOR=${BMO_E2E_EMULATOR:-"sushy-tools"} | ||
# We can choose to use redfish-virtualmedia or redfish as the protocol when using sushy-tools | ||
SUSHY_TOOLS_PROTOCOL=${SUSHY_TOOLS_PROTOCOL:-"redfish-virtualmedia"} | ||
|
||
export E2E_CONF_FILE="${REPO_ROOT}/test/e2e/config/ironic.yaml" | ||
|
||
|
@@ -68,6 +74,8 @@ rm /tmp/bmo-e2e.tar | |
IP_ADDRESS="192.168.222.1" | ||
|
||
if [[ "${BMO_E2E_EMULATOR}" == "vbmc" ]]; then | ||
BMC_PROTOCOL="ipmi" | ||
export E2E_BMCS_CONF_FILE="${REPO_ROOT}/test/e2e/config/bmcs-ipmi.yaml" | ||
# Start VBMC | ||
docker run --name vbmc --network host -d \ | ||
-v /var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock \ | ||
|
@@ -76,6 +84,8 @@ if [[ "${BMO_E2E_EMULATOR}" == "vbmc" ]]; then | |
|
||
|
||
elif [[ "${BMO_E2E_EMULATOR}" == "sushy-tools" ]]; then | ||
BMC_PROTOCOL=${SUSHY_TOOLS_PROTOCOL} | ||
export E2E_BMCS_CONF_FILE="${REPO_ROOT}/test/e2e/config/bmcs-${SUSHY_TOOLS_PROTOCOL}.yaml" | ||
# Sushy-tools variables | ||
SUSHY_EMULATOR_FILE="${REPO_ROOT}"/test/e2e/sushy-tools/sushy-emulator.conf | ||
|
||
|
@@ -91,7 +101,6 @@ else | |
exit 1 | ||
fi | ||
|
||
export E2E_BMCS_CONF_FILE="${REPO_ROOT}/test/e2e/config/bmcs-${BMO_E2E_EMULATOR}.yaml" | ||
"${REPO_ROOT}/hack/create_bmcs.sh" "${E2E_BMCS_CONF_FILE}" baremetal-e2e | ||
|
||
# Set the number of ginkgo processes to the number of BMCs | ||
|
@@ -106,16 +115,42 @@ export IMAGE_URL="http://${IP_ADDRESS}/${IMAGE_FILE}" | |
IMAGE_DIR="${REPO_ROOT}/test/e2e/images" | ||
mkdir -p "${IMAGE_DIR}" | ||
|
||
## Download and run image server | ||
wget --quiet -P "${IMAGE_DIR}"/ https://artifactory.nordix.org/artifactory/metal3/images/iso/"${IMAGE_FILE}" | ||
## Download disk images | ||
wget --quiet -P "${IMAGE_DIR}/" https://artifactory.nordix.org/artifactory/metal3/images/iso/"${IMAGE_FILE}" | ||
wget --quiet -P "${IMAGE_DIR}/" https://fastly-cdn.system-rescue.org/releases/11.00/systemrescue-11.00-amd64.iso | ||
|
||
## Start the image server | ||
docker run --name image-server-e2e -d \ | ||
-p 80:8080 \ | ||
-v "${IMAGE_DIR}:/usr/share/nginx/html" nginxinc/nginx-unprivileged | ||
|
||
# Generate the key pair | ||
# Generate ssh key pair for verifying provisioned BMHs | ||
ssh-keygen -t ed25519 -f "${IMAGE_DIR}/ssh_testkey" -q -N "" | ||
|
||
# Build an ISO image with baked ssh key | ||
# See https://www.system-rescue.org/scripts/sysrescue-customize/ | ||
# We use the systemrescue ISO and their script for customizing it. | ||
pushd "${IMAGE_DIR}" | ||
wget -O sysrescue-customize https://gitlab.com/systemrescue/systemrescue-sources/-/raw/main/airootfs/usr/share/sysrescue/bin/sysrescue-customize?inline=false | ||
chmod +x sysrescue-customize | ||
|
||
pub_ssh_key=$(cut -d " " -f "1,2" "ssh_testkey.pub") | ||
|
||
mkdir -p recipe/iso_add/sysrescue.d | ||
# Reference: https://www.system-rescue.org/manual/Configuring_SystemRescue/ | ||
cat << EOF > recipe/iso_add/sysrescue.d/90-config.yaml | ||
--- | ||
global: | ||
nofirewall: true | ||
sysconfig: | ||
authorized_keys: | ||
"[email protected]": "${pub_ssh_key}" | ||
EOF | ||
|
||
./sysrescue-customize --auto --recipe-dir recipe --source systemrescue-11.00-amd64.iso --dest=sysrescue-out.iso | ||
export ISO_IMAGE_URL="http://${IP_ADDRESS}/sysrescue-out.iso" | ||
popd | ||
|
||
# Generate credentials | ||
BMO_OVERLAYS=("${REPO_ROOT}/config/overlays/e2e" "${REPO_ROOT}/config/overlays/e2e-release-0.4" "${REPO_ROOT}/config/overlays/e2e-release-0.5") | ||
IRONIC_OVERLAY="${REPO_ROOT}/ironic-deployment/overlays/e2e" | ||
|
@@ -157,6 +192,6 @@ sudo sh -c "cp -r /var/log/libvirt/qemu/* ${LOGS_DIR}/qemu/" | |
sudo chown -R "${USER}:${USER}" "${LOGS_DIR}/qemu" | ||
|
||
# Collect all artifacts | ||
tar --directory test/e2e/ -czf "artifacts-e2e-${BMO_E2E_EMULATOR}.tar.gz" _artifacts | ||
tar --directory test/e2e/ -czf "artifacts-e2e-${BMO_E2E_EMULATOR}-${BMC_PROTOCOL}.tar.gz" _artifacts | ||
|
||
exit "${test_status}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- user: admin | ||
password: password | ||
address: "redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-0" | ||
bootMacAddress: "00:60:2f:31:81:01" | ||
hostName: "bmo-e2e-0" | ||
ipAddress: "192.168.222.122" | ||
sshPort: "22" | ||
- user: admin | ||
password: password | ||
address: "redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmo-e2e-1" | ||
bootMacAddress: "00:60:2f:31:81:02" | ||
hostName: "bmo-e2e-1" | ||
ipAddress: "192.168.222.123" | ||
sshPort: "22" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters