Files
kata-containers/tests/test_config.sh
Yang Bo 1a7b735c3c rootfs-builder: build rust agent using osbuilder
Build rust agent and go agent using the same rootfs bulder image.
When building rust agent, just add RUST_AGENT=yes before command line.
The documentation will be updated later

Depends-on: github.com/kata-containers/tests#2287

Fixes: #360

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-07 21:47:33 +08:00

69 lines
1.6 KiB
Bash

#
# Copyright (c) 2018 SUSE LLC
#
# SPDX-License-Identifier: Apache-2.0
# List of distros not to test, when running all tests with test_images.sh
typeset -a skipWhenTestingAll
typeset -a distros
arch="$(uname -m)"
sdir="${BASH_SOURCE[0]%/*}"
for distro in $(${sdir}/../rootfs-builder/rootfs.sh -l); do
distros+=("${distro}")
done
test_distros=()
test_distros+=("clearlinux")
test_distros+=("ubuntu")
skipForRustDistros=()
skipForRustDistros+=("alpine")
skipForRustDistros+=("euleros")
skipForRustArch=()
skipForRustArch+=("ppc64le")
skipForRustArch+=("s390x")
distro_in_set() {
local d=$1
shift
local dt
for dt in "$@"; do
if [ "${dt}" == "${d}" ]; then
return 0
fi
done
return 1
}
if [ -n "${CI:-}" ]; then
# CI tests may timeout with euleros, see:
# https://github.com/kata-containers/osbuilder/issues/46"
# Since too many distros timeout for now, we only test clearlinux and ubuntu. We can enable other distros when we fix timeout problem.
for distro in "${distros[@]}"; do
if distro_in_set "${distro}" "${test_distros[@]}"; then
continue
fi
skipWhenTestingAll+=("${distro}")
done
if [ "${RUST_AGENT:-}" == "yes" ]; then
# add skipForRustDistros to skipWhenTestingAll if it is not
for td in "${skipForRustDistros[@]}"; do
if distro_in_set "${td}" "${skipWhenTestingAll[@]}"; then
continue
fi
# not found in skipWhenTestingAll, add to it
skipWhenTestingAll+=("${td}")
done
if distro_in_set "${arch}" "${skipForRustArch[@]}"; then
for distro in "${test_distros[@]}"; do
if distro_in_set "${distro}" "${skipWhenTestingAll[@]}"; then
continue
fi
skipWhenTestingAll+=("${distro}")
done
fi
fi
fi