Correctly handle eBPF check in package test script. (#17794)
Austin S. Hemmelgarn committed
May 31, 2024 at 12:58 UTC
763748593c4dccbd3d6e35ca8fc54ba7c0a09458
1 file changed
+13
-3
.github/scripts/pkg-test.sh
+13
-3
@@ -21,7 +21,9 @@ install_debian_like() {
21
! -name '*dbgsym*' ! -name '*cups*' ! -name '*freeipmi*') || exit 3
22
23
# Install testing tools
24
- apt-get install -y --no-install-recommends curl "${netcat}" jq || exit 1
24
+ apt-get install -y --no-install-recommends curl dpkg-dev "${netcat}" jq || exit 1
25
+
26
+ dpkg-architecture --equal amd64 || NETDATA_SKIP_EBPF=1
27
}
28
29
install_fedora_like() {
@@ -40,6 +42,8 @@ install_fedora_like() {
42
43
# Install testing tools
44
"${PKGMGR}" install -y curl nc jq || exit 1
45
+
46
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
47
}
48
49
install_centos() {
@@ -62,6 +66,8 @@ install_centos() {
66
# Install testing tools
67
# shellcheck disable=SC2086
68
"${PKGMGR}" install -y ${opts} curl nc jq || exit 1
69
+
70
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
71
}
72
73
install_amazon_linux() {
@@ -78,6 +84,8 @@ install_amazon_linux() {
84
# Install testing tools
85
# shellcheck disable=SC2086
86
"${PKGMGR}" install -y ${opts} curl nc jq || exit 1
87
+
88
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
89
}
90
91
install_suse_like() {
@@ -90,6 +98,8 @@ install_suse_like() {
98
99
# Install testing tools
100
zypper install -y --allow-downgrade --no-recommends curl netcat-openbsd jq || exit 1
101
+
102
+ [ "$(rpm --eval '%{_build_arch}')" = "x86_64" ] || NETDATA_SKIP_EBPF=1
103
}
104
105
dump_log() {
@@ -103,7 +113,7 @@ case "${DISTRO}" in
113
fedora | oraclelinux)
114
install_fedora_like
115
;;
106
- centos| centos-stream | rockylinux | almalinux)
116
+ centos | centos-stream | rockylinux | almalinux)
117
install_centos
118
;;
119
amazonlinux)
@@ -123,7 +133,7 @@ trap dump_log EXIT
133
export NETDATA_LIBEXEC_PREFIX=/usr/libexec/netdata
134
export NETDATA_SKIP_LIBEXEC_PARTS="logs-management|freeipmi|xenstat|nfacct|cups"
135
126
-if [ "$(uname -m)" != "x86_64" ]; then
136
+if [ -n "${NETDATA_SKIP_EBPF}" ]; then
137
export NETDATA_SKIP_LIBEXEC_PARTS="${NETDATA_SKIP_LIBEXEC_PARTS}|ebpf"
138
fi
139