Skip to content

Commit

Permalink
tests/content-origins: Verify expected vendor for all RPM packages
Browse files Browse the repository at this point in the history
As we move to support multiple streams (particularly for C9S versus RHEL)
we should ensure that we're not accidentally including content
from CentOS in official RHEL builds, and vice versa.  The RPM vendor
field is useful for this.

For now, this test just verifies Fedora and RHEL vendors, and I
tested on both.
  • Loading branch information
cgwalters committed Aug 31, 2022
1 parent 50ee01a commit 08b12b7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/kola/content-origins/data/commonlib.sh
26 changes: 26 additions & 0 deletions tests/kola/content-origins/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# kola: {"platforms": "qemu", "exclusive": false }
# Verify the RPM %{vendor} flag for everything installed matches what we expect.
#
# - platforms: qemu
# - This test should pass everywhere if it passes anywhere.

set -xeuo pipefail

. $KOLA_EXT_DATA/commonlib.sh

. /usr/lib/os-release

case "${ID}" in
fedora) vendor='Fedora Project';;
rhel|rhcos) vendor='Red Hat, Inc.';;
*) echo "Unknown operating system ID=${ID}; skipping this test"; exit 0;;
esac

cd $(mktemp -d)
rpm -qa --queryformat='%{name},%{vendor}\n' > rpmvendors.txt
if grep -vF ",${vendor}" rpmvendors.txt > unmatched.txt; then
echo 1>&2 "Expected only vendor ${vendor} for all packages"
cat unmatched.txt
fi

0 comments on commit 08b12b7

Please sign in to comment.