Skip to content

Commit

Permalink
ci: Test kata on new Kernel changes.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jcvenegas committed Jul 23, 2018
1 parent 7b5d62f commit 933c203
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .ci/lib.sh
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions .ci/test.sh
Expand Up @@ -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

Expand Down
20 changes: 19 additions & 1 deletion kernel/build-kernel_test.sh
Expand Up @@ -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

0 comments on commit 933c203

Please sign in to comment.