From 801edca94b7acdd018e08ea27dc4d0168d1b5e34 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Tue, 26 Apr 2022 18:54:06 +0900 Subject: [PATCH] ci-automation: add GCE image test The GCE image test runs on a single instance type for now. In the future it would be good to test the new NIC type with the cl.internet test. --- ci-automation/ci-config.env | 5 ++ ci-automation/vendor-testing/gce.sh | 81 +++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100755 ci-automation/vendor-testing/gce.sh diff --git a/ci-automation/ci-config.env b/ci-automation/ci-config.env index e8ff979e05..20e2bf4f01 100644 --- a/ci-automation/ci-config.env +++ b/ci-automation/ci-config.env @@ -77,3 +77,8 @@ EQUINIXMETAL_arm64_MORE_INSTANCE_TYPES="" # -- PXE -- PXE_KERNEL_NAME="flatcar_production_pxe.vmlinuz" PXE_IMAGE_NAME="flatcar_production_pxe_image.cpio.gz" + +GCE_IMAGE_NAME="flatcar_production_gce.tar.gz" +GCE_GCS_IMAGE_UPLOAD="gs://flatcar-jenkins/developer/gce-ci" +GCE_MACHINE_TYPE="${GCE_MACHINE_TYPE:-n1-standard-2}" +GCE_PARALLEL="${PARALLEL_TESTS:-4}" diff --git a/ci-automation/vendor-testing/gce.sh b/ci-automation/vendor-testing/gce.sh new file mode 100755 index 0000000000..c811589bdf --- /dev/null +++ b/ci-automation/vendor-testing/gce.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# Copyright (c) 2022 The Flatcar Maintainers. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -euo pipefail + +# Test execution script for the GCE vendor image. +# This script is supposed to run in the mantle container. + +work_dir="$1"; shift +arch="$1"; shift +vernum="$1"; shift +tapfile="$1"; shift + +# $@ now contains tests / test patterns to run + +source ci-automation/ci_automation_common.sh +source sdk_lib/sdk_container_common.sh + +mkdir -p "${work_dir}" +cd "${work_dir}" + +# We never run GCE on arm64, so for now fail it as an +# unsupported option. +if [[ "${arch}" == "arm64" ]]; then + echo "1..1" > "${tapfile}" + echo "not ok - all GCE tests" >> "${tapfile}" + echo " ---" >> "${tapfile}" + echo " ERROR: ARM64 tests not supported on GCE." | tee -a "${tapfile}" + echo " ..." >> "${tapfile}" + exit 1 +fi + +channel="$(get_git_channel)" +if [[ "${channel}" = 'developer' ]]; then + channel='alpha' +fi +testscript="$(basename "$0")" + +# Create temp file and delete it immediately +echo "${GCP_JSON_KEY}" | base64 --decode > /tmp/gcp_auth +exec {gcp_auth}