summaryrefslogtreecommitdiffstats
path: root/.github/scripts/pkg-test.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.github/scripts/pkg-test.sh60
1 files changed, 21 insertions, 39 deletions
diff --git a/.github/scripts/pkg-test.sh b/.github/scripts/pkg-test.sh
index 35767bf2e..f0c0dc11a 100755
--- a/.github/scripts/pkg-test.sh
+++ b/.github/scripts/pkg-test.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+SCRIPT_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
+
install_debian_like() {
# This is needed to ensure package installs don't prompt for any user input.
export DEBIAN_FRONTEND=noninteractive
@@ -19,7 +21,9 @@ install_debian_like() {
! -name '*dbgsym*' ! -name '*cups*' ! -name '*freeipmi*') || exit 3
# Install testing tools
- apt-get install -y --no-install-recommends curl "${netcat}" jq || exit 1
+ apt-get install -y --no-install-recommends curl dpkg-dev "${netcat}" jq || exit 1
+
+ dpkg-architecture --equal amd64 || NETDATA_SKIP_EBPF=1
}
install_fedora_like() {
@@ -38,6 +42,8 @@ install_fedora_like() {
# Install testing tools
"${PKGMGR}" install -y curl nc jq || exit 1
+
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
}
install_centos() {
@@ -60,6 +66,8 @@ install_centos() {
# Install testing tools
# shellcheck disable=SC2086
"${PKGMGR}" install -y ${opts} curl nc jq || exit 1
+
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
}
install_amazon_linux() {
@@ -76,6 +84,8 @@ install_amazon_linux() {
# Install testing tools
# shellcheck disable=SC2086
"${PKGMGR}" install -y ${opts} curl nc jq || exit 1
+
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
}
install_suse_like() {
@@ -88,43 +98,14 @@ install_suse_like() {
# Install testing tools
zypper install -y --allow-downgrade --no-recommends curl netcat-openbsd jq || exit 1
+
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
}
dump_log() {
cat ./netdata.log
}
-wait_for() {
- host="${1}"
- port="${2}"
- name="${3}"
- timeout="30"
-
- if command -v nc > /dev/null ; then
- netcat="nc"
- elif command -v netcat > /dev/null ; then
- netcat="netcat"
- else
- printf "Unable to find a usable netcat command.\n"
- return 1
- fi
-
- printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}"
-
- sleep 30
-
- i=0
- while ! ${netcat} -z "${host}" "${port}"; do
- sleep 1
- if [ "$i" -gt "$timeout" ]; then
- printf "Timed out!\n"
- return 1
- fi
- i="$((i + 1))"
- done
- printf "OK\n"
-}
-
case "${DISTRO}" in
debian | ubuntu)
install_debian_like
@@ -132,7 +113,7 @@ case "${DISTRO}" in
fedora | oraclelinux)
install_fedora_like
;;
- centos| centos-stream | rockylinux | almalinux)
+ centos | centos-stream | rockylinux | almalinux)
install_centos
;;
amazonlinux)
@@ -149,14 +130,15 @@ esac
trap dump_log EXIT
-/usr/sbin/netdata -D > ./netdata.log 2>&1 &
-
-wait_for localhost 19999 netdata || exit 1
+export NETDATA_LIBEXEC_PREFIX=/usr/libexec/netdata
+export NETDATA_SKIP_LIBEXEC_PARTS="logs-management|freeipmi|xenstat|nfacct|cups"
-curl -sS http://127.0.0.1:19999/api/v1/info > ./response || exit 1
+if [ -n "${NETDATA_SKIP_EBPF}" ]; then
+ export NETDATA_SKIP_LIBEXEC_PARTS="${NETDATA_SKIP_LIBEXEC_PARTS}|ebpf"
+fi
-cat ./response
+/usr/sbin/netdata -D > ./netdata.log 2>&1 &
-jq '.version' ./response || exit 1
+"${SCRIPT_DIR}/../../packaging/runtime-check.sh" || exit 1
trap - EXIT