From ad68e81f1fde8e9557404763a7272961bf5417ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Wed, 23 Apr 2025 13:45:38 +0200 Subject: [PATCH] Test/cross-distro: fix processing of repo configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the code would remove everything after the first dot in the repo config filename. So 'rhel-10.0.json' -> 'rhel-10'. This means that there was just a bunch of 'rhel-X' repo config names to compare. This is probably a leftover from the days before we introduced dot-notation for distro names. Modify the test to effectivelly strip only the filename extension (the part after the last dot, including the dot). Signed-off-by: Tomáš Hozza --- test/cases/cross-distro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cases/cross-distro.sh b/test/cases/cross-distro.sh index 0aa002d86..e469005c7 100755 --- a/test/cases/cross-distro.sh +++ b/test/cases/cross-distro.sh @@ -86,7 +86,7 @@ fi # Get a list of all installed distros and compare it with a pattern matching host distribution # Filter out beta and centos-stream, see GH issue #2257 -INSTALLED_DISTROS=$(find "/usr/share/osbuild-composer/repositories" -name '*.json' -printf '%P\n' | awk -F "." '{ print $1 }' | grep -Ev 'beta|stream' | sort) +INSTALLED_DISTROS=$(find "/usr/share/osbuild-composer/repositories" -name '*.json' -printf '%P\n' | sed 's/\.[^.]*$//' | grep -Ev 'beta|stream' | sort) INSTALLED_REMAINDER=$(echo "$INSTALLED_DISTROS" | grep -v -E "$PATTERN") # Check if there are any extra distros that match the host pattern but are not recognized UNRECOGNIZED_DISTROS=$(echo "${INSTALLED_DISTROS}" | grep -v "${RECOGNIZED_DISTROS}") @@ -111,7 +111,7 @@ REPO_PATH="images/data/repositories/" # ALL_EXPECTED_DISTROS - all distros matching host pattern # ALL_REMAINDERS - all the unrecognized distros # Filter out beta and centos-stream, see GH issue #2257 -ALL_DISTROS=$(find "$REPO_PATH" -name '*.json' -printf '%P\n' | grep -v 'no-aux-key' | awk -F "." '{ print $1 }') +ALL_DISTROS=$(find "$REPO_PATH" -name '*.json' -printf '%P\n' | grep -v 'no-aux-key' | sed 's/\.[^.]*$//') ALL_EXPECTED_DISTROS=$(echo "$ALL_DISTROS" | grep -E "$PATTERN" | grep -Ev 'beta|stream' | sort) # Warning: filter out the remaining distros by matching whole words to avoid matching # the value rhel-9X by the pattern rhel-9!