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 <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2018-10-22 09:53:28 +01:00
parent e74c431d7c
commit 8334d90979

View File

@ -6,12 +6,23 @@
set -e set -e
# The go binary isn't installed, but we checkout the repos to the standard
# golang locations.
export GOPATH=${GOPATH:-${HOME}/go}
info() info()
{ {
local msg="$*" local msg="$*"
echo "INFO: $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 # Run the kata manager to "execute" the install guide to ensure the commands
# it specified result in a working system. # it specified result in a working system.
test_distro_install_guide() test_distro_install_guide()
@ -23,8 +34,6 @@ test_distro_install_guide()
[ ! -e "$GOPATH" ] && die "cannot find $mgr" [ ! -e "$GOPATH" ] && die "cannot find $mgr"
source /etc/os-release
info "Installing system from the $ID install guide" info "Installing system from the $ID install guide"
$mgr install-docker-system $mgr install-docker-system
@ -95,4 +104,5 @@ check_install_docs()
run_tests run_tests
} }
setup
check_install_docs check_install_docs