From 8334d90979b4dd2c0172a28272ebcb05aefad297 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 22 Oct 2018 09:53:28 +0100 Subject: [PATCH] CI: Add setup function to doc test script Create a `setup()` function in the test script used to test the install documents. Signed-off-by: James O. D. Hunt --- .ci/test-install-docs.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.ci/test-install-docs.sh b/.ci/test-install-docs.sh index 09971bc8a3..fffebac28a 100755 --- a/.ci/test-install-docs.sh +++ b/.ci/test-install-docs.sh @@ -6,12 +6,23 @@ set -e +# The go binary isn't installed, but we checkout the repos to the standard +# golang locations. +export GOPATH=${GOPATH:-${HOME}/go} + info() { local msg="$*" echo "INFO: $msg" } +setup() +{ + source /etc/os-release || source /usr/lib/os-release + + mkdir -p "${GOPATH}" +} + # Run the kata manager to "execute" the install guide to ensure the commands # it specified result in a working system. test_distro_install_guide() @@ -23,8 +34,6 @@ test_distro_install_guide() [ ! -e "$GOPATH" ] && die "cannot find $mgr" - source /etc/os-release - info "Installing system from the $ID install guide" $mgr install-docker-system @@ -95,4 +104,5 @@ check_install_docs() run_tests } +setup check_install_docs