mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 08:47:56 +00:00
CI: Improve doc test script setup function
Make `setup()` clone the tests repo and check for the `kata-manager` script. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
4b1839fc37
commit
83c38c229e
@ -11,6 +11,20 @@ set -e
|
|||||||
export GOPATH=${GOPATH:-${HOME}/go}
|
export GOPATH=${GOPATH:-${HOME}/go}
|
||||||
|
|
||||||
typeset -r docker_image="busybox"
|
typeset -r docker_image="busybox"
|
||||||
|
typeset -r kata_project_url="github.com/kata-containers"
|
||||||
|
typeset -r test_repo="${kata_project_url}/tests"
|
||||||
|
typeset -r test_repo_url="https://${test_repo}"
|
||||||
|
typeset -r test_repo_dir="${GOPATH}/src/${test_repo}"
|
||||||
|
typeset -r kata_project_dir="${GOPATH}/src/${kata_project_url}"
|
||||||
|
|
||||||
|
typeset -r mgr="${test_repo_dir}/cmd/kata-manager/kata-manager.sh"
|
||||||
|
|
||||||
|
die()
|
||||||
|
{
|
||||||
|
local msg="$*"
|
||||||
|
echo >&2 "ERROR: $msg"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
info()
|
info()
|
||||||
{
|
{
|
||||||
@ -18,11 +32,25 @@ info()
|
|||||||
echo "INFO: $msg"
|
echo "INFO: $msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Grab a copy of the tests repository
|
||||||
|
get_tests_repo()
|
||||||
|
{
|
||||||
|
[ -d "${test_repo_dir}" ] && return
|
||||||
|
|
||||||
|
mkdir -p "${kata_project_dir}"
|
||||||
|
|
||||||
|
git clone "${test_repo_url}" "${test_repo_dir}"
|
||||||
|
}
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
source /etc/os-release || source /usr/lib/os-release
|
source /etc/os-release || source /usr/lib/os-release
|
||||||
|
|
||||||
mkdir -p "${GOPATH}"
|
mkdir -p "${GOPATH}"
|
||||||
|
|
||||||
|
get_tests_repo
|
||||||
|
|
||||||
|
[ -e "$mgr" ] || die "cannot find $mgr"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Perform a simple test to create a container
|
# Perform a simple test to create a container
|
||||||
@ -40,10 +68,6 @@ create_kata_container()
|
|||||||
# it specified result in a working system.
|
# it specified result in a working system.
|
||||||
test_distro_install_guide()
|
test_distro_install_guide()
|
||||||
{
|
{
|
||||||
local -r mgr="${GOPATH}/src/github.com/kata-containers/tests/cmd/kata-manager/kata-manager.sh"
|
|
||||||
|
|
||||||
[ ! -e "$GOPATH" ] && die "cannot find $mgr"
|
|
||||||
|
|
||||||
info "Installing system from the $ID install guide"
|
info "Installing system from the $ID install guide"
|
||||||
|
|
||||||
$mgr install-docker-system
|
$mgr install-docker-system
|
||||||
|
Loading…
Reference in New Issue
Block a user