Skip to content

Commit

Permalink
Test OCI
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 24, 2025
1 parent 7ae96bb commit 0613e90
Showing 1 changed file with 17 additions and 30 deletions.
47 changes: 17 additions & 30 deletions tests/vagrant/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function check_hw() {
# Outputs: None
#############################################################################################
function add-repo-deb() {
mkdir -p "$HOME"/.gnupg && chmod 700 "$HOME"/.gnupg
mkdir -p -m 700 $HOME/.gnupg
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://nexus.onlyoffice.com/repository/4testing-debian stable main" | \
sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | \
Expand Down Expand Up @@ -165,33 +165,20 @@ function prepare_vm() {
if [ -f /etc/os-release ]; then
source /etc/os-release
case $ID in
ubuntu)
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-deb
;;

debian)
[ "$VERSION_CODENAME" == "bookworm" ] && apt-get update -y && apt install -y curl gnupg
apt-get remove postfix -y && echo "${COLOR_GREEN}☑ PREPAVE_VM: Postfix was removed${COLOR_RESET}"
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-deb
;;

fedora)
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-rpm
if [[ "$VERSION_ID" == "40" || "$VERSION_ID" == "41" ]]; then
resize_fedora_disk
fi
;;

centos)
[ "$VERSION_ID" == "8" ] && sed -i 's|^mirrorlist=|#&|; s|^#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|' /etc/yum.repos.d/CentOS-*
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-rpm
yum -y install centos*-release
;;

debian | ubuntu)
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-deb ;;
centos | fedora )
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-rpm ;;
*)
echo "${COLOR_RED}Failed to determine Linux dist${COLOR_RESET}"; exit 1
;;
echo "${COLOR_RED}Failed to determine Linux dist${COLOR_RESET}"; exit 1 ;;
esac

if [[ "$ID" == "debian" ]]; then
[ "$VERSION_CODENAME" == "bookworm" ] && apt-get update -y && apt install -y curl gnupg
apt-get remove postfix -y && echo "${COLOR_GREEN}☑ PREPAVE_VM: Postfix was removed${COLOR_RESET}"
elif [[ "$ID" == "fedora" ]]; then
resize_fedora_disk
fi
else
echo "${COLOR_RED}File /etc/os-release doesn't exist${COLOR_RESET}"; exit 1
fi
Expand Down Expand Up @@ -231,7 +218,7 @@ function install_docspace() {
function healthcheck_systemd_services() {
for service in "${SERVICES_SYSTEMD[@]}"; do
[[ "$service" == *migration* ]] && continue;
if systemctl is-active --quiet "${service}"; then
if systemctl is-active --quiet ${service}; then
echo "${COLOR_GREEN}☑ OK: Service ${service} is running${COLOR_RESET}"
else
echo "${COLOR_RED}⚠ FAILED: Service ${service} is not running${COLOR_RESET}"
Expand Down Expand Up @@ -272,12 +259,12 @@ function healthcheck_general_status() {
# This function succeeds even if the file for cat was not found. For that use ${SKIP_EXIT} variable
#############################################################################################
function services_logs() {
mapfile -t SERVICES_SYSTEMD < <(awk '/SERVICE_NAME=\(/{flag=1; next} /\)/{flag=0} flag' "build.sh" | sed -E 's/^[[:space:]]*|[[:space:]]*$//g; s/^/docspace-/; s/$/.service/')
SERVICES_SYSTEMD=($(awk '/SERVICE_NAME=\(/{flag=1; next} /\)/{flag=0} flag' "build.sh" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed 's/^/docspace-/' | sed 's/$/.service/'))
SERVICES_SYSTEMD+=("ds-converter.service" "ds-docservice.service" "ds-metrics.service")

for service in "${SERVICES_SYSTEMD[@]}"; do
echo $LINE_SEPARATOR && echo "${COLOR_GREEN}Check logs for systemd service: $service${COLOR_RESET}" && echo $LINE_SEPARATOR
journalctl -u "$service" -n 30 || true
journalctl -u $service -n 30 || true
done

local DOCSPACE_LOGS_DIR="/var/log/onlyoffice/docspace"
Expand All @@ -304,4 +291,4 @@ main() {
healthcheck_general_status
}

main
main

0 comments on commit 0613e90

Please sign in to comment.