From 4ea4df3179292658dc0ffac505d0e9be8ae85e3c Mon Sep 17 00:00:00 2001 From: Alex Iribarren Date: Dec 23 2021 16:57:50 +0000 Subject: Adding a test to check all comps.xml groups for installability --- diff --git a/tests/0_common/50_test_comps.sh b/tests/0_common/50_test_comps.sh new file mode 100755 index 0000000..68e607c --- /dev/null +++ b/tests/0_common/50_test_comps.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Author: Alex Iribarren + +t_Log "Running $0 - testing comps.xml groups" + +# Get **all** the group IDs +ALL_GROUPS=`dnf group list -v --hidden | grep '^ ' | sed 's/.*(\(.*\))$/\1/'` + +for GROUP in $ALL_GROUPS; do + t_Log " - testing group $GROUP" + + # Pretend to install the group, but all we really want is the solver debug data + dnf --installroot=/tmp group --releasever $centos_ver install --assumeno --debugsolver $GROUP >/dev/null + + # Check the solver results to see if there are problems + grep -qw '^problem' debugdata/rpms/solver.result + RES=$? + + # Clean up the debugdata + rm -rf debugdata/ + + # If 'problem' was not found in the results, grep returns 1 and we're happy + if [[ $RES -eq 1 ]]; then + t_CheckExitStatus 0 + else + t_CheckExitStatus 1 + fi +done