From 2031b3d747d8d1bb952a6d565aea104a6d1ae315 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 24 Nov 2023 11:07:13 +0100 Subject: [PATCH] repo-install-test: update package filtering logic Instead of filtering with several blacklist_* files that must contain the exact names of packages to be filtered, add a shell function that uses fnmatch for filtering. Combine all lists into one. This fixes the error we get with each limesuite release, without the need to increase the version in the txt files every time. Currently the repo-install-tests are failing for all debian versions because of this. Change-Id: I6745b10804685119d68b089f129ec9b0cde8cdf5 --- .../repo-install-test/blacklist_centos8.txt | 15 ---- .../repo-install-test/blacklist_debian10.txt | 67 ----------------- .../repo-install-test/blacklist_debian11.txt | 72 ------------------ .../repo-install-test/blacklist_debian12.txt | 75 ------------------- scripts/repo-install-test/run-inside.sh | 73 ++++++++++++------ 5 files changed, 51 insertions(+), 251 deletions(-) delete mode 100644 scripts/repo-install-test/blacklist_centos8.txt delete mode 100644 scripts/repo-install-test/blacklist_debian10.txt delete mode 100644 scripts/repo-install-test/blacklist_debian11.txt delete mode 100644 scripts/repo-install-test/blacklist_debian12.txt diff --git a/scripts/repo-install-test/blacklist_centos8.txt b/scripts/repo-install-test/blacklist_centos8.txt deleted file mode 100644 index 3e5381d7..00000000 --- a/scripts/repo-install-test/blacklist_centos8.txt +++ /dev/null @@ -1,15 +0,0 @@ -# These packages will not get explicitly installed in this test. -# Package lines must have nothing but the package (no comment, -# no additional space etc). - -# The ulfius package in network:osmocom:* is linked to the opensuse version, -# which has dependencies that exist under another name in centos -# (libgnutls-devel, libjansson-devel). Linking to the opensuse version has the -# advantage that we don't need to worry about updating the package. However, -# the dependency problem means that we can't simply install the package in -# centos. In OBS we work around this in the project config. -ulfius-devel - -# Also linked to opensuse versions -nftables-devel -python3-nftables diff --git a/scripts/repo-install-test/blacklist_debian10.txt b/scripts/repo-install-test/blacklist_debian10.txt deleted file mode 100644 index 93dac750..00000000 --- a/scripts/repo-install-test/blacklist_debian10.txt +++ /dev/null @@ -1,67 +0,0 @@ -# These packages will not get explicitly installed in this test. -# Package lines must have nothing but the package (no comment, -# no additional space etc). - -# OpenBSC -# This is legacy, we aren't really interested in testing openbsc.git -# derived packages. Packages are found in openbsc/debian/control. -openbsc-dev -osmo-bsc-mgcp -osmo-bsc-mgcp-dbg -osmocom-bs11-utils -osmocom-bs11-utils-dbg -osmocom-bsc-nat -osmocom-bsc-nat-dbg -osmocom-bsc-sccplite -osmocom-bsc-sccplite-dbg -osmocom-ipaccess-utils -osmocom-ipaccess-utils-dbg -osmocom-nitb -osmocom-nitb-dbg - -# Not relevant for the test -limesuite-images -limesuite-images23.10 - -# SoapySDR is not used anymore (see OS#3542) -soapysdr-module-lms7 -soapysdr0.6-module-lms7 -soapysdr0.6-module-lms7-dbgsym -soapysdr0.7-module-lms7 -soapysdr0.7-module-lms7-dbgsym - -# Depends on specific verions 0.5.4.38.0847 of rtl-sdr, which we won't install -librtlsdr0-dbgsym -rtl-sdr-dbgsym - -# Depends on mongodb, which was droppend from debian 10 onwards -open5gs -open5gs-amf -open5gs-amf-dbgsym -open5gs-ausf -open5gs-ausf-dbgsym -open5gs-common -open5gs-common-dbgsym -open5gs-dbg -open5gs-hss -open5gs-hss-dbgsym -open5gs-mme -open5gs-mme-dbgsym -open5gs-nrf -open5gs-nrf-dbgsym -open5gs-pcf -open5gs-pcf-dbgsym -open5gs-pcrf -open5gs-pcrf-dbgsym -open5gs-sgwc -open5gs-sgwc-dbgsym -open5gs-sgwu -open5gs-sgwu-dbgsym -open5gs-smf -open5gs-smf-dbgsym -open5gs-udm -open5gs-udm-dbgsym -open5gs-udr -open5gs-udr-dbgsym -open5gs-upf -open5gs-upf-dbgsym diff --git a/scripts/repo-install-test/blacklist_debian11.txt b/scripts/repo-install-test/blacklist_debian11.txt deleted file mode 100644 index c962ffca..00000000 --- a/scripts/repo-install-test/blacklist_debian11.txt +++ /dev/null @@ -1,72 +0,0 @@ -# These packages will not get explicitly installed in this test. -# Package lines must have nothing but the package (no comment, -# no additional space etc). - -# OpenBSC -# This is legacy, we aren't really interested in testing openbsc.git -# derived packages. Packages are found in openbsc/debian/control. -openbsc-dev -osmo-bsc-mgcp -osmo-bsc-mgcp-dbg -osmocom-bs11-utils -osmocom-bs11-utils-dbg -osmocom-bsc-nat -osmocom-bsc-nat-dbg -osmocom-bsc-sccplite -osmocom-bsc-sccplite-dbg -osmocom-ipaccess-utils -osmocom-ipaccess-utils-dbg -osmocom-nitb -osmocom-nitb-dbg - -# Causing conflicts, not relevant for the test -liblimesuite20.10-1-dbgsym -liborcania1.2 -liborcania1.2-dbgsym -liborcania2.1 -liborcania2.1-dbgsym -libulfius2.5 -libulfius2.5-dbgsym -libulfius2.7 -libulfius2.7-dbgsym -libyder2.0-dbgsym -limesuite-dbgsym -limesuite-images -limesuite-images23.10 -soapysdr0.7-module-lms7-dbgsym - -# Depends on specific verions 0.5.4.38.0847 of rtl-sdr, which we won't install -librtlsdr0-dbgsym -rtl-sdr-dbgsym - -# Depends on mongodb, which was droppend from debian 10 onwards -open5gs -open5gs-amf -open5gs-amf-dbgsym -open5gs-ausf -open5gs-ausf-dbgsym -open5gs-common -open5gs-common-dbgsym -open5gs-dbg -open5gs-hss -open5gs-hss-dbgsym -open5gs-mme -open5gs-mme-dbgsym -open5gs-nrf -open5gs-nrf-dbgsym -open5gs-pcf -open5gs-pcf-dbgsym -open5gs-pcrf -open5gs-pcrf-dbgsym -open5gs-sgwc -open5gs-sgwc-dbgsym -open5gs-sgwu -open5gs-sgwu-dbgsym -open5gs-smf -open5gs-smf-dbgsym -open5gs-udm -open5gs-udm-dbgsym -open5gs-udr -open5gs-udr-dbgsym -open5gs-upf -open5gs-upf-dbgsym diff --git a/scripts/repo-install-test/blacklist_debian12.txt b/scripts/repo-install-test/blacklist_debian12.txt deleted file mode 100644 index 9b5f5e7c..00000000 --- a/scripts/repo-install-test/blacklist_debian12.txt +++ /dev/null @@ -1,75 +0,0 @@ -# These packages will not get explicitly installed in this test. -# Package lines must have nothing but the package (no comment, -# no additional space etc). - -# OpenBSC -# This is legacy, we aren't really interested in testing openbsc.git -# derived packages. Packages are found in openbsc/debian/control. -openbsc-dev -osmo-bsc-mgcp -osmo-bsc-mgcp-dbg -osmocom-bs11-utils -osmocom-bs11-utils-dbg -osmocom-bsc-nat -osmocom-bsc-nat-dbg -osmocom-bsc-sccplite -osmocom-bsc-sccplite-dbg -osmocom-ipaccess-utils -osmocom-ipaccess-utils-dbg -osmocom-nitb -osmocom-nitb-dbg - -# Causing conflicts, not relevant for the test -liblimesuite20.10-1-dbgsym -liblimesuite22.09-1-dbgsym -liborcania1.2 -liborcania1.2-dbgsym -liborcania2.1 -liborcania2.1-dbgsym -libulfius2.5 -libulfius2.5-dbgsym -libulfius2.7 -libulfius2.7-dbgsym -libyder2.0-dbgsym -limesuite-dbgsym -limesuite-images -limesuite-images23.10 -soapysdr0.7-module-lms7 -soapysdr0.7-module-lms7-dbgsym -soapysdr-module-lms7 - -# Depends on specific verions 0.5.4.38.0847 of rtl-sdr, which we won't install -librtlsdr0-dbgsym -rtl-sdr-dbgsym - -# Depends on mongodb, which was droppend from debian 10 onwards -open5gs -open5gs-amf -open5gs-amf-dbgsym -open5gs-ausf -open5gs-ausf-dbgsym -open5gs-common -open5gs-common-dbgsym -open5gs-dbg -open5gs-hss -open5gs-hss-dbgsym -open5gs-mme -open5gs-mme-dbgsym -open5gs-nrf -open5gs-nrf-dbgsym -open5gs-pcf -open5gs-pcf-dbgsym -open5gs-pcrf -open5gs-pcrf-dbgsym -open5gs-sgwc -open5gs-sgwc-dbgsym -open5gs-sgwu -open5gs-sgwu-dbgsym -open5gs-smf -open5gs-smf-dbgsym -open5gs-udm -open5gs-udm-dbgsym -open5gs-udr -open5gs-udr-dbgsym -open5gs-upf -open5gs-upf-dbgsym diff --git a/scripts/repo-install-test/run-inside.sh b/scripts/repo-install-test/run-inside.sh index d7730ffe..425e49e9 100755 --- a/scripts/repo-install-test/run-inside.sh +++ b/scripts/repo-install-test/run-inside.sh @@ -306,48 +306,77 @@ test_conflict() { esac } -# Filter $PWD/osmocom_packages_all.txt through a blacklist_$DISTRO.txt and store the result in -# $PWD/osmocom_packages.txt. -filter_packages_txt() { - # Copy distro specific blacklist file, remove comments and sort it - grep -v "^#" /repo-install-test/blacklist_$DISTRO.txt | sort -u > blacklist.txt +filter_packages() { + for i in "$@"; do + case "$i" in + # OpenBSC + # This is legacy, we aren't really interested in testing + # openbsc.git derived packages. Packages are found in + # openbsc/debian/control. + osmo-bsc-dev) ;; + osmo-bsc-mgcp*) ;; + osmocom-bs11-utils*) ;; + osmocom-bsc-nat*) ;; + osmocom-bsc-sccplite*) ;; + osmocom-ipaccess-utils*) ;; + osmocom-nitb*) ;; - # Generate list of pkgs to be installed from available pkgs minus the ones blacklisted - comm -23 osmocom_packages_all.txt \ - blacklist.txt > osmocom_packages.txt + # Causing conflicts, not relevant for the test + liblimesuite*) ;; + liborcania*) ;; + libulfius*) ;; + libhyder*) ;; + limesuite*) ;; + soapysdr*-module-lms7*) ;; + + # Depends on specific verions 0.5.4.38.0847 of rtl-sdr, which + # we won't install + librtlsdr0-dbgsym) ;; + rtl-sdr-dbgsym) ;; + + # Depends on mongodb, which was droppend from debian 10 onwards + open5gs*) ;; + + # Dependencies that have a different name in centos8/almalinux8 + # but are pulled in by linking to opensuse packages. In OBS we + # work around this in the project config. + ulfius-devel) ;; + nftables-devel) ;; + python3-nftables) ;; + + # All other packages are not filtered + *) echo "$i" ;; + esac + done } install_repo_packages_debian() { + local packages echo "Installing all repository packages" # Get a list of all packages from the repository. Reference: # https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html - aptitude search -F%p \ - "?origin(.*$PROJ.*) ?architecture(native)" | sort \ - > osmocom_packages_all.txt + packages="$(aptitude search -F%p \ + "?origin(.*$PROJ.*) ?architecture(native)" | sort)" + packages="$(filter_packages $packages)" - cat osmocom_packages_all.txt - - filter_packages_txt - apt-get install -y --no-install-recommends $(cat osmocom_packages.txt) + apt-get install -y --no-install-recommends -- $packages } install_repo_packages_centos() { + local packages echo "Installing all repository packages" # Get a list of all packages from the repository - LANG=C.UTF-8 repoquery \ + packages=$(LANG=C.UTF-8 repoquery \ --quiet \ --repoid="$(proj_with_underscore "$PROJ")" \ --archlist="x86_64,noarch" \ --qf="%{name}" \ - | sort \ - > osmocom_packages_all.txt + | sort) - cat osmocom_packages_all.txt - - filter_packages_txt - dnf install -y $(cat osmocom_packages.txt) + packages="$(filter_packages $packages)" + dnf install -y -- $packages } install_repo_packages() {