From 2e85f9325a797977eea9dfea0a925775ddd211d9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Feb 2021 12:49:00 +0100 Subject: Merging upstream version 1.29.0. Signed-off-by: Daniel Baumann --- tests/updater_checks.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 tests/updater_checks.sh (limited to 'tests/updater_checks.sh') diff --git a/tests/updater_checks.sh b/tests/updater_checks.sh new file mode 100755 index 000000000..dff87a670 --- /dev/null +++ b/tests/updater_checks.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env sh +# +# Wrapper script that installs the required dependencies +# for the BATS script to run successfully +# +# Copyright: SPDX-License-Identifier: GPL-3.0-or-later +# +# Author : Pavlos Emm. Katsoulakis /dev/null 2>&1; then + echo "Executing grep installation" + pacman -Sy + pacman --noconfirm --needed -S grep + fi +} +blind_arch_grep_install || echo "Workaround failed, proceed as usual" + +running_os="$(grep '^ID=' /etc/os-release | cut -d'=' -f2 | sed -e 's/"//g')" + +case "${running_os}" in +"centos"|"fedora"|"CentOS") + echo "Running on CentOS, updating YUM repository.." + yum clean all + yum update -y + + echo "Installing extra dependencies.." + yum install -y epel-release + yum install -y bats curl + ;; +"debian"|"ubuntu") + echo "Running ${running_os}, updating APT repository" + apt-get update -y + apt-get install -y bats curl + ;; +"opensuse-leap"|"opensuse-tumbleweed") + zypper update -y + zypper install -y bats curl + + # Fixes curl: (60) SSL certificate problem: unable to get local issuer certificate + # https://travis-ci.com/netdata/netdata/jobs/267573805 + update-ca-certificates + ;; +"arch") + pacman --noconfirm -Syu + pacman --noconfirm --needed -S bash-bats curl libffi + ;; +"alpine") + apk update + apk add bash curl bats + ;; +*) + echo "Running on ${running_os}, no repository preparation done" + ;; +esac + +# Run depednency scriptlet, before anything else +# +./packaging/installer/install-required-packages.sh --non-interactive netdata + +echo "Running BATS file.." +bats --tap tests/updater_checks.bats -- cgit v1.2.3