r-builds/test/test-zypper.sh
2022-08-17 14:30:55 -05:00

26 lines
768 B
Shell
Executable file

#!/usr/bin/env bash
set -ex
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# Install quick install script prerequisites
if ! command -v curl > /dev/null 2>&1; then
zypper --non-interactive install curl
fi
# Run the quick install script. Use a locally built file if present, otherwise from the CDN.
tmpdir=$(mktemp -d)
cp -r "${SCRIPT_DIR}/../builder/integration/tmp/${OS_IDENTIFIER}/." "$tmpdir" > /dev/null 2>&1 || true
(cd "$tmpdir" && SCRIPT_ACTION=install R_VERSION="${R_VERSION}" RUN_UNATTENDED=1 "${SCRIPT_DIR}/../install.sh")
# Show RPM info
rpm -qi "R-${R_VERSION}"
"${SCRIPT_DIR}/test-r.sh"
zypper --non-interactive remove "R-${R_VERSION}"
if [ -d "/opt/R/${R_VERSION}" ]; then
echo "Failed to uninstall completely"
exit 1
fi