-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/content-origins: Verify expected vendor for all RPM packages
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
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../data/commonlib.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|