ci: Test kata on new Kernel changes.

Add testing to make sure new kernel changes does not break Kata.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz 2018-07-12 09:55:30 -05:00
parent 7b5d62fb74
commit 933c2031a4
3 changed files with 39 additions and 1 deletions

View File

@ -11,6 +11,21 @@ die(){
exit 1
}
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
export tests_repo_dir="$GOPATH/src/$tests_repo"
clone_tests_repo()
{
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
# no existing clone.
if [ -d "${tests_repo_dir}" ] && [ -n "${KATA_CI_NO_NETWORK:-}" ]
then
return
fi
go get -d -u "$tests_repo" || true
}
install_yq() {
GOPATH=${GOPATH:-${HOME}/go}
local yq_path="${GOPATH}/bin/yq"

View File

@ -31,6 +31,11 @@ make_target() {
test-build-kernel)
[ -n "${CI}" ] && check_kata_kernel_version
# Setup testing script to test Kata with new kernel changes.
[ -n "${CI}" ] && clone_tests_repo &&
pushd "${tests_repo_dir}" &&
.ci/setup.sh &&
popd
;;
esac

View File

@ -71,7 +71,25 @@ build_kernel() {
OK
}
pushd ${tmp_dir}
test_kata() {
local cidir="${script_dir}/../.ci/"
echo "test kata with new kernel config"
[ -z "${CI:-}" ] && echo "skip: Not in CI" && return
echo "Setup kernel source"
${build_kernel_sh} setup
echo "Build kernel"
${build_kernel_sh} build
echo "Install kernel"
sudo -E PATH="$PATH" "${build_kernel_sh}" install
source "${cidir}/lib.sh"
pushd "${tests_repo_dir:-no-defined}"
.ci/run.sh
popd
}
pushd "${tmp_dir}"
check_help
build_kernel
test_kata
popd