CI: Add setup function to doc test script
Create a `setup()` function in the test script used to test
the install documents.
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
