Skip to content

Commit 477f03b

Browse files
committed
ci-automation: add brightbox testing
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
1 parent 3882897 commit 477f03b

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

ci-automation/ci-config.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,8 @@ AZURE_LOCATION="${AZURE_LOCATION:-westeurope}"
155155
# -- Openstack --
156156
: ${OPENSTACK_IMAGE_NAME:='flatcar_production_openstack_image.img.gz'}
157157
OPENSTACK_PARALLEL="${PARALLEL_TESTS:-3}"
158+
159+
# -- Brightbox --
160+
: ${BRIGHTBOX_IMAGE_NAME:='flatcar_production_openstack_image.img'}
161+
BRIGHTBOX_PARALLEL="${PARALLEL_TESTS:-1}"
162+
: ${BRIGHTBOX_SERVER_TYPE:="2gb.ssd"}

ci-automation/garbage_collect.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ function _garbage_collect_impl() {
160160
--env GCP_JSON_KEY \
161161
--env VMWARE_ESX_CREDS \
162162
--env OPENSTACK_CREDS \
163+
--env BRIGHTBOX_CLIENT_ID --env BRIGHTBOX_CLIENT_SECRET \
163164
-w /work -v "$PWD":/work "${mantle_ref}" /work/ci-automation/garbage_collect_cloud.sh
164165

165166
echo

ci-automation/garbage_collect_cloud.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ timeout --signal=SIGQUIT 60m ore equinixmetal gc --duration 6h \
88
--project="${EQUINIXMETAL_PROJECT}" --gs-json-key=<(echo "${GCP_JSON_KEY}" | base64 --decode) --api-key="${EQUINIXMETAL_KEY}"
99
timeout --signal=SIGQUIT 60m ore openstack gc --duration 6h \
1010
--config-file=<(echo "${OPENSTACK_CREDS}" | base64 --decode)
11+
timeout --signal=SIGQUIT 60m ore brightbox gc --duration 6h \
12+
--brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" --brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
# Copyright (c) 2023 The Flatcar Maintainers.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
set -euo pipefail
7+
8+
# Test execution script for the Brightbox vendor.
9+
# This script is supposed to run in the mantle container.
10+
11+
source ci-automation/vendor_test.sh
12+
13+
# ARM64 is not supported on Brightbox, so for now fail it as an
14+
# unsupported option.
15+
if [[ "${CIA_ARCH}" == "arm64" ]]; then
16+
echo "1..1" > "${CIA_TAPFILE}"
17+
echo "not ok - all qemu tests" >> "${CIA_TAPFILE}"
18+
echo " ---" >> "${CIA_TAPFILE}"
19+
echo " ERROR: ARM64 tests not supported on Brightbox." | tee -a "${CIA_TAPFILE}"
20+
echo " ..." >> "${CIA_TAPFILE}"
21+
break_retest_cycle
22+
exit 1
23+
fi
24+
25+
# BRIGHTBOX_CLIENT_ID, BRIGHTBOX_CLIENT_SECRET should be provided by sdk_container/.env
26+
27+
# Upload the image on Brightbox.
28+
IMAGE_ID=$(ore brightbox create-image \
29+
--name=flatcar-"${CIA_VERNUM}" \
30+
--url="https://${BUILDCACHE_SERVER}/images/${CIA_ARCH}/${CIA_VERNUM}/${BRIGHTBOX_IMAGE_NAME}" \
31+
--brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" \
32+
--brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}"
33+
)
34+
35+
# Remove any left-over servers.
36+
ore brightbox remove-servers \
37+
--brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" \
38+
--brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}" || :
39+
40+
# Remove any left-over IPs.
41+
ore brightbox remove-ips \
42+
--brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" \
43+
--brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}" || :
44+
45+
# Delete the image once we exit.
46+
trap 'ore brightbox delete-image --brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" --brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}" --id "${IMAGE_ID}" || true' EXIT
47+
48+
kola_test_basename="ci-${CIA_VERNUM//+/-}"
49+
kola_test_basename="${kola_test_basename//[+.]/-}"
50+
51+
set -x
52+
53+
timeout --signal=SIGQUIT 2h kola run \
54+
--board="${CIA_ARCH}-usr" \
55+
--parallel="${BRIGHTBOX_PARALLEL}" \
56+
--tapfile="${CIA_TAPFILE}" \
57+
--channel="${CIA_CHANNEL}" \
58+
--basename="${kola_test_basename}" \
59+
--platform=brightbox \
60+
--brightbox-image="${IMAGE_ID}" \
61+
--brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" \
62+
--brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}" \
63+
--brightbox-server-type="${BRIGHTBOX_SERVER_TYPE}" \
64+
"${@}"
65+
66+
set +x

0 commit comments

Comments
 (0)