forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Added s390x support for CI scripts
Adds support for s390x to the CI scripts. Hot Plug CPUs is currently not working on s390x and was disabled in the Test-Configuration Fixes: kata-containers#1129 Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
- Loading branch information
Showing
14 changed files
with
295 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
lib_script="${GOPATH}/src/${tests_repo}/.ci/lib.sh" | ||
source "${lib_script}" | ||
|
||
gen_clean_arch || info "Arch cleanup scripts failed" |
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,22 @@ | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
test: | ||
- functional | ||
- docker | ||
|
||
# Same model as is for aarch64 | ||
docker: | ||
Describe: | ||
- CPUs and CPU set | ||
- Update number of CPUs | ||
- Hot plug CPUs | ||
- Update CPU constraints | ||
- Hotplug memory | ||
- update memory constraints | ||
Context: | ||
- remove bind-mount source before container exits | ||
- run container exceeding memory constraints | ||
It: |
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,51 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -e | ||
|
||
GOPATH_LOCAL="${GOPATH%%:*}" | ||
kata_dir="${GOPATH_LOCAL}/src/github.com/kata-containers" | ||
test_dir="${kata_dir}/tests" | ||
ci_dir="${test_dir}/.ci" | ||
test_config_file="${ci_dir}/s390x/configuration_s390x.yaml" | ||
|
||
describe_skip_flag="docker.Describe" | ||
context_skip_flag="docker.Context" | ||
it_skip_flag="docker.It" | ||
|
||
# value for '-skip' in ginkgo | ||
_skip_options=() | ||
|
||
filter_and_build() | ||
{ | ||
local dependency="$1" | ||
local array_docker=$("${GOPATH_LOCAL}/bin/yq" read "${test_config_file}" "${dependency}") | ||
[ "${array_docker}" = "null" ] && return | ||
mapfile -t _array_docker <<< "${array_docker}" | ||
for entry in "${_array_docker[@]}" | ||
do | ||
_skip_options+=("${entry#- }|") | ||
done | ||
} | ||
|
||
main() | ||
{ | ||
# build skip option based on Describe block | ||
filter_and_build "${describe_skip_flag}" | ||
|
||
# build skip option based on context block | ||
filter_and_build "${context_skip_flag}" | ||
|
||
# build skip option based on it block | ||
filter_and_build "${it_skip_flag}" | ||
|
||
skip_options=$(IFS= ; echo "${_skip_options[*]}") | ||
|
||
echo "${skip_options%|}" | ||
} | ||
|
||
main |
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,33 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -e | ||
|
||
GOPATH_LOCAL="${GOPATH%%:*}" | ||
kata_dir="${GOPATH_LOCAL}/src/github.com/kata-containers" | ||
test_dir="${kata_dir}/tests" | ||
ci_dir="${test_dir}/.ci" | ||
test_config_file="${ci_dir}/s390x/configuration_s390x.yaml" | ||
|
||
test_filter_flag="test" | ||
|
||
_test_union=() | ||
|
||
main() | ||
{ | ||
local array_test=$("${GOPATH_LOCAL}/bin/yq" read "${test_config_file}" "${test_filter_flag}") | ||
[ "${array_test}" = "null" ] && return | ||
mapfile -t _array_test <<< "${array_test}" | ||
for entry in "${_array_test[@]}" | ||
do | ||
_test_union+=("${entry#- }") | ||
done | ||
test_union=$(IFS=" "; echo "${_test_union[*]}") | ||
echo "${test_union}" | ||
} | ||
|
||
main |
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,63 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -e | ||
|
||
CURRENT_QEMU_VERSION=$(get_version "assets.hypervisor.qemu.version") | ||
PACKAGED_QEMU="qemu" | ||
|
||
[ "$ID" == "ubuntu" ] || die "Unsupported distro: $ID" | ||
|
||
get_packaged_qemu_version() { | ||
if [ "$ID" == "ubuntu" ]; then | ||
sudo apt-get update > /dev/null | ||
qemu_version=$(apt-cache madison $PACKAGED_QEMU \ | ||
| awk '{print $3}' | cut -d':' -f2 | cut -d'+' -f1 | head -n 1 ) | ||
fi | ||
|
||
if [ -z "$qemu_version" ]; then | ||
die "unknown qemu version" | ||
else | ||
echo "${qemu_version}" | ||
fi | ||
} | ||
|
||
install_packaged_qemu() { | ||
sudo apt install -y "$PACKAGED_QEMU" | ||
} | ||
|
||
build_and_install_qemu() { | ||
QEMU_REPO=$(get_version "assets.hypervisor.qemu.url") | ||
# Remove 'https://' from the repo url to be able to clone the repo using 'go get' | ||
QEMU_REPO_PATH=${QEMU_REPO/https:\/\//} | ||
|
||
PACKAGING_REPO="github.com/kata-containers/packaging" | ||
QEMU_CONFIG_SCRIPT="${GOPATH}/src/${PACKAGING_REPO}/scripts/configure-hypervisor.sh" | ||
|
||
if [ ! -d "${GOPATH}/src/${QEMU_REPO_PATH}" ]; then | ||
mkdir -p "${GOPATH}/src/${QEMU_REPO_PATH}" | ||
pushd "${GOPATH}/src/${QEMU_REPO_PATH}" | ||
chronic git clone "${QEMU_REPO}" "." | ||
popd | ||
fi | ||
|
||
go get -d "$PACKAGING_REPO" || true | ||
|
||
pushd "${GOPATH}/src/${QEMU_REPO_PATH}" | ||
git fetch | ||
git checkout "$CURRENT_QEMU_VERSION" | ||
[ -d "capstone" ] || git clone https://github.com/qemu/capstone.git capstone | ||
[ -d "ui/keycodemapdb" ] || git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb | ||
|
||
echo "Build Qemu" | ||
"${QEMU_CONFIG_SCRIPT}" "qemu" | xargs ./configure | ||
make -j $(nproc) | ||
|
||
echo "Install Qemu" | ||
sudo -E make install | ||
popd | ||
} |
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,23 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -e | ||
|
||
OSBUILDER_DISTRO="ubuntu" | ||
AGENT_INIT="yes" | ||
|
||
#packaged kata agent haven't been supported in any mainstream distribution | ||
get_packaged_agent_version() { | ||
version="" | ||
echo "$version" | ||
} | ||
|
||
#packaged kata image haven't been supported in any mainstream distribution | ||
install_packaged_image() { | ||
info "installing packaged kata-image not supported in s390x" | ||
return 1 | ||
} |
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,24 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set -e | ||
|
||
filter_test_script="${cidir}/${arch}/filter_test_s390x.sh" | ||
|
||
check_test_union() | ||
{ | ||
local test_union=$(bash -f ${filter_test_script}) | ||
flag="$1" | ||
# regex match | ||
[[ ${test_union} =~ ${flag} ]] && echo "true" | ||
|
||
echo "false" | ||
} | ||
|
||
CRIO=$(check_test_union crio) | ||
KUBERNETES=$(check_test_union kubernetes) | ||
OPENSHIFT=$(check_test_union openshift) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# Copyright (c) 2019 IBM | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# union for 'make test' | ||
UNION := $(shell bash -f .ci/s390x/filter_test_s390x.sh) | ||
|
||
# skiped test suites for docker integration tests | ||
SKIP := $(shell bash -f .ci/s390x/filter_docker_s390x.sh) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// +build !s390x | ||
|
||
// Copyright (c) 2019 IBM | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package docker | ||
|
||
const ( | ||
// CentosImage is the centos image | ||
CentosImage = "centos" | ||
) |
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,10 @@ | ||
// Copyright (c) 2019 IBM | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package docker | ||
|
||
const ( | ||
// On s390x there is not centos image, instead the clefos image could be used | ||
CentosImage = "clefos" | ||
) |